From 9abec18c8b0211d0c448b9c21fbebdc28f894275 Mon Sep 17 00:00:00 2001 From: Sean Mooney Date: Fri, 8 Nov 2024 01:50:46 +0000 Subject: [PATCH] [pre-commit] enforce pre-commit checks in ci This change moves all style checks to be run via pre-commit. To enable this in existing ci and preserve the standard developer flow the tox pep8 target is updated to run all checks via pre-commit. developers can optionally install pre-commit and/or the pre-commit commit hook to automatically or manually run the precommit hooks. Change-Id: I6ee6ed853dbf60339e7bf3da66b2e5914c218f76 --- tox.ini | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index eef2eb1d2..71e859c6b 100644 --- a/tox.ini +++ b/tox.ini @@ -38,10 +38,14 @@ passenv = PYTHONOPTIMIZE [testenv:pep8] +description = + Run style checks. +skip_install = true +deps = + pre-commit commands = - doc8 doc/source/ CONTRIBUTING.rst HACKING.rst README.rst - flake8 - #bandit -r watcher -x watcher/tests/* -n5 -ll -s B320 + pre-commit run --all-files --show-diff-on-failure + [testenv:venv] setenv = PYTHONHASHSEED=0