diff --git a/.gitignore b/.gitignore index 4b87926..0090721 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ __pycache__/ *.py[cod] /.venv /.pytest_cache +/.ruff_cache # C extensions *.so @@ -69,3 +70,6 @@ docs/_build/ # Backup files *~ *.swp + +# OCA rules +!static/lib/ diff --git a/.isort.cfg b/.isort.cfg index e9ca60f..0ec187e 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -10,4 +10,4 @@ known_odoo=odoo known_odoo_addons=odoo.addons sections=FUTURE,STDLIB,THIRDPARTY,ODOO,ODOO_ADDONS,FIRSTPARTY,LOCALFOLDER default_section=THIRDPARTY -ensure_newline_before_comments = True \ No newline at end of file +ensure_newline_before_comments = True diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bb1870f..f5c678d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,33 +36,23 @@ repos: entry: found a en.po file language: fail files: '[a-zA-Z0-9_]*/i18n/en\.po$' + - repo: https://github.com/sbidoul/whool + rev: v0.5 + hooks: + - id: whool-init - repo: https://github.com/oca/maintainer-tools - rev: 9a170331575a265c092ee6b24b845ec508e8ef75 + rev: f71041f22b8cd68cf7c77b73a14ca8d8cd190a60 hooks: # update the NOT INSTALLABLE ADDONS section above - id: oca-update-pre-commit-excluded-addons - id: oca-fix-manifest-website - args: ["https://www.noviat.com/"] + args: ["https://www.noviat.com"] + - id: oca-gen-external-dependencies - repo: https://github.com/OCA/odoo-pre-commit-hooks rev: v0.0.25 hooks: - id: oca-checks-odoo-module - id: oca-checks-po - - repo: https://github.com/myint/autoflake - rev: v1.6.1 - hooks: - - id: autoflake - args: - - --expand-star-imports - - --ignore-init-module-imports - - --in-place - - --remove-all-unused-imports - - --remove-duplicate-keys - - --remove-unused-variables - - repo: https://github.com/psf/black - rev: 22.8.0 - hooks: - - id: black - repo: https://github.com/pre-commit/mirrors-prettier rev: v2.7.1 hooks: @@ -104,37 +94,14 @@ repos: - id: check-xml - id: mixed-line-ending args: ["--fix=lf"] - - repo: https://github.com/asottile/pyupgrade - rev: v2.38.2 + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.1.3 hooks: - - id: pyupgrade - args: ["--keep-percent-format"] - - repo: https://github.com/PyCQA/isort - rev: 5.12.0 - hooks: - - id: isort - name: isort except __init__.py - args: - - --settings=. - exclude: /__init__\.py$ - - repo: https://github.com/acsone/setuptools-odoo - rev: 3.1.8 - hooks: - - id: setuptools-odoo-make-default - - id: setuptools-odoo-get-requirements - args: - - --output - - requirements.txt - - --header - - "# generated from manifests external_dependencies" - - repo: https://github.com/PyCQA/flake8 - rev: 3.9.2 - hooks: - - id: flake8 - name: flake8 - additional_dependencies: ["flake8-bugbear==21.9.2"] + - id: ruff + args: [--fix, --exit-non-zero-on-fix] + - id: ruff-format - repo: https://github.com/OCA/pylint-odoo - rev: v9.0.4 + rev: v8.0.19 hooks: - id: pylint_odoo name: pylint with optional checks diff --git a/.pylintrc b/.pylintrc index 05683e8..cfb1c50 100644 --- a/.pylintrc +++ b/.pylintrc @@ -1,16 +1,17 @@ + [MASTER] ignore-patterns=["^.*/TODO/.*$"] load-plugins=pylint_odoo score=n [ODOOLINT] -# readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst" -manifest_required_authors=Noviat -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=17.0 +# readme-template-url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst" +manifest-required-authors=Noviat +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=17.0 [MESSAGES CONTROL] disable=all @@ -41,7 +42,7 @@ enable=anomalous-backslash-in-string, license-allowed, manifest-author-string, manifest-deprecated-key, - # manifest-required-author, + manifest-required-author, manifest-required-key, manifest-version-format, method-compute, diff --git a/.pylintrc-mandatory b/.pylintrc-mandatory index 177c770..aa871c1 100644 --- a/.pylintrc-mandatory +++ b/.pylintrc-mandatory @@ -1,15 +1,15 @@ + [MASTER] -ignore-patterns=["^.*/TODO/.*$"] load-plugins=pylint_odoo score=n [ODOOLINT] -# readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst" -manifest_required_authors=Noviat -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=17.0 +readme-template-url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst" +manifest-required-authors=Odoo Community Association (OCA) +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=17.0 [MESSAGES CONTROL] disable=all @@ -33,7 +33,7 @@ enable=anomalous-backslash-in-string, license-allowed, manifest-author-string, manifest-deprecated-key, - # manifest-required-author, + manifest-required-author, manifest-required-key, manifest-version-format, method-compute, diff --git a/.ruff.toml b/.ruff.toml new file mode 100644 index 0000000..634db8e --- /dev/null +++ b/.ruff.toml @@ -0,0 +1,29 @@ + +target-version = "py310" +fix = true + +[lint] +extend-select = [ + "B", + "C90", + "I", # isort + "UP", # pyupgrade +] +exclude = ["setup/*"] + +[format] +exclude = ["setup/*"] + +[per-file-ignores] +"__init__.py" = ["F401", "I001"] # ignore unused and unsorted imports in __init__.py +"__manifest__.py" = ["B018"] # useless expression + +[isort] +section-order = ["future", "standard-library", "third-party", "odoo", "odoo-addons", "first-party", "local-folder"] + +[isort.sections] +"odoo" = ["odoo"] +"odoo-addons" = ["odoo.addons"] + +[mccabe] +max-complexity = 16 diff --git a/requirements.txt b/requirements.txt index 9cd1629..6c420f9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,3 @@ # generated from manifests external_dependencies +cryptography +fintech