Skip to content

Commit 8c24e2c

Browse files
authored
Merge pull request #1044 from ericfrederich/more_illegal_windows_filenames
support more illegal Windows filenames
2 parents 0d20f18 + 714f1e5 commit 8c24e2c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

.pre-commit-hooks.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
name: check illegal windows names
4545
entry: Illegal windows filenames detected
4646
language: fail
47-
files: '(?i)(^|/)(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])(\.|/|$)'
47+
files: '(?i)((^|/)(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])(\.|/|$)|:)'
4848
- id: check-json
4949
name: check json
5050
description: checks json files for parseable syntax.

tests/check_illegal_windows_names_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ def hook_re():
2828
pytest.param('aux', id='without ext'),
2929
pytest.param('AuX.tXt', id='capitals'),
3030
pytest.param('com7.dat', id='com with digit'),
31+
pytest.param(':', id='bare colon'),
32+
pytest.param('file:Zone.Identifier', id='mid colon'),
3133
),
3234
)
3335
def test_check_illegal_windows_names_matches(hook_re, s):

0 commit comments

Comments
 (0)