From e69a98f2d32d7e7d1221473ac33d84d37ac41dfc Mon Sep 17 00:00:00 2001 From: Camila Vives Date: Mon, 27 Jan 2025 16:21:17 -0300 Subject: [PATCH] Update from template --- .copier-answers.yml | 10 ++ .github/workflows/pre-commit.yml | 34 +++++++ .gitignore | 12 ++- .pre-commit-config.yaml | 69 ++++++++++++++ README.md | 25 +---- pyproject.toml | 152 +++++++++++++++++++++++++++++++ 6 files changed, 278 insertions(+), 24 deletions(-) create mode 100644 .copier-answers.yml create mode 100644 .github/workflows/pre-commit.yml create mode 100644 .pre-commit-config.yaml create mode 100644 pyproject.toml diff --git a/.copier-answers.yml b/.copier-answers.yml new file mode 100644 index 0000000..e61dbf5 --- /dev/null +++ b/.copier-answers.yml @@ -0,0 +1,10 @@ +# Do NOT update manually; changes here will be overwritten by Copier +_commit: 719579f +_src_path: https://github.com/ingadhoc/addons-repo-template.git +description: ADHOC Odoo Multi Store Related Addons +is_private: false +name: ADHOC Multi Store +odoo_version: 18.0 +pre_commit_ignore: [] +slug: '' + diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..0915d8c --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,34 @@ +# ⚠️ DO NOT EDIT THIS FILE, IT IS GENERATED BY COPIER ⚠️ +# Changes here will be lost on a future update. +# See: https://github.com/ingadhoc/addons-repo-template + +name: pre-commit + +on: + push: + branches: "*.0" + pull_request: + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v4 + - + id: setup-python + name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.10" + cache: "pip" + - + name: Pre-commit cache + uses: actions/cache@v4 + with: + path: ~/.cache/pre-commit + key: pre-commit|${{ steps.setup-python.outputs.python-version }}|${{ hashFiles('.pre-commit-config.yaml') }} + - + name: Pre-commit + uses: pre-commit/action@v3.0.1 diff --git a/.gitignore b/.gitignore index 102f889..a6d076d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +# ⚠️ DO NOT EDIT THIS FILE, IT IS GENERATED BY COPIER ⚠️ +# Changes here will be lost on a future update. +# See: https://github.com/ingadhoc/addons-repo-template + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] @@ -37,6 +41,12 @@ coverage.xml # Translations *.mo +# Ensure we never commit pgdumps +*.dump +*.sql +*.pg +*.pg.gpg + # Mr Developer .mr.developer.cfg .project @@ -50,5 +60,3 @@ coverage.xml # Sphinx documentation docs/_build/ -# -.idea/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..5c1bd68 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,69 @@ +# ⚠️ DO NOT EDIT THIS FILE, IT IS GENERATED BY COPIER ⚠️ +# Changes here will be lost on a future update. +# See: https://github.com/ingadhoc/addons-repo-template + +exclude: | + (?x) + + # We don't want to mess with tool-generated files + .svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/|^eslint.config.cjs|^prettier.config.cjs| + # Library files can have extraneous formatting (even minimized) + /static/(src/)?lib/| + # Ignore build and dist directories in addons + /build/|/dist/| + # Ignore test files in addons + /tests/samples/.*| + # You don't usually want a bot to modify your legal texts + (LICENSE.*|COPYING.*) + +# Keep in sync with .github/workflows/pre-commit.yml +default_language_version: + python: python3 + +repos: + + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: check-added-large-files + - id: check-case-conflict + - id: check-docstring-first + - id: check-executables-have-shebangs + - id: check-merge-conflict + - id: check-symlinks + - id: check-xml + - id: check-yaml + - id: debug-statements + - id: end-of-file-fixer + - id: mixed-line-ending + args: ["--fix=lf"] + - id: trailing-whitespace + # exclude autogenerated files + exclude: \.pot?$ + + - repo: https://github.com/OCA/odoo-pre-commit-hooks + rev: v0.0.35 + hooks: + - id: oca-checks-odoo-module + args: + - --disable=xml-dangerous-qweb-replace-low-priority,xml-view-dangerous-replace-low-priority,xml-oe-structure-missing-id + - id: oca-checks-po + args: + - --disable=po-pretty-format + + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.6.8 + hooks: + - id: ruff + args: [--fix, --exit-non-zero-on-fix] + - id: ruff-format + + - repo: https://github.com/OCA/pylint-odoo + rev: v9.1.3 + hooks: + - id: pylint_odoo + + - repo: https://github.com/rstcheck/rstcheck + rev: v6.2.1 + hooks: + - id: rstcheck diff --git a/README.md b/README.md index 88b8863..a299a4a 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,12 @@ -[![Code Climate](https://codeclimate.com/github/ingadhoc/multi-store/badges/gpa.svg)](https://codeclimate.com/github/ingadhoc/multi-store) +[![Coverage Status](https://coveralls.io/repos/ingadhoc//badge.png?branch=18.0)](https://coveralls.io/r/ingadhoc/?branch=18.0) +[![Code Climate](https://codeclimate.com/github/ingadhoc//badges/gpa.svg)](https://codeclimate.com/github/ingadhoc/) # ADHOC Multi Store ADHOC Odoo Multi Store Related Addons -TODO: -Talonarios () - - -Integrate sale in: -* -Integrate purchase in: -* -Integrate sale order type in: - -Filtrar en preferencias de usuario por store de cia elegida - -Cambiar valores por defecto al crear cada cosa, debría filtrar solos por los del usuario - - -[//]: # (addons) -[//]: # (end addons) - -Translation Status ------------------- -[![Transifex Status](https://www.transifex.com/projects/p/ingadhoc-multi-store-15-0/chart/image_png)](https://www.transifex.com/projects/p/ingadhoc-multi-store-15-0) ---- ADHOC **Adhoc SA** - www.adhoc.com.ar +. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..9f837a8 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,152 @@ +[tool.ruff] +line-length = 120 + +[tool.ruff.lint] +select = [ + "E", # pycodestyle errors + "W", # pycodestyle warnings + "C90", # mccabe + "F", # pyflakes + "UP", # pyupgrade + "I", # isort +] +ignore = [ + "UP008", # pyupgrade: Use `super()` instead of `super(__class__, self)` (no autofix) + "UP031", # pyupgrade: use format specifiers instead of percent format (no autofix) + "E712", # avoid equality comparisons to False (no autofix) + "E721", # do not compare types, use 'isinstance()' (no autofix) + "E722", # do not use bare `except` (no autofix) + "E731", # do not assign `lambda` expression, use a `def` (no autofix) + "E741", # ambiguos variable name (no autofix) +] + +[tool.ruff.lint.per-file-ignores] +"__init__.py" = ["F401", "I001"] +"__manifest__.py" = ["B018"] + +[tool.ruff.lint.pycodestyle] +# line-length is set in [tool.ruff], and it's used by the formatter +# in case the formatted can't autofix the line length, it will be reported as an error +# only if it exceeds the max-line-length set here. We use 999 to effectively disable +# this check. +max-line-length = 999 + +[tool.ruff.lint.isort] +combine-as-imports = true +force-wrap-aliases = true +known-third-party = [ + "dateutil", + "git", + "gnupg", + "openupgradelib", + "pkg_resources", + "psycopg2", + "requests", + "setuptools", + "urllib2", + "yaml", +] + +[tool.ruff.lint.mccabe] +max-complexity = 20 + +[tool.pylint.master] +load-plugins = ["pylint_odoo"] +score = false + +[tool.pylint.odoolint] +manifest-required-authors = "ADHOC SA" +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", +] + +[tool.pylint."messages control"] +disable = "all" +enable = [ + "anomalous-backslash-in-string", + "api-one-deprecated", + "api-one-multi-together", + "assignment-from-none", + "attribute-deprecated", + "attribute-string-redundant", + "character-not-valid-in-resource-link", + "class-camelcase", + "consider-merging-classes-inherited", + "context-overridden", + "create-user-wo-reset-password", + "dangerous-default-value", + "dangerous-filter-wo-user", + "dangerous-qweb-replace-wo-priority", + "dangerous-view-replace-wo-priority", + "deprecated-data-xml-node", + "deprecated-openerp-xml-node", + "development-status-allowed", + "duplicate-id-csv", + "duplicate-key", + "duplicate-po-message-definition", + "duplicate-xml-fields", + "duplicate-xml-record-id", + "eval-referenced", + "eval-used", + # "except-pass", # Annoying + "external-request-timeout", + "file-not-used", + "incoherent-interpreter-exec-perm", + "invalid-commit", + "license-allowed", + "manifest-author-string", + "manifest-deprecated-key", + "manifest-maintainers-list", + "manifest-required-author", + "manifest-required-key", + # "manifest-version-format", # Errors on non-migrated modules, and redundant with runbot + "method-compute", + "method-inverse", + "method-required-super", + "method-search", + "missing-newline-extrafiles", + # "missing-return", # Annoying. Not applicable for computed field methods + "odoo-addons-relative-import", + "old-api7-method-defined", + "openerp-exception-warning", + "po-msgstr-variables", + "po-syntax-error", + "pointless-statement", + "pointless-string-statement", + "print-used", + "redundant-keyword-arg", + "redundant-modulename-xml", + "reimported", + "relative-import", + "renamed-field-parameter", + "resource-not-exist", + "return-in-init", + "rst-syntax-error", + "sql-injection", + "str-format-used", + "test-folder-imported", + "too-few-format-args", + "translation-contains-variable", + "translation-field", + # "translation-positional-used", # Annoying in our use case + # "translation-required", # We don't always translate everything, and that's fine + "unnecessary-utf8-coding-comment", + "unreachable", + "use-vim-comment", + "wrong-tabs-instead-of-spaces", + "xml-attribute-translatable", + "xml-deprecated-qweb-directive", + "xml-deprecated-tree-attribute", + "xml-syntax-error" +] + +[tool.pylint.reports] +output-format = "colorized" +msg-template = "{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}"