mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-16 02:21:46 +04:00
surround filenames containing whitespace with quotes
This commit is contained in:
parent
cb40e9682e
commit
8ddeaab59d
1 changed files with 6 additions and 0 deletions
|
|
@ -109,6 +109,12 @@ class Classifier:
|
|||
hook.types_or,
|
||||
hook.exclude_types,
|
||||
)
|
||||
|
||||
# surround filenames containing whitespace with quotes
|
||||
for f in names:
|
||||
if re.search(r"\s", f):
|
||||
f = '"' + f + '"'
|
||||
|
||||
return tuple(names)
|
||||
|
||||
@classmethod
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue