From c35eafb325f19eeba62c9fadef8bb5b5f54c761e Mon Sep 17 00:00:00 2001 From: oca-git-bot Date: Fri, 14 May 2021 19:17:48 +0200 Subject: [PATCH] [IMP] update dotfiles [ci skip] --- .copier-answers.yml | 2 +- .flake8 | 4 +++- .isort.cfg | 1 + .pre-commit-config.yaml | 22 ++++++++++++---------- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/.copier-answers.yml b/.copier-answers.yml index d4ba37043..9c0e0850d 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,5 +1,5 @@ # Do NOT update manually; changes here will be overwritten by Copier -_commit: v1.1.1 +_commit: v1.1.4 _src_path: gh:oca/oca-addons-repo-template dependency_installation_mode: PIP generate_requirements_txt: true diff --git a/.flake8 b/.flake8 index 44ed868f7..e397e8ed4 100644 --- a/.flake8 +++ b/.flake8 @@ -1,5 +1,5 @@ [flake8] -max-line-length = 80 +max-line-length = 88 max-complexity = 16 # B = bugbear # B9 = bugbear opinionated (incl line length) @@ -8,3 +8,5 @@ select = C,E,F,W,B,B9 # E501: flake8 line length (covered by bugbear B950) # W503: line break before binary operator (black behaviour) ignore = E203,E501,W503 +per-file-ignores= + __init__.py:F401 diff --git a/.isort.cfg b/.isort.cfg index 7683badfa..0ec187efd 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -10,3 +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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 843012737..39121a1bf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,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$| + .svg$|/tests/([^/]+/)?cassettes/| # Maybe reactivate this when all README files include prettier ignore tags? ^README\.md$| # Library files can have extraneous formatting (even minimized) @@ -38,7 +38,13 @@ repos: rev: v1.4 hooks: - id: autoflake - args: ["-i", "--ignore-init-module-imports"] + 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: 20.8b1 hooks: @@ -47,12 +53,13 @@ repos: rev: v2.1.2 hooks: - id: prettier - name: prettier + plugin-xml + name: prettier (with plugin-xml) additional_dependencies: - "prettier@2.1.2" - "@prettier/plugin-xml@0.12.0" args: - --plugin=@prettier/plugin-xml + files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$ - repo: https://github.com/pre-commit/mirrors-eslint rev: v7.8.1 hooks: @@ -87,6 +94,7 @@ repos: rev: v2.7.2 hooks: - id: pyupgrade + args: ["--keep-percent-format"] - repo: https://github.com/PyCQA/isort rev: 5.5.1 hooks: @@ -109,13 +117,7 @@ repos: rev: 3.8.3 hooks: - id: flake8 - name: flake8 except __init__.py - exclude: /__init__\.py$ - additional_dependencies: ["flake8-bugbear==20.1.4"] - - id: flake8 - name: flake8 only __init__.py - args: ["--extend-ignore=F401"] # ignore unused imports in __init__.py - files: /__init__\.py$ + name: flake8 additional_dependencies: ["flake8-bugbear==20.1.4"] - repo: https://github.com/PyCQA/pylint rev: pylint-2.5.3