... in order to scan `src/bindings/python/bt2/setup.py.in` (it is a
valid Python program despite the name, the replacement tokens are only
in strings).
Make the pre-commit hooks run on this file as well (the technique is
described somewhere here [1]).
Doing so finds a small flake8 issue, fix it.
[1] https://pre-commit.com/#filtering-files-with-types
Change-Id: I1427d0d987884b72851741d6bb36620c5609ddb9
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/13492
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Michael Jeanson <mjeanson@efficios.com>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
rev: 23.12.1
hooks:
- id: black
+ types: [file]
+ files: \.(py|py.in)$
exclude: '(src/bindings/python/bt2/bt2/local_typing.py|tests/utils/python/normand.py|tests/utils/python/tap/.*|tests/utils/python/typing/.*)'
- repo: https://github.com/pycqa/flake8
rev: 7.1.1
hooks:
- id: flake8
+ types: [file]
+ files: \.(py|py.in)$
exclude: '(src/bindings/python/bt2/bt2/local_typing.py|tests/utils/python/normand.py|tests/utils/python/tap/.*|tests/utils/python/typing/.*)'
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
+ types: [file]
+ files: \.(py|py.in)$
exclude: '(src/bindings/python/bt2/bt2/local_typing.py|tests/utils/python/normand.py|tests/utils/python/tap/.*|tests/utils/python/typing/.*)'
# Has code to set up the DLL search path before imports.
per-file-ignores = src/bindings/python/bt2/bt2/__init__.py:F401,E402
+filename = *.py, *.py.in
+
exclude =
src/bindings/python/bt2/bt2/local_typing.py
tests/utils/python/normand.py
# Returns 'True' when running on a MinGW system.
def is_mingw():
- return sys.platform == "win32" and shutil.which("cygpath") != None
+ return sys.platform == "win32" and shutil.which("cygpath") is not None
# On MinGW systems run 'cygpath -m' on 'path', on other systems return 'path' as-is.