forked from mirrors/0ad
02e15da51b
This replaces the old arclint eslint setup 1:1 rule wise, only porting the configuration to a format recent eslint can read. Further remove the arclint setup as it is no longer of use. Thanks to Stan for reviewing all needed fixes to Javascript code to allow for adding this without compromises. Fixes: #7812 Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
85 lines
2.4 KiB
YAML
85 lines
2.4 KiB
YAML
---
|
|
repos:
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
rev: v5.0.0
|
|
hooks:
|
|
- id: check-added-large-files
|
|
args:
|
|
- --maxkb=1024
|
|
- --enforce-all
|
|
- id: check-case-conflict
|
|
- id: check-executables-have-shebangs
|
|
- id: check-json
|
|
- id: check-merge-conflict
|
|
- id: check-shebang-scripts-are-executable
|
|
- 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
|
|
)
|
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
rev: v0.11.11
|
|
hooks:
|
|
- id: ruff-check
|
|
args:
|
|
- --output-format=full
|
|
exclude: ^source/tools/webservices/
|
|
- id: ruff-format
|
|
args:
|
|
- --diff
|
|
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.11.0-1
|
|
hooks:
|
|
- id: shfmt
|
|
args:
|
|
- --diff
|
|
- --simplify
|
|
stages: [pre-commit]
|
|
- repo: https://github.com/shellcheck-py/shellcheck-py
|
|
rev: v0.10.0.1
|
|
hooks:
|
|
- id: shellcheck
|
|
- repo: https://github.com/igorshubovych/markdownlint-cli
|
|
rev: v0.45.0
|
|
hooks:
|
|
- id: markdownlint
|
|
language_version: 22.14.0
|
|
exclude: |
|
|
(?x)(
|
|
^.gitea/ISSUE_TEMPLATE/|
|
|
^source/third_party/
|
|
)
|
|
- repo: https://github.com/adrienverge/yamllint
|
|
rev: v1.37.1
|
|
hooks:
|
|
- id: yamllint
|
|
args:
|
|
- --strict
|
|
- repo: https://github.com/pre-commit/mirrors-eslint
|
|
rev: v9.27.0
|
|
hooks:
|
|
- id: eslint
|
|
additional_dependencies:
|
|
- eslint@9.27.0
|
|
- eslint-plugin-brace-rules@0.1.6
|
|
args:
|
|
- --max-warnings=0
|
|
- --no-warn-ignored
|