Conversation
This can occur when checking out things on Windows, and it breaks the tarball. This adds a script to check for the presence of CR/LF which exits early if anything gets found.
scripts/check_crlf.py
Outdated
|
|
||
| for root, dirs, files in os.walk(directory): | ||
| for filename in files: | ||
| if not filename.endswith('.py'): |
There was a problem hiding this comment.
hm, this is only checking .py files but the problem was in the bashcomp file...
There was a problem hiding this comment.
As far as I can tell if I mess up the CR/LF I mess it up everywhere. I can exclude *.pyc, I thought this was fairly safe for the particular issue at hand.
Makefile
Outdated
| all: clean-pyc check test | ||
|
|
||
| check: | ||
| @$(PYTHON) scripts/check_crlf.py pygments dist || true |
There was a problem hiding this comment.
why dist? It contains only tarballs/wheels...
There was a problem hiding this comment.
Good catch, that should have been build. I've also added external.
* Include the external folder and check that. * Include .bashcomp files. * Use the correct CR/LF on the checker itself.
|
Good to go? I'd like to merge this followed by #1549 , then I just need to fix too long lines and we could turn on |
|
|
||
| with open(os.path.join(root, filename), 'rb') as f: | ||
| if b'\r\n' in f.read(): | ||
| sys.exit(1) |
There was a problem hiding this comment.
do you want to output the name of the offending file?
scripts/check_crlf.py
Outdated
| Checker for line endings | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
|
||
| Make sure each Python does not use Windows-style file endings. |
There was a problem hiding this comment.
So someone does read the docs! Thanks, good catch.
* Remove || true * Fix docs * Print the first offending file name
* Add a check for CR/LF in files. This can occur when checking out things on Windows, and it breaks the tarball. This adds a script to check for the presence of CR/LF which exits early if anything gets found. * Improve error checking. * Include the external folder and check that. * Include .bashcomp files. * Use the correct CR/LF on the checker itself. * Address review feedback. * Remove || true * Fix docs * Print the first offending file name
This can occur when checking out things on Windows, and it breaks the
tarball. This adds a script to check for the presence of CR/LF which
exits early if anything gets found.