Ralph Sennhauser
631f7b292e
Using shellcheck-py[1] instead of the official shellcheck-precommit[2] to avoid a dependency on docker. [1] https://github.com/shellcheck-py/shellcheck-py [2] https://github.com/koalaman/shellcheck-precommit Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
72 lines
2.1 KiB
YAML
72 lines
2.1 KiB
YAML
---
|
|
repos:
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
rev: v4.6.0
|
|
hooks:
|
|
- id: check-case-conflict
|
|
- id: check-executables-have-shebangs
|
|
exclude: ^build/premake/premake5
|
|
- id: check-json
|
|
- id: check-merge-conflict
|
|
- id: check-shebang-scripts-are-executable
|
|
exclude: ^build/premake/premake5
|
|
- id: check-symlinks
|
|
- id: check-toml
|
|
- id: check-xml
|
|
exclude: |
|
|
(?x)(
|
|
^binaries/data/mods/_test.xero/a/b/test1.xml|
|
|
^binaries/data/mods/_test.xero/test1.xml|
|
|
^binaries/data/mods/_test.sim/simulation/templates.illformed.xml|
|
|
^binaries/data/mods/public/maps/.*\.xml
|
|
)
|
|
- id: check-yaml
|
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
rev: v0.6.1
|
|
hooks:
|
|
- id: ruff
|
|
args:
|
|
- --output-format=full
|
|
exclude: ^source/tools/webservices/
|
|
- id: ruff-format
|
|
args:
|
|
- --check
|
|
- --target-version
|
|
- py311
|
|
exclude: ^source/tools/webservices/
|
|
- repo: local
|
|
hooks:
|
|
- id: non-breaking-space-in-0ad
|
|
name: check for non-breaking space in "0 A.D."
|
|
description: |
|
|
Verify a non-breaking spaces is used in the project name ("0 A.D").
|
|
entry: '0(?!(\xc2\xa0|\\xa0)A\.D\.)\s?(?<!\\xa0)(A|a)\.(D|d)\.?'
|
|
language: pygrep
|
|
types: [text]
|
|
files: ^binaries/
|
|
exclude: (^binaries/data/mods/(mod|public)/art/.*\.xml|\.dae$)
|
|
- repo: https://github.com/scop/pre-commit-shfmt
|
|
rev: v3.9.0-1
|
|
hooks:
|
|
- id: shfmt
|
|
args:
|
|
- --diff
|
|
- --simplify
|
|
stages: [pre-commit]
|
|
exclude: ^build/premake/premake5/
|
|
- repo: https://github.com/shellcheck-py/shellcheck-py
|
|
rev: v0.10.0.1
|
|
hooks:
|
|
- id: shellcheck
|
|
exclude: ^build/premake/premake5/
|
|
- repo: https://github.com/igorshubovych/markdownlint-cli
|
|
rev: v0.41.0
|
|
hooks:
|
|
- id: markdownlint
|
|
exclude: |
|
|
(?x)(
|
|
^.gitea/ISSUE_TEMPLATE/|
|
|
^build/premake/|
|
|
^source/third_party/
|
|
)
|