Add hook for non-breaking space in 0 A.D.

This replaces the existing arclint linter to ensure the project name
does only include a non-breaking space with a pre-commit hook. The regex
to check is slightly different to account for escaped non-breaking
spaces in JavaScript files and to avoid some false-positives.
This commit is contained in:
Dunedan
2024-08-24 13:08:42 +02:00
parent a44dd59a0c
commit 1f51fcb87f
3 changed files with 11 additions and 78 deletions
+11
View File
@@ -13,3 +13,14 @@ repos:
- --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$)