From 5d921db4bc52d0455f51c1ed25fdf477c88722d7 Mon Sep 17 00:00:00 2001 From: cyrilmanuel Date: Thu, 2 Oct 2025 12:24:00 +0200 Subject: [PATCH 1/2] Fix template copier answer error --- .copier-answers.yml | 4 ++-- .pre-commit-config.yaml | 5 +++++ README.md | 8 ++++++++ cloud_platform/__manifest__.py | 2 +- logging_json/__manifest__.py | 2 +- monitoring_prometheus/__manifest__.py | 2 +- monitoring_status/__manifest__.py | 2 +- requirements.txt | 4 ---- session_redis/__manifest__.py | 2 +- 9 files changed, 20 insertions(+), 11 deletions(-) delete mode 100644 requirements.txt diff --git a/.copier-answers.yml b/.copier-answers.yml index bfe4b8d..465540e 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -13,10 +13,10 @@ github_enable_stale_action: true github_enforce_dev_status_compatibility: false include_wkhtmltopdf: false odoo_test_flavor: Both -odoo_version: 18.0 +odoo_version: 17.0 org_name: Camptocamp org_slug: camptocamp -rebel_module_groups: +rebel_module_groups: [] repo_description: 'Tools to run Odoo on a cloud platform.' repo_name: Odoo Cloud Addons repo_slug: odoo-cloud-platform diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9d54873..4730731 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,8 +2,13 @@ exclude: | (?x) # NOT INSTALLABLE ADDONS ^base_fileurl_field/| + ^cloud_platform/| + ^logging_json/| ^monitoring_log_requests/| + ^monitoring_prometheus/| ^monitoring_statsd/| + ^monitoring_status/| + ^session_redis/| ^test_base_fileurl_field/| # END NOT INSTALLABLE ADDONS # Files and folders generated by bots, to avoid loops diff --git a/README.md b/README.md index 8e8b46c..6602122 100644 --- a/README.md +++ b/README.md @@ -197,3 +197,11 @@ that explains its license. ---- + +# updating the template to create new branch XX.0 + +To generate the new branch for the next version of odoo, please update the template with : + +``` +copier update --UNSAFE +``` \ No newline at end of file diff --git a/cloud_platform/__manifest__.py b/cloud_platform/__manifest__.py index 8f4e990..eef9069 100644 --- a/cloud_platform/__manifest__.py +++ b/cloud_platform/__manifest__.py @@ -17,5 +17,5 @@ ], "website": "https://github.com/camptocamp/odoo-cloud-platform", "data": [], - "installable": False, + "installable": False, } diff --git a/logging_json/__manifest__.py b/logging_json/__manifest__.py index 75da1e0..978fc59 100644 --- a/logging_json/__manifest__.py +++ b/logging_json/__manifest__.py @@ -15,5 +15,5 @@ }, "website": "https://github.com/camptocamp/odoo-cloud-platform", "data": [], - "installable": False, + "installable": False, } diff --git a/monitoring_prometheus/__manifest__.py b/monitoring_prometheus/__manifest__.py index 612766c..95901a0 100644 --- a/monitoring_prometheus/__manifest__.py +++ b/monitoring_prometheus/__manifest__.py @@ -18,5 +18,5 @@ "external_dependencies": { "python": ["prometheus_client"], }, - "installable": False, + "installable": False, } diff --git a/monitoring_status/__manifest__.py b/monitoring_status/__manifest__.py index 946496e..85b03c7 100644 --- a/monitoring_status/__manifest__.py +++ b/monitoring_status/__manifest__.py @@ -11,5 +11,5 @@ "depends": ["base", "web"], "website": "https://github.com/camptocamp/odoo-cloud-platform", "data": [], - "installable": False, + "installable": False, } diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index a977136..0000000 --- a/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -# generated from manifests external_dependencies -prometheus_client -python-json-logger -redis diff --git a/session_redis/__manifest__.py b/session_redis/__manifest__.py index b12c2e6..a8861c9 100644 --- a/session_redis/__manifest__.py +++ b/session_redis/__manifest__.py @@ -18,5 +18,5 @@ "python": ["redis"], }, "website": "https://github.com/camptocamp/odoo-cloud-platform", - "installable": False, + "installable": False, } From 462bfe8c274f3bcac1df86edebf3354ae8bd1760 Mon Sep 17 00:00:00 2001 From: cyrilmanuel Date: Thu, 2 Oct 2025 14:07:47 +0200 Subject: [PATCH 2/2] Update repository to get version 19.0 from oca-addons-repo-template --- .copier-answers.yml | 7 +- .eslintrc.yml | 188 ---------------------------- .gitattributes | 1 + .github/workflows/pre-commit.yml | 10 +- .github/workflows/test.yml | 16 +-- .gitignore | 13 ++ .pre-commit-config.yaml | 51 +++++--- .prettierrc.yml | 8 -- .pylintrc | 60 ++++----- .pylintrc-mandatory | 59 ++++----- .ruff.toml | 9 +- README.md | 15 ++- checklog-odoo.cfg | 3 + eslint.config.cjs | 205 +++++++++++++++++++++++++++++++ prettier.config.cjs | 14 +++ 15 files changed, 349 insertions(+), 310 deletions(-) delete mode 100644 .eslintrc.yml create mode 100644 .gitattributes delete mode 100644 .prettierrc.yml create mode 100644 checklog-odoo.cfg create mode 100644 eslint.config.cjs create mode 100644 prettier.config.cjs diff --git a/.copier-answers.yml b/.copier-answers.yml index 465540e..7505f25 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,9 +1,10 @@ # Do NOT update manually; changes here will be overwritten by Copier -_commit: v1.22 +_commit: v1.35 _src_path: https://github.com/OCA/oca-addons-repo-template.git additional_ruff_rules: [] ci: GitHub convert_readme_fragments_to_markdown: true +enable_checklog_odoo: true generate_requirements_txt: true github_check_license: false github_ci_extra_env: {} @@ -13,11 +14,11 @@ github_enable_stale_action: true github_enforce_dev_status_compatibility: false include_wkhtmltopdf: false odoo_test_flavor: Both -odoo_version: 17.0 +odoo_version: 19.0 org_name: Camptocamp org_slug: camptocamp rebel_module_groups: [] -repo_description: 'Tools to run Odoo on a cloud platform.' +repo_description: Tools to run Odoo on a cloud platform. repo_name: Odoo Cloud Addons repo_slug: odoo-cloud-platform repo_website: https://github.com/camptocamp/odoo-cloud-platform diff --git a/.eslintrc.yml b/.eslintrc.yml deleted file mode 100644 index 0b38203..0000000 --- a/.eslintrc.yml +++ /dev/null @@ -1,188 +0,0 @@ -env: - browser: true - es6: true - -# See https://github.com/OCA/odoo-community.org/issues/37#issuecomment-470686449 -parserOptions: - ecmaVersion: 2022 - -overrides: - - files: - - "**/*.esm.js" - parserOptions: - sourceType: module - -# Globals available in Odoo that shouldn't produce errorings -globals: - _: readonly - $: readonly - fuzzy: readonly - jQuery: readonly - moment: readonly - odoo: readonly - openerp: readonly - owl: readonly - luxon: readonly - -# Styling is handled by Prettier, so we only need to enable AST rules; -# see https://github.com/OCA/maintainer-quality-tools/pull/618#issuecomment-558576890 -rules: - accessor-pairs: warn - array-callback-return: warn - callback-return: warn - capitalized-comments: - - warn - - always - - ignoreConsecutiveComments: true - ignoreInlineComments: true - complexity: - - warn - - 15 - constructor-super: warn - dot-notation: warn - eqeqeq: warn - global-require: warn - handle-callback-err: warn - id-blacklist: warn - id-match: warn - init-declarations: error - max-depth: warn - max-nested-callbacks: warn - max-statements-per-line: warn - no-alert: warn - no-array-constructor: warn - no-caller: warn - no-case-declarations: warn - no-class-assign: warn - no-cond-assign: error - no-const-assign: error - no-constant-condition: warn - no-control-regex: warn - no-debugger: error - no-delete-var: warn - no-div-regex: warn - no-dupe-args: error - no-dupe-class-members: error - no-dupe-keys: error - no-duplicate-case: error - no-duplicate-imports: error - no-else-return: warn - no-empty-character-class: warn - no-empty-function: error - no-empty-pattern: error - no-empty: warn - no-eq-null: error - no-eval: error - no-ex-assign: error - no-extend-native: warn - no-extra-bind: warn - no-extra-boolean-cast: warn - no-extra-label: warn - no-fallthrough: warn - no-func-assign: error - no-global-assign: error - no-implicit-coercion: - - warn - - allow: ["~"] - no-implicit-globals: warn - no-implied-eval: warn - no-inline-comments: warn - no-inner-declarations: warn - no-invalid-regexp: warn - no-irregular-whitespace: warn - no-iterator: warn - no-label-var: warn - no-labels: warn - no-lone-blocks: warn - no-lonely-if: error - no-mixed-requires: error - no-multi-str: warn - no-native-reassign: error - no-negated-condition: warn - no-negated-in-lhs: error - no-new-func: warn - no-new-object: warn - no-new-require: warn - no-new-symbol: warn - no-new-wrappers: warn - no-new: warn - no-obj-calls: warn - no-octal-escape: warn - no-octal: warn - no-param-reassign: warn - no-path-concat: warn - no-process-env: warn - no-process-exit: warn - no-proto: warn - no-prototype-builtins: warn - no-redeclare: warn - no-regex-spaces: warn - no-restricted-globals: warn - no-restricted-imports: warn - no-restricted-modules: warn - no-restricted-syntax: warn - no-return-assign: error - no-script-url: warn - no-self-assign: warn - no-self-compare: warn - no-sequences: warn - no-shadow-restricted-names: warn - no-shadow: warn - no-sparse-arrays: warn - no-sync: warn - no-this-before-super: warn - no-throw-literal: warn - no-undef-init: warn - no-undef: error - no-unmodified-loop-condition: warn - no-unneeded-ternary: error - no-unreachable: error - no-unsafe-finally: error - no-unused-expressions: error - no-unused-labels: error - no-unused-vars: error - no-use-before-define: error - no-useless-call: warn - no-useless-computed-key: warn - no-useless-concat: warn - no-useless-constructor: warn - no-useless-escape: warn - no-useless-rename: warn - no-void: warn - no-with: warn - operator-assignment: [error, always] - prefer-const: warn - radix: warn - require-yield: warn - sort-imports: warn - spaced-comment: [error, always] - strict: [error, function] - use-isnan: error - valid-jsdoc: - - warn - - prefer: - arg: param - argument: param - augments: extends - constructor: class - exception: throws - func: function - method: function - prop: property - return: returns - virtual: abstract - yield: yields - preferType: - array: Array - bool: Boolean - boolean: Boolean - number: Number - object: Object - str: String - string: String - requireParamDescription: false - requireReturn: false - requireReturnDescription: false - requireReturnType: false - valid-typeof: warn - yoda: warn diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..e0d5668 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +test-requirements.txt merge=union diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 128a6bc..d61380e 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -3,18 +3,18 @@ name: pre-commit on: pull_request: branches: - - "18.0*" + - "19.0*" push: branches: - - "18.0" - - "18.0-ocabot-*" + - "19.0" + - "19.0-ocabot-*" jobs: pre-commit: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: "3.11" - name: Get python version diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 74ea30a..c4b416b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,18 +3,18 @@ name: tests on: pull_request: branches: - - "18.0*" + - "19.0*" push: branches: - - "18.0" - - "18.0-ocabot-*" + - "19.0" + - "19.0-ocabot-*" jobs: unreleased-deps: runs-on: ubuntu-latest name: Detect unreleased dependencies steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: | for reqfile in requirements.txt test-requirements.txt ; do if [ -f ${reqfile} ] ; then @@ -35,14 +35,14 @@ jobs: fail-fast: false matrix: include: - - container: ghcr.io/oca/oca-ci/py3.10-odoo18.0:latest + - container: ghcr.io/oca/oca-ci/py3.10-odoo19.0:latest name: test with Odoo - - container: ghcr.io/oca/oca-ci/py3.10-ocb18.0:latest + - container: ghcr.io/oca/oca-ci/py3.10-ocb19.0:latest name: test with OCB makepot: "false" services: postgres: - image: postgres:12.0 + image: postgres:13 env: POSTGRES_USER: odoo POSTGRES_PASSWORD: odoo @@ -55,7 +55,7 @@ jobs: # Disable Redis check ODOO_CLOUD_PLATFORM_UNSAFE: 1 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: persist-credentials: false - name: Install addons and dependencies diff --git a/.gitignore b/.gitignore index cdcd167..7c78d89 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,19 @@ var/ *.egg *.eggs +# Windows installers +*.msi + +# Debian packages +*.deb + +# Redhat packages +*.rpm + +# MacOS packages +*.dmg +*.pkg + # Installer logs pip-log.txt pip-delete-this-directory.txt diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4730731..fed84a2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,7 @@ exclude: | # Files and folders generated by bots, to avoid loops ^setup/|/static/description/index\.html$| # We don't want to mess with tool-generated files - .svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/| + .svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/|^eslint.config.cjs|^prettier.config.cjs| # Maybe reactivate this when all README files include prettier ignore tags? ^README\.md$| # Library files can have extraneous formatting (even minimized) @@ -31,7 +31,7 @@ exclude: | (LICENSE.*|COPYING.*) default_language_version: python: python3 - node: "16.17.0" + node: "22.9.0" repos: - repo: local hooks: @@ -48,11 +48,11 @@ repos: language: fail files: '[a-zA-Z0-9_]*/i18n/en\.po$' - repo: https://github.com/sbidoul/whool - rev: v0.5 + rev: v1.3 hooks: - id: whool-init - repo: https://github.com/oca/maintainer-tools - rev: 9a170331575a265c092ee6b24b845ec508e8ef75 + rev: f9b919b9868143135a9c9cb03021089cabba8223 hooks: # update the NOT INSTALLABLE ADDONS section above - id: oca-update-pre-commit-excluded-addons @@ -61,7 +61,7 @@ repos: - id: oca-gen-addon-readme args: - --addons-dir=. - - --branch=18.0 + - --branch=19.0 - --org-name=camptocamp - --repo-name=odoo-cloud-platform - --if-source-changed @@ -69,31 +69,44 @@ repos: - --convert-fragments-to-markdown - id: oca-gen-external-dependencies - repo: https://github.com/OCA/odoo-pre-commit-hooks - rev: v0.0.25 + rev: v0.1.6 hooks: - id: oca-checks-odoo-module - id: oca-checks-po - - repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.7.1 + args: + - --disable=po-pretty-format + - repo: local hooks: - id: prettier name: prettier (with plugin-xml) - additional_dependencies: - - "prettier@2.7.1" - - "@prettier/plugin-xml@2.2.0" + entry: prettier args: - - --plugin=@prettier/plugin-xml + - --write + - --list-different + - --ignore-unknown + types: [text] files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$ - - repo: https://github.com/pre-commit/mirrors-eslint - rev: v8.24.0 + language: node + additional_dependencies: + - "prettier@3.6.2" + - "@prettier/plugin-xml@3.4.2" + - repo: local hooks: - id: eslint - verbose: true + name: eslint + entry: eslint args: - --color - --fix + verbose: true + types: [javascript] + language: node + additional_dependencies: + - "eslint@9.35.0" + - "eslint-plugin-jsdoc@57.0.8" + - "globals@16.0.0" - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v6.0.0 hooks: - id: trailing-whitespace # exclude autogenerated files @@ -102,8 +115,6 @@ repos: # exclude autogenerated files exclude: /README\.rst$|\.pot?$ - id: debug-statements - - id: fix-encoding-pragma - args: ["--remove"] - id: check-case-conflict - id: check-docstring-first - id: check-executables-have-shebangs @@ -115,13 +126,13 @@ repos: - id: mixed-line-ending args: ["--fix=lf"] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.3 + rev: v0.13.0 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] - id: ruff-format - repo: https://github.com/OCA/pylint-odoo - rev: v9.0.4 + rev: v9.3.15 hooks: - id: pylint_odoo name: pylint with optional checks diff --git a/.prettierrc.yml b/.prettierrc.yml deleted file mode 100644 index 5b6d4b3..0000000 --- a/.prettierrc.yml +++ /dev/null @@ -1,8 +0,0 @@ -# Defaults for all prettier-supported languages. -# Prettier will complete this with settings from .editorconfig file. -bracketSpacing: false -printWidth: 88 -proseWrap: always -semi: true -trailingComma: "es5" -xmlWhitespaceSensitivity: "strict" diff --git a/.pylintrc b/.pylintrc index d6dee4f..7a86d01 100644 --- a/.pylintrc +++ b/.pylintrc @@ -10,7 +10,7 @@ manifest-required-authors=Camptocamp manifest-required-keys=license manifest-deprecated-keys=description,active license-allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3 -valid-odoo-versions=18.0 +valid-odoo-versions=19.0 [MESSAGES CONTROL] disable=all @@ -23,21 +23,12 @@ disable=all # config as a blocking check. enable=anomalous-backslash-in-string, - api-one-deprecated, - api-one-multi-together, assignment-from-none, attribute-deprecated, - class-camelcase, dangerous-default-value, - dangerous-view-replace-wo-priority, development-status-allowed, - duplicate-id-csv, duplicate-key, - duplicate-xml-fields, - duplicate-xml-record-id, - eval-referenced, eval-used, - incoherent-interpreter-exec-perm, license-allowed, manifest-author-string, manifest-deprecated-key, @@ -48,57 +39,57 @@ enable=anomalous-backslash-in-string, method-inverse, method-required-super, method-search, - openerp-exception-warning, pointless-statement, pointless-string-statement, print-used, redundant-keyword-arg, - redundant-modulename-xml, reimported, - relative-import, return-in-init, - rst-syntax-error, sql-injection, too-few-format-args, translation-field, translation-required, unreachable, use-vim-comment, - wrong-tabs-instead-of-spaces, - xml-syntax-error, attribute-string-redundant, - character-not-valid-in-resource-link, consider-merging-classes-inherited, context-overridden, - create-user-wo-reset-password, - dangerous-filter-wo-user, - dangerous-qweb-replace-wo-priority, - deprecated-data-xml-node, - deprecated-openerp-xml-node, - duplicate-po-message-definition, except-pass, - file-not-used, invalid-commit, manifest-maintainers-list, - missing-newline-extrafiles, missing-readme, missing-return, odoo-addons-relative-import, - old-api7-method-defined, - po-msgstr-variables, - po-syntax-error, renamed-field-parameter, resource-not-exist, - str-format-used, test-folder-imported, translation-contains-variable, translation-positional-used, - unnecessary-utf8-coding-comment, website-manifest-key-not-valid-uri, - xml-attribute-translatable, - xml-deprecated-qweb-directive, - xml-deprecated-tree-attribute, external-request-timeout, + bad-builtin-groupby, + category-allowed, + deprecated-name-get, + deprecated-odoo-model-method, + inheritable-method-lambda, + inheritable-method-string, + invalid-email, + manifest-behind-migrations, + manifest-data-duplicated, + missing-odoo-file, + no-raise-unlink, + no-search-all, + no-wizard-in-models, + prohibited-method-override, + prefer-env-translation, + translation-format-interpolation, + translation-format-truncated, + translation-fstring-interpolation, + translation-not-lazy, + translation-too-few-args, + translation-too-many-args, + translation-unsupported-format, + no-write-in-compute, # messages that do not cause the lint step to fail consider-merging-classes-inherited, create-user-wo-reset-password, @@ -114,7 +105,8 @@ enable=anomalous-backslash-in-string, old-api7-method-defined, redefined-builtin, too-complex, - unnecessary-utf8-coding-comment + unnecessary-utf8-coding-comment, + manifest-external-assets [REPORTS] diff --git a/.pylintrc-mandatory b/.pylintrc-mandatory index 3458e28..4807646 100644 --- a/.pylintrc-mandatory +++ b/.pylintrc-mandatory @@ -9,27 +9,18 @@ manifest-required-authors=Camptocamp manifest-required-keys=license manifest-deprecated-keys=description,active license-allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3 -valid-odoo-versions=18.0 +valid-odoo-versions=19.0 [MESSAGES CONTROL] disable=all enable=anomalous-backslash-in-string, - api-one-deprecated, - api-one-multi-together, assignment-from-none, attribute-deprecated, - class-camelcase, dangerous-default-value, - dangerous-view-replace-wo-priority, development-status-allowed, - duplicate-id-csv, duplicate-key, - duplicate-xml-fields, - duplicate-xml-record-id, - eval-referenced, eval-used, - incoherent-interpreter-exec-perm, license-allowed, manifest-author-string, manifest-deprecated-key, @@ -40,57 +31,57 @@ enable=anomalous-backslash-in-string, method-inverse, method-required-super, method-search, - openerp-exception-warning, pointless-statement, pointless-string-statement, print-used, redundant-keyword-arg, - redundant-modulename-xml, reimported, - relative-import, return-in-init, - rst-syntax-error, sql-injection, too-few-format-args, translation-field, translation-required, unreachable, use-vim-comment, - wrong-tabs-instead-of-spaces, - xml-syntax-error, attribute-string-redundant, - character-not-valid-in-resource-link, consider-merging-classes-inherited, context-overridden, - create-user-wo-reset-password, - dangerous-filter-wo-user, - dangerous-qweb-replace-wo-priority, - deprecated-data-xml-node, - deprecated-openerp-xml-node, - duplicate-po-message-definition, except-pass, - file-not-used, invalid-commit, manifest-maintainers-list, - missing-newline-extrafiles, missing-readme, missing-return, odoo-addons-relative-import, - old-api7-method-defined, - po-msgstr-variables, - po-syntax-error, renamed-field-parameter, resource-not-exist, - str-format-used, test-folder-imported, translation-contains-variable, translation-positional-used, - unnecessary-utf8-coding-comment, website-manifest-key-not-valid-uri, - xml-attribute-translatable, - xml-deprecated-qweb-directive, - xml-deprecated-tree-attribute, - external-request-timeout + external-request-timeout, + bad-builtin-groupby, + category-allowed, + deprecated-name-get, + deprecated-odoo-model-method, + inheritable-method-lambda, + inheritable-method-string, + invalid-email, + manifest-behind-migrations, + manifest-data-duplicated, + missing-odoo-file, + no-raise-unlink, + no-search-all, + no-wizard-in-models, + prohibited-method-override, + prefer-env-translation, + translation-format-interpolation, + translation-format-truncated, + translation-fstring-interpolation, + translation-not-lazy, + translation-too-few-args, + translation-too-many-args, + translation-unsupported-format, + no-write-in-compute [REPORTS] msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} diff --git a/.ruff.toml b/.ruff.toml index 0240c75..5e63128 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -10,21 +10,22 @@ extend-select = [ "I", # isort "UP", # pyupgrade ] +extend-safe-fixes = ["UP008"] exclude = ["setup/*"] [format] exclude = ["setup/*"] -[per-file-ignores] +[lint.per-file-ignores] "__init__.py" = ["F401", "I001"] # ignore unused and unsorted imports in __init__.py "__manifest__.py" = ["B018"] # useless expression -[isort] +[lint.isort] section-order = ["future", "standard-library", "third-party", "odoo", "odoo-addons", "first-party", "local-folder"] -[isort.sections] +[lint.isort.sections] "odoo" = ["odoo"] "odoo-addons" = ["odoo.addons"] -[mccabe] +[lint.mccabe] max-complexity = 16 diff --git a/README.md b/README.md index 6602122..170b7cb 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -[![Pre-commit Status](https://github.com/camptocamp/odoo-cloud-platform/actions/workflows/pre-commit.yml/badge.svg?branch=18.0)](https://github.com/camptocamp/odoo-cloud-platform/actions/workflows/pre-commit.yml?query=branch%3A18.0) -[![Build Status](https://github.com/camptocamp/odoo-cloud-platform/actions/workflows/test.yml/badge.svg?branch=18.0)](https://github.com/camptocamp/odoo-cloud-platform/actions/workflows/test.yml?query=branch%3A18.0) -[![codecov](https://codecov.io/gh/camptocamp/odoo-cloud-platform/branch/18.0/graph/badge.svg)](https://codecov.io/gh/camptocamp/odoo-cloud-platform) +[![Pre-commit Status](https://github.com/camptocamp/odoo-cloud-platform/actions/workflows/pre-commit.yml/badge.svg?branch=19.0)](https://github.com/camptocamp/odoo-cloud-platform/actions/workflows/pre-commit.yml?query=branch%3A19.0) +[![Build Status](https://github.com/camptocamp/odoo-cloud-platform/actions/workflows/test.yml/badge.svg?branch=19.0)](https://github.com/camptocamp/odoo-cloud-platform/actions/workflows/test.yml?query=branch%3A19.0) +[![codecov](https://codecov.io/gh/camptocamp/odoo-cloud-platform/branch/19.0/graph/badge.svg)](https://codecov.io/gh/camptocamp/odoo-cloud-platform) @@ -200,8 +200,11 @@ that explains its license. # updating the template to create new branch XX.0 -To generate the new branch for the next version of odoo, please update the template with : +To generate the new branch for the next version of odoo, please update the template with the OCA. +You can find the src template here https://github.com/OCA/oca-addons-repo-template. + +to update the template with the same answer : ``` -copier update --UNSAFE -``` \ No newline at end of file +copier update --trust -f --data odoo_version="XX.0" +``` diff --git a/checklog-odoo.cfg b/checklog-odoo.cfg new file mode 100644 index 0000000..0b55b7b --- /dev/null +++ b/checklog-odoo.cfg @@ -0,0 +1,3 @@ +[checklog-odoo] +ignore= + WARNING.* 0 failed, 0 error\(s\).* diff --git a/eslint.config.cjs b/eslint.config.cjs new file mode 100644 index 0000000..dd0cbe0 --- /dev/null +++ b/eslint.config.cjs @@ -0,0 +1,205 @@ +var globals = require('globals'); +jsdoc = require("eslint-plugin-jsdoc"); + +const config = [{ + plugins: { + jsdoc, + }, + + languageOptions: { + globals: { + _: "readonly", + $: "readonly", + fuzzy: "readonly", + jQuery: "readonly", + moment: "readonly", + odoo: "readonly", + openerp: "readonly", + owl: "readonly", + luxon: "readonly", + QUnit: "readonly", + ...globals.browser, + }, + + ecmaVersion: 2024, + sourceType: "script", + }, + + rules: { + "accessor-pairs": "warn", + "array-callback-return": "warn", + "callback-return": "warn", + "capitalized-comments": ["warn", "always", { + ignoreConsecutiveComments: true, + ignoreInlineComments: true, + }], + complexity: ["warn", 15], + "constructor-super": "warn", + "dot-notation": "warn", + eqeqeq: "warn", + "global-require": "warn", + "handle-callback-err": "warn", + "id-blacklist": "warn", + "id-match": "warn", + "init-declarations": "error", + "max-depth": "warn", + "max-nested-callbacks": "warn", + "max-statements-per-line": "warn", + "no-alert": "warn", + "no-array-constructor": "warn", + "no-caller": "warn", + "no-case-declarations": "warn", + "no-class-assign": "warn", + "no-cond-assign": "error", + "no-const-assign": "error", + "no-constant-condition": "warn", + "no-control-regex": "warn", + "no-debugger": "error", + "no-delete-var": "warn", + "no-div-regex": "warn", + "no-dupe-args": "error", + "no-dupe-class-members": "error", + "no-dupe-keys": "error", + "no-duplicate-case": "error", + "no-duplicate-imports": "error", + "no-else-return": "warn", + "no-empty-character-class": "warn", + "no-empty-function": "error", + "no-empty-pattern": "error", + "no-empty": "warn", + "no-eq-null": "error", + "no-eval": "error", + "no-ex-assign": "error", + "no-extend-native": "warn", + "no-extra-bind": "warn", + "no-extra-boolean-cast": "warn", + "no-extra-label": "warn", + "no-fallthrough": "warn", + "no-func-assign": "error", + "no-global-assign": "error", + "no-implicit-coercion": ["warn", { + allow: ["~"], + }], + "no-implicit-globals": "warn", + "no-implied-eval": "warn", + "no-inline-comments": "warn", + "no-inner-declarations": "warn", + "no-invalid-regexp": "warn", + "no-irregular-whitespace": "warn", + "no-iterator": "warn", + "no-label-var": "warn", + "no-labels": "warn", + "no-lone-blocks": "warn", + "no-lonely-if": "error", + "no-mixed-requires": "error", + "no-multi-str": "warn", + "no-native-reassign": "error", + "no-negated-condition": "warn", + "no-negated-in-lhs": "error", + "no-new-func": "warn", + "no-new-object": "warn", + "no-new-require": "warn", + "no-new-symbol": "warn", + "no-new-wrappers": "warn", + "no-new": "warn", + "no-obj-calls": "warn", + "no-octal-escape": "warn", + "no-octal": "warn", + "no-param-reassign": "warn", + "no-path-concat": "warn", + "no-process-env": "warn", + "no-process-exit": "warn", + "no-proto": "warn", + "no-prototype-builtins": "warn", + "no-redeclare": "warn", + "no-regex-spaces": "warn", + "no-restricted-globals": "warn", + "no-restricted-imports": "warn", + "no-restricted-modules": "warn", + "no-restricted-syntax": "warn", + "no-return-assign": "error", + "no-script-url": "warn", + "no-self-assign": "warn", + "no-self-compare": "warn", + "no-sequences": "warn", + "no-shadow-restricted-names": "warn", + "no-shadow": "warn", + "no-sparse-arrays": "warn", + "no-sync": "warn", + "no-this-before-super": "warn", + "no-throw-literal": "warn", + "no-undef-init": "warn", + "no-undef": "error", + "no-unmodified-loop-condition": "warn", + "no-unneeded-ternary": "error", + "no-unreachable": "error", + "no-unsafe-finally": "error", + "no-unused-expressions": "error", + "no-unused-labels": "error", + "no-unused-vars": "error", + "no-use-before-define": "error", + "no-useless-call": "warn", + "no-useless-computed-key": "warn", + "no-useless-concat": "warn", + "no-useless-constructor": "warn", + "no-useless-escape": "warn", + "no-useless-rename": "warn", + "no-void": "warn", + "no-with": "warn", + "operator-assignment": ["error", "always"], + "prefer-const": "warn", + radix: "warn", + "require-yield": "warn", + "sort-imports": "warn", + "spaced-comment": ["error", "always"], + strict: ["error", "function"], + "use-isnan": "error", + + "jsdoc/check-tag-names": "warn", + "jsdoc/check-types": "warn", + "jsdoc/require-param-description": "off", + "jsdoc/require-return": "off", + "jsdoc/require-return-description": "off", + "jsdoc/require-return-type": "off", + + "valid-typeof": "warn", + yoda: "warn", + }, + + settings: { + jsdoc: { + tagNamePreference: { + arg: "param", + argument: "param", + augments: "extends", + constructor: "class", + exception: "throws", + func: "function", + method: "function", + prop: "property", + return: "returns", + virtual: "abstract", + yield: "yields", + }, + preferredTypes: { + array: "Array", + bool: "Boolean", + boolean: "Boolean", + number: "Number", + object: "Object", + str: "String", + string: "String", + }, + }, + }, + +}, { + files: ["**/*.esm.js", "**/*test.js"], + + languageOptions: { + ecmaVersion: 2024, + sourceType: "module", + }, +}]; + +module.exports = config diff --git a/prettier.config.cjs b/prettier.config.cjs new file mode 100644 index 0000000..e66cd82 --- /dev/null +++ b/prettier.config.cjs @@ -0,0 +1,14 @@ +/** @type {import('prettier').Config} */ + +const config = { + // https://github.com/prettier/prettier/issues/15388#issuecomment-1717746872 + plugins: [require.resolve("@prettier/plugin-xml")], + bracketSpacing: false, + printWidth: 88, + proseWrap: "always", + semi: true, + trailingComma: "es5", + xmlWhitespaceSensitivity: "preserve", +}; + +module.exports = config;