Skip to content

Commit

Permalink
Merge pull request #1044 from ericfrederich/more_illegal_windows_file…
Browse files Browse the repository at this point in the history
…names

support more illegal Windows filenames
  • Loading branch information
asottile committed Apr 20, 2024
2 parents 0d20f18 + 714f1e5 commit 8c24e2c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .pre-commit-hooks.yaml
Expand Up @@ -44,7 +44,7 @@
name: check illegal windows names
entry: Illegal windows filenames detected
language: fail
files: '(?i)(^|/)(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])(\.|/|$)'
files: '(?i)((^|/)(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])(\.|/|$)|:)'
- id: check-json
name: check json
description: checks json files for parseable syntax.
Expand Down
2 changes: 2 additions & 0 deletions tests/check_illegal_windows_names_test.py
Expand Up @@ -28,6 +28,8 @@ def hook_re():
pytest.param('aux', id='without ext'),
pytest.param('AuX.tXt', id='capitals'),
pytest.param('com7.dat', id='com with digit'),
pytest.param(':', id='bare colon'),
pytest.param('file:Zone.Identifier', id='mid colon'),
),
)
def test_check_illegal_windows_names_matches(hook_re, s):
Expand Down

0 comments on commit 8c24e2c

Please sign in to comment.