From: Guillaume Lambert Date: Thu, 17 Jun 2021 08:20:59 +0000 (+0200) Subject: Fix: bandit pre-commit hook exclude regex X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=f4da21e2043c1baec052be6f44206bd3c31eb96f;p=releng%2Fbuilder.git Fix: bandit pre-commit hook exclude regex The 'exclude' field in pre-commit hook is a regex, not a glob, as it is advertised by pre-commit runtime warnings. "tests/*" matches "tests", "tests/" or "tests//...///" but also any file or folder, not necessarily at the root of the project, that contains "tests" in its name. The right regex to ignore the tests folder at project root is "^test/" Signed-off-by: Guillaume Lambert Change-Id: I12d8c7e2205085ef1fb2fdf267d059112729d705 --- diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ca5cf7fbb..e15b6fde9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -46,7 +46,7 @@ repos: hooks: - id: bandit # Bandit does not need to run on test code - exclude: tests/* + exclude: ^tests/ - repo: https://github.com/pycqa/pydocstyle rev: 5.0.2