From: Simon Marchi Date: Fri, 30 Aug 2024 19:32:33 +0000 (-0400) Subject: Add .pre-commit-config.yaml X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=c9870f8ae6a2b863ebca3575919d2ac11eff6fc1;p=babeltrace.git Add .pre-commit-config.yaml 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 Reviewed-on: https://review.lttng.org/c/babeltrace/+/13202 Reviewed-by: Philippe Proulx Tested-by: jenkins --- diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..a4d944f6 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,21 @@ +# 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/.*)'