New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add check for illegal Widnows names #1031
Add check for illegal Widnows names #1031
Conversation
17efd6f
to
994a148
Compare
Took advice from #590 and created a new PR ... sorry for delay |
name: check illegal windows names | ||
entry: Illegal windows filenames detected | ||
language: fail | ||
files: '(?i)(^|/)(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])(\.|/|$)' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add a quick little test which loads this regex from the configuration and runs it against a few expected values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@asottile @ericfrederich I recommend checking for the :
character as well (see my comment in #589 regarding :Zone.Identifier files).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jleclanche looks like this got merged without code checking for the :
but no release has been made yet.
I just checked and it's definitely a problem on Windows. I created a file foo:bar
on linux, commited, pushed, then pulled down the repo from Windows and got greeted with error: invalid path 'foo:bar'
I'll add a test for it and a new PR
644db3e
to
f2915d1
Compare
Tests added, let me know if that's what you had in mind. |
f2915d1
to
8654097
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments in pre-commit#1031
Fixes #589