Commit Graph

9 Commits

Author SHA1 Message Date
Anthony Sottile 8f6152921e drop python3.6 support
python 3.6 reached end of life on 2021-12-23

Committed via https://github.com/asottile/all-repos
2022-01-15 19:24:05 -05:00
Mikhail Khvoinitsky 1e87d59a2d New hook 'destroyed-symlinks' to detect symlinks which are changed to regular files with a content of a path which that symlink was pointing to; move zsplit to util 2020-11-18 11:45:05 -08:00
Timothée Mazzucotelli 4faed34fbc Fix parsing of git output with unusual characters
On Windows, all files are "executable".
Therefore, to know if a file is supposed to be executed,
we check how its attributes were recorded by git:
we run a `git ls-files` command in a subprocess.

By default, this command outputs information
on multiple lines (file and their data separated by newlines).
When a file contains an unusual character,
the character is escaped with an integer sequence
(such as `\303\261`), and git wraps the whole filename
in double-quotes because of the backslashes.
It breaks the current code because we try to open
the filename containing the double-quotes:
it doesn't exist, of course.

Instead of trying to fix this special case by removing
the double-quotes, and breaking other cases
(a double-quote is a valid filename character on Linux),
we tell git to separate each item with the null character `\0`
instead of a new line `\n`, with the option `-z`.
With this option, git doesn't escape unusual characters
with integer sequence, so the output is fixed, and we
parse it by splitting on `\0` instead of `\n`.

Fixes #508.
2020-07-30 11:58:24 -07:00
Max Rozentsveyg f35bfed79e Don't use LocalPath.strpath 2020-05-20 12:08:42 -04:00
Max R 7848fcff22
Fix typo 2020-05-18 21:46:53 -04:00
Max Rozentsveyg 5195ba3449 Check git mode on Windows 2020-05-18 16:11:10 -07:00
Anthony Sottile f5c42a050b pre-commit-hooks: python3.6+ 2020-02-05 11:22:18 -08:00
Anthony Sottile e9aea74a77 Upgrade add-trailing-comma to 0.4.1 2017-07-15 13:06:38 -07:00
Chris Kuehl 13991f09d2 Add a checker for executables without shebangs 2017-07-02 21:14:25 -07:00