From 98f007dee62bf0f718a554f918fcb9130529b370 Mon Sep 17 00:00:00 2001 From: Carmen Bianca BAKKER Date: Fri, 28 Jun 2024 15:59:44 +0200 Subject: [PATCH] [UPD] Project template Signed-off-by: Carmen Bianca BAKKER --- .copier-answers.yml | 8 ++++---- .eslintrc.yml | 1 + .github/workflows/pre-commit.yml | 15 ++++++++++++--- .github/workflows/test.yml | 6 +++--- .gitignore | 1 + .oca_hooks.cfg | 2 ++ .pre-commit-config.yaml | 21 +++++++++++---------- 7 files changed, 34 insertions(+), 20 deletions(-) create mode 100644 .oca_hooks.cfg diff --git a/.copier-answers.yml b/.copier-answers.yml index bb778a9..c62354f 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,15 +1,17 @@ # Do NOT update manually; changes here will be overwritten by Copier -_commit: v2.1.2 +_commit: v2.2.1 _src_path: https://github.com/coopiteasy/oca-addons-repo-template.git ci: GitHub -dependency_installation_mode: OCA +convert_readme_fragments_to_markdown: false generate_requirements_txt: true github_check_license: true +github_ci_extra_env: {} github_enable_codecov: true github_enable_makepot: true github_enable_stale_action: true github_enforce_dev_status_compatibility: true include_wkhtmltopdf: false +odoo_test_flavor: OCB odoo_version: 12.0 org_name: Coop IT Easy SC org_slug: coopiteasy @@ -18,6 +20,4 @@ repo_description: hr_timesheet modules repo_name: cie-timesheet repo_slug: cie-timesheet repo_website: https://coopiteasy.be -travis_apt_packages: [] -travis_apt_sources: [] diff --git a/.eslintrc.yml b/.eslintrc.yml index 9429bc6..fed88d7 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -22,6 +22,7 @@ globals: 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 diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index c7abad2..0c862dd 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -11,12 +11,12 @@ on: jobs: pre-commit: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/setup-python@v2 with: - python-version: "3.7" + python-version: "3.6" - name: Get python version run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV - uses: actions/cache@v1 @@ -27,6 +27,15 @@ jobs: run: pip install pre-commit - name: Run pre-commit run: pre-commit run --all-files --show-diff-on-failure --color=always + env: + # Consider valid a PR that changes README fragments but doesn't + # change the README.rst file itself. It's not really a problem + # because the bot will update it anyway after merge. This way, we + # lower the barrier for functional contributors that want to fix the + # readme fragments, while still letting developers get README + # auto-generated (which also helps functionals when using runboat). + # DOCS https://pre-commit.com/#temporarily-disabling-hooks + SKIP: oca-gen-addon-readme - name: Check that all files generated by pre-commit are in git run: | newfiles="$(git ls-files --others --exclude-from=.gitignore)" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eb575ba..ab9ca51 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ on: jobs: test: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 container: ${{ matrix.container }} name: ${{ matrix.name }} strategy: @@ -19,8 +19,8 @@ jobs: matrix: include: - container: ghcr.io/oca/oca-ci/py3.6-ocb12.0:latest - makepot: "true" name: test with OCB + makepot: "true" services: postgres: image: postgres:9.6 @@ -31,7 +31,7 @@ jobs: ports: - 5432:5432 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: persist-credentials: false - name: Install addons and dependencies diff --git a/.gitignore b/.gitignore index 9c283fd..0090721 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ __pycache__/ *.py[cod] /.venv /.pytest_cache +/.ruff_cache # C extensions *.so diff --git a/.oca_hooks.cfg b/.oca_hooks.cfg new file mode 100644 index 0000000..1f3e3e4 --- /dev/null +++ b/.oca_hooks.cfg @@ -0,0 +1,2 @@ +[MESSAGES_CONTROL] +disable=xml-deprecated-data-node,xml-deprecated-tree-attribute diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a6c2f21..54a96ff 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,7 @@ exclude: | # You don't usually want a bot to modify your legal texts (LICENSE.*|COPYING.*) default_language_version: - python: python3 + python: python3.6 repos: - repo: local hooks: @@ -49,15 +49,17 @@ repos: hooks: - id: black additional_dependencies: ["click<8.1.0"] + # fixes a bug because upstream sets this to `python3` + language_version: python3.6 - repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.4.1 + rev: v1.19.1 hooks: - id: prettier name: prettier (with plugin-xml) entry: prettier --write --list-different additional_dependencies: - - "prettier@2.4.1" - - "@prettier/plugin-xml@1.1.0" + - "prettier@1.19.1" + - "@prettier/plugin-xml@0.7.2" files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$ - repo: https://github.com/pre-commit/mirrors-eslint rev: v6.8.0 @@ -101,7 +103,7 @@ repos: name: isort except __init__.py exclude: /__init__\.py$ - repo: https://github.com/acsone/setuptools-odoo - rev: 3.0.6 + rev: 3.1.8 hooks: - id: setuptools-odoo-make-default - id: setuptools-odoo-get-requirements @@ -111,14 +113,13 @@ repos: - --header - "# generated from manifests external_dependencies" - repo: https://github.com/OCA/mirrors-flake8 - rev: v3.7.9 + rev: v3.4.1 hooks: - id: flake8 - language_version: python3 name: flake8 excluding __init__.py exclude: __init__\.py - - repo: https://github.com/PyCQA/pylint - rev: v2.11.1 + - repo: https://github.com/pre-commit/mirrors-pylint + rev: v2.5.3 hooks: - id: pylint name: pylint with optional checks @@ -127,7 +128,7 @@ repos: - --exit-zero verbose: true additional_dependencies: &pylint_deps - - pylint-odoo==5.0.5 + - pylint-odoo==3.5.0 - id: pylint name: pylint with mandatory checks args: