Skip to content
Extraits de code Groupes Projets
Valider 29955366 rédigé par Benjamin - Le Filament's avatar Benjamin - Le Filament
Parcourir les fichiers

[CLEAN] pre-commit

parent 91c13c90
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -12,15 +12,11 @@ exclude: |
/static/(src/)?lib/|
# Repos using Sphinx to generate docs don't need prettying
^docs/_templates/.*\.html$|
# Don't bother non-technical authors with formatting issues in docs
readme/.*\.(rst|md)$|
# Ignore build and dist directories in addons
/build/|/dist/|
# You don't usually want a bot to modify your legal texts
(LICENSE.*|COPYING.*)
default_language_version:
python: python3
node: "16.17.0"
node: "14.13.0"
repos:
- repo: local
hooks:
......@@ -37,38 +33,40 @@ repos:
language: fail
files: '[a-zA-Z0-9_]*/i18n/en\.po$'
- repo: https://github.com/oca/maintainer-tools
rev: f71041f22b8cd68cf7c77b73a14ca8d8cd190a60
rev: ab1d7f6
hooks:
# update the NOT INSTALLABLE ADDONS section above
- id: oca-update-pre-commit-excluded-addons
- id: oca-fix-manifest-website
args: ["https://le-filament.com"]
- id: oca-gen-addon-readme
- repo: https://github.com/myint/autoflake
rev: v1.4
hooks:
- id: autoflake
args:
- --addons-dir=.
- --branch=16.0
- --org-name=lefilament
- --repo-name=template_module
- --if-source-changed
- --keep-source-digest
- repo: https://github.com/OCA/odoo-pre-commit-hooks
rev: v0.0.25
- --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.3.0
hooks:
- id: oca-checks-odoo-module
- id: oca-checks-po
- id: black
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
rev: v2.1.2
hooks:
- id: prettier
name: prettier (with plugin-xml)
additional_dependencies:
- "prettier@2.7.1"
- "@prettier/plugin-xml@2.2.0"
- "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: v8.24.0
rev: v7.8.1
hooks:
- id: eslint
verbose: true
......@@ -76,7 +74,7 @@ repos:
- --color
- --fix
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v3.2.0
hooks:
- id: trailing-whitespace
# exclude autogenerated files
......@@ -97,14 +95,27 @@ repos:
- id: check-xml
- id: mixed-line-ending
args: ["--fix=lf"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.3
- repo: https://github.com/asottile/pyupgrade
rev: v2.7.2
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/PyCQA/flake8
rev: 3.8.3
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
- id: flake8
name: flake8
additional_dependencies: ["flake8-bugbear==20.1.4"]
- repo: https://github.com/OCA/pylint-odoo
rev: v8.0.19
rev: 7.0.2
hooks:
- id: pylint_odoo
name: pylint with optional checks
......
# Copyright 2023 Le Filament (https://le-filament.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
from . import acc_operation
......@@ -4,8 +4,7 @@
from datetime import datetime
from dateutil.relativedelta import relativedelta
from odoo import _, fields, models
from odoo import _, models
from odoo.exceptions import ValidationError
from odoo.tools import date_utils
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter