Skip to content

Commit 85e68c9

Browse files
committed
Resolves #223 allow matching .DS_STORE
1 parent e7e1066 commit 85e68c9

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

src/__tests__/inputs/.DS_KINDA_STORE

Whitespace-only changes.

src/__tests__/testParsing.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,11 @@
293293
'match': True,
294294
'num': 42,
295295
'file': './inputs/annoyingTildeExtension.txt~',
296+
}, {
297+
'input': 'inputs/.DS_KINDA_STORE',
298+
'validateFileExists': True,
299+
'match': True,
300+
'file': 'inputs/.DS_KINDA_STORE',
296301
}, {
297302
'input': 'evilFile No Prepend.txt',
298303
'validateFileExists': True,

src/parse.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,12 @@
4141
# Recognize files starting with capital letter and ending in "file".
4242
# eg. Makefile
4343
'([A-Z][a-zA-Z]{2,}file)',
44+
# end trying to capture
4445
')',
4546
# Regardless of the above case, here's how the file name should terminate
4647
'(\s|$|:)+'
4748
)))
49+
4850
MASTER_REGEX_WITH_SPACES = re.compile(''.join((
4951
# begin the capture
5052
'(',
@@ -68,9 +70,9 @@
6870
# we do similar for the filename part. the 'character class' is
6971
# char or char with space following, with some added tokens like @
7072
# for retina files.
71-
'([\(\),@a-zA-Z0-9\-_+.]|\s[,\(\)@a-zA-Z0-9\-_+.])+',
73+
'([\(\),@\.a-zA-Z0-9\-_+.]|\s[,\(\)@a-zA-Z0-9\-_+.])+',
7274
# extensions dont allow spaces
73-
'\.[a-zA-Z0-9-]{1,30}'
75+
'\.[a-zA-Z0-9-]{1,30}',
7476
# end capture
7577
')',
7678
# optionally capture the line number

0 commit comments

Comments
 (0)