From 84f169034abea44e63a30e41cbb4a250b3d15632 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Mon, 22 Jul 2024 13:08:25 +0200 Subject: [PATCH] Modernize pre-commit config --- .pre-commit-config.yaml | 39 ++++++++++++++------------------------- tests/test_click_odoo.py | 24 ++++++------------------ 2 files changed, 20 insertions(+), 43 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f46d76b..074ceb0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/tests/test_click_odoo.py b/tests/test_click_odoo.py index 392dac8..bd8d973 100644 --- a/tests/test_click_odoo.py +++ b/tests/test_click_odoo.py @@ -94,9 +94,7 @@ def test_click_odoo_args(odoodb): """\ sys.argv = {} a -b -d __name__ = __main__ - """.format( - script - ) + """.format(script) ) @@ -117,9 +115,7 @@ def test_click_odoo_shebang_args(odoodb): """\ sys.argv = {} a -b -d __name__ = __main__ - """.format( - script - ) + """.format(script) ) @@ -188,9 +184,7 @@ def testcmd(env): """\ [options] db_name={} - """.format( - odoodb - ) + """.format(odoodb) ) ) result = runner.invoke(testcmd, ["-c", str(odoocfg1)]) @@ -216,9 +210,7 @@ def testcmd(env): """\ [options] db_name={},notadb - """.format( - odoodb - ) + """.format(odoodb) ) ) result = runner.invoke(testcmd, ["-c", str(odoocfg3)]) @@ -254,9 +246,7 @@ def testcmd(env): """\ [options] db_name={} - """.format( - odoodb - ) + """.format(odoodb) ) ) result = runner.invoke(testcmd, ["-c", str(odoocfg1)]) @@ -289,9 +279,7 @@ def testcmd(env): """\ [options] db_name={} - """.format( - odoodb - ) + """.format(odoodb) ) ) result = runner.invoke(testcmd, ["-c", str(odoocfg1)])