Add yamllint to pre-commit

Adding a hook to pre-commit to enforce a consistent style and remove the
hook check-yaml which only checks if a document is parsable and so
become redundant.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
Ralph Sennhauser 2024-09-05 09:46:13 +02:00 committed by Dunedan
parent 87f667732c
commit 966d859050
2 changed files with 15 additions and 1 deletions

View File

@ -20,7 +20,6 @@ repos:
^binaries/data/mods/_test.sim/simulation/templates.illformed.xml| ^binaries/data/mods/_test.sim/simulation/templates.illformed.xml|
^binaries/data/mods/public/maps/.*\.xml ^binaries/data/mods/public/maps/.*\.xml
) )
- id: check-yaml
- repo: https://github.com/astral-sh/ruff-pre-commit - repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.1 rev: v0.6.1
hooks: hooks:
@ -69,3 +68,10 @@ repos:
^build/premake/| ^build/premake/|
^source/third_party/ ^source/third_party/
) )
- repo: https://github.com/adrienverge/yamllint
rev: v1.35.1
hooks:
- id: yamllint
args:
- --strict
exclude: ^build/premake/premake5/

8
.yamllint.yaml Normal file
View File

@ -0,0 +1,8 @@
---
# https://yamllint.readthedocs.io/en/stable/index.html
extends: default
rules:
line-length:
max: 100
truthy:
check-keys: false