Add pre-commit config and update README

See also https://src.fedoraproject.org/tests/llvm/pull-request/27
This commit is contained in:
Konrad Kleine 2024-05-03 15:22:07 +02:00
commit c8bf19d221
2 changed files with 30 additions and 0 deletions

14
.pre-commit-config.yaml Normal file
View file

@ -0,0 +1,14 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
# See https://tmt.readthedocs.io/en/latest/guide.html#checking-data-validity
- repo: https://github.com/teemtee/tmt.git
rev: 1.32.2
hooks:
- id: tmt-lint

View file

@ -105,3 +105,19 @@ tier: 1
# tag+:
# - sometag
```
### Avoid common errors using pre-commit
This project uses [`pre-commit`](https://pre-commit.com/)
* to [lint fmf files](https://tmt.readthedocs.io/en/latest/guide.html#lint)
* to check that you don't have [trailing
whitespaces](https://github.com/pre-commit/pre-commit-hooks?tab=readme-ov-file#trailing-whitespace)
* to check that [files end with a
newline](https://github.com/pre-commit/pre-commit-hooks?tab=readme-ov-file#end-of-file-fixer)
Please install `pre-commit` using `pip install pre-commit` as described
[here](https://pre-commit.com/#install). Then navigate to your clone of this
project and install the git hook scripts using `pre-commit install`. This will
run pre-commit on every `git commit` that you make in this repository from now
on.