parent
fbe56136dd
commit
5b4484e401
@ -75,3 +75,10 @@ repos:
|
||||
args:
|
||||
- --strict
|
||||
exclude: ^build/premake/premake5/
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: sane-filenames
|
||||
name: sane-filenames
|
||||
language: python
|
||||
types: [file]
|
||||
entry: ./lint/pre-commit-hooks/sane_filenames.py
|
||||
|
16
lint/pre-commit-hooks/sane_filenames.py
Executable file
16
lint/pre-commit-hooks/sane_filenames.py
Executable file
@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import re
|
||||
import sys
|
||||
|
||||
|
||||
re_allowed_name = re.compile("^[-_./A-Za-z0-9]*$")
|
||||
|
||||
has_error = False
|
||||
for f in sys.argv[1:]:
|
||||
if not re_allowed_name.match(f):
|
||||
has_error = True
|
||||
print(f)
|
||||
|
||||
if has_error:
|
||||
sys.exit(1)
|
Loading…
Reference in New Issue
Block a user