Skip to content

Commit

Permalink
Modernize pre-commit config
Browse files Browse the repository at this point in the history
  • Loading branch information
sbidoul committed Jul 22, 2024
1 parent 2e96948 commit 84f1690
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 43 deletions.
39 changes: 14 additions & 25 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,15 @@
exclude: "^tests/data/.*$"
repos:
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: debug-statements
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies: ["flake8-bugbear==20.1.4"]
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
hooks:
- id: pyupgrade
args: ["--py36-plus"]
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: debug-statements
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.2
hooks:
- id: ruff
args: [--exit-non-zero-on-fix]
- id: ruff-format
24 changes: 6 additions & 18 deletions tests/test_click_odoo.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@ def test_click_odoo_args(odoodb):
"""\
sys.argv = {} a -b -d
__name__ = __main__
""".format(
script
)
""".format(script)
)


Expand All @@ -117,9 +115,7 @@ def test_click_odoo_shebang_args(odoodb):
"""\
sys.argv = {} a -b -d
__name__ = __main__
""".format(
script
)
""".format(script)
)


Expand Down Expand Up @@ -188,9 +184,7 @@ def testcmd(env):
"""\
[options]
db_name={}
""".format(
odoodb
)
""".format(odoodb)
)
)
result = runner.invoke(testcmd, ["-c", str(odoocfg1)])
Expand All @@ -216,9 +210,7 @@ def testcmd(env):
"""\
[options]
db_name={},notadb
""".format(
odoodb
)
""".format(odoodb)
)
)
result = runner.invoke(testcmd, ["-c", str(odoocfg3)])
Expand Down Expand Up @@ -254,9 +246,7 @@ def testcmd(env):
"""\
[options]
db_name={}
""".format(
odoodb
)
""".format(odoodb)
)
)
result = runner.invoke(testcmd, ["-c", str(odoocfg1)])
Expand Down Expand Up @@ -289,9 +279,7 @@ def testcmd(env):
"""\
[options]
db_name={}
""".format(
odoodb
)
""".format(odoodb)
)
)
result = runner.invoke(testcmd, ["-c", str(odoocfg1)])
Expand Down

0 comments on commit 84f1690

Please sign in to comment.