Alexander Fischer
194dfbf98a
fix
2021-09-14 12:36:49 +02:00
Alexander Fischer
1cf0b2d22d
Add unique values/sort values to pretty_formatted_json
2021-09-14 11:44:38 +02:00
Mikhail Khvoinitsky
10c5e4e166
forbid-new-submodules: fix triggering failure when only a submodule is committed (without any other file); support --from-ref and --to-ref; fixes #609
2021-08-13 21:32:08 +03:00
Anthony Sottile
301195efa9
use shutil.which instead of distutils.spawn
2021-07-07 14:06:01 -04:00
Iago Alonso
fed8b6debb
Rename file causing check-json to fail
...
- `mv duplicated_key_json.{json,notjson}`
- change reference to the file in `tests/check_json_test.py`
Fixes #600
2021-05-15 12:31:33 +02:00
Anthony Sottile
a5cf10d9b2
Use more inclusive language
...
Committed via https://github.com/asottile/all-repos
2021-05-14 19:12:09 -07:00
Ville Skyttä
391ae30a64
Add check for executability of scripts with shebangs
...
Closes https://github.com/pre-commit/pre-commit-hooks/issues/543
2021-05-04 18:45:43 -07:00
jack1142
4729918bc9
Disallow any branch name in checks_vcs_permalinks
2021-04-06 18:19:19 -07:00
Krystian Chmura
f681234a0e
check also directories in check_case_conflict
...
fix #70
2021-04-04 09:27:44 -07:00
Nicholas Devenish
3abbd4785c
no-commit-to-branch: Default to both master and main
2021-03-04 15:59:25 +00:00
Aditya Khursale
fe37451719
Report duplicate keys in check_json
...
Raise ValueError and return 1 if json contains duplicate keys
2021-02-18 13:53:57 -08:00
Viacheslav Greshilov
28b2c8e431
requirements-txt-fixer now supports indents before comments
2021-01-17 21:15:05 +02: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
Youngmin Koo
1f8151aeeb
Add --additional-github-domain to check-vcs-permalinks
2020-11-18 08:58:23 -08:00
Daniel Hoherd
7e393476bd
Add --unique arg to file-contents-sorter
2020-10-25 12:18:09 -07:00
Jeremiah Gowdy
d18bd5b75f
Add new byte-order-marker checker/fixer
2020-10-11 11:31:05 -07:00
Marcus Shawcroft
012bb0691f
Fix #518 , provide --enforce-all option to check_added_large_files
...
The --enforce-all option when provided ensures that all files passed
on the command line are checked against the size limit. Default
behaviour remains unchanged.
2020-09-27 15:15:37 -07:00
Julian Berman
0c760253f3
Add a way to do case-insensitive sorting via file-contents-sorter.
2020-08-26 21:55:22 -04: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
Pedro Calleja
926208fb31
hotfix: the user may be define an extra arguments for a removed hook
2020-05-18 19:57:49 -07:00
Max R
7848fcff22
Fix typo
2020-05-18 21:46:53 -04:00
Anthony Sottile
e0c9d513c3
Merge pull request #483 from mxr/parse-reqs
...
Parse more operators in requirements
2020-05-18 16:15:10 -07:00
Max Rozentsveyg
5195ba3449
Check git mode on Windows
2020-05-18 16:11:10 -07:00
Max Rozentsveyg
7ebd420417
Parse more operators in requirements
2020-05-18 17:25:48 -04:00
Max Rozentsveyg
8febacdfed
Support checking unicode TOML
2020-05-16 21:05:37 -04:00
Anthony Sottile
c11c5483d6
check-json: resolve TODO
2020-05-14 16:29:55 -07:00
Anthony Sottile
b9cc9d7761
remove flake8 and suggest pycqa/flake8
2020-05-14 16:00:29 -07:00
Aniket Bhatnagar
bbcd31e000
Handled multiline dependencies
2020-05-08 07:10:54 -07:00
Anthony Sottile
a7f73434a6
Use covdefaults to handle coveragerc
2020-02-29 20:34:45 -08:00
Anthony Sottile
261fb3d66c
pre-commit-hooks: python3.6.1+
2020-02-24 10:57:26 -08:00
Anthony Sottile
21553c2ca9
Allow arbitrarily encoded files to be checked with detect-aws-credentials
2020-02-18 10:24:17 -08:00
Alexander Demin
75d4832e98
Unit test for empty AWS variables
2020-02-13 12:01:38 +00:00
Anthony Sottile
f5c42a050b
pre-commit-hooks: python3.6+
2020-02-05 11:22:18 -08:00
Anthony Sottile
fea76b9ea1
Fix CI by upgrading AP templates
2020-02-03 08:41:48 -08:00
Rich Rauenzahn
3724c8f668
add unit test for correct regex
2019-12-04 15:13:29 -08:00
Vinay Karanam
189e33e48c
Fixed sorting for non editable requirement urls
2019-11-14 02:22:07 +05:30
iconmaster5326
0114962a74
Added test for --markdown-linebreak-ext and --chars together
2019-10-25 12:28:50 -04:00
iconmaster5326
a2f836a23b
fix-whitespace: Added test for custom charsets
2019-10-25 11:34:26 -04:00
Anthony Sottile
86a010b750
Remove unnecessary double printing of filename
2019-10-12 13:48:13 -07:00
Barak Y. Reif
d4b544daf3
alter file with new line even if no other content is changed
2019-09-28 21:59:41 +03:00
Barak Y. Reif
da2ea3f7a7
add new line post reading requirements file, change before from tuple to list, add test cases
2019-09-28 21:40:09 +03:00
Joey Pinhas
d6c0aa5a35
Remove useless newline
2019-09-24 16:27:34 -04:00
Joey Pinhas
ec6c39ee62
Print filenames in the diff
2019-09-24 15:42:24 -04:00
Joey Pinhas
7d878b55ff
Fix test cases for unified_diff
2019-09-24 15:21:45 -04:00
Joey Pinhas
31e740ed05
Use unified_diff
2019-09-15 13:48:00 -04:00
Joey Pinhas
27cd688c8e
Flush stderr, and formatting
2019-09-15 13:29:52 -04:00
Joey Pinhas
35c76c4f33
Add test for std err
2019-09-15 12:54:03 -04:00
Joey Pinhas
831d2a99ab
Print file line stderr
2019-09-15 12:51:03 -04:00
Joey Pinhas
93b7b66cda
Remove erroneoous print statement
2019-09-13 14:38:40 -04:00