This can help catch problems a bit earlier than in the CI.
To use it, a developer would run `pre-commit` in the source repository.
This installs git commit hooks that will run the checks described by
`.pre-commit-config.yaml` on the modified files.
It is possible to run the checks on all files with:
$ pre-commit run --all-files
black....................................................................Passed
flake8...................................................................Passed
isort....................................................................Passed
Change-Id: I695f0b0f2fea3adadae132ceb708928db3217e0c
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/13202
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
--- /dev/null
+# SPDX-License-Identifier: MIT
+#
+# Copyright (C) 2024 EfficiOS, Inc.
+#
+
+repos:
+ - repo: https://github.com/psf/black-pre-commit-mirror
+ rev: 23.12.1
+ hooks:
+ - id: black
+ exclude: '(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
+ exclude: '(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
+ exclude: '(tests/utils/python/normand.py|tests/utils/python/tap/.*|tests/utils/python/typing/.*)'