Commit Graph

293 Commits

Author SHA1 Message Date
Jascha Geerds 53a05b952c Add "pydevd_pycharm" to list of debug statements 2020-07-01 17:15:46 +02:00
Anthony Sottile c14b3aa54f sed -i s/whitelist/allowlist/g 2020-06-17 08:27:11 -07: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
Anthony Sottile e75e18033d
Merge pull request #484 from mxr/flake8-comprehensions
Fix C407
2020-05-18 16:19:13 -07: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 c8d9fb183f Fix C407 2020-05-18 17:34:38 -04:00
Max Rozentsveyg 7ebd420417 Parse more operators in requirements 2020-05-18 17:25:48 -04:00
Anthony Sottile 3d379a962d
Merge pull request #481 from mxr/rm-type-ignore
Remove `type: ignore`
2020-05-16 19:26:32 -07:00
Max Rozentsveyg c03ac576a3 Remove `type: ignore` 2020-05-16 22:21:03 -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 21553c2ca9 Allow arbitrarily encoded files to be checked with detect-aws-credentials 2020-02-18 10:24:17 -08:00
Dawid Kosiński 43bfa05e89 added wdb to DEBUG_STATEMENTS set 2020-02-18 19:10:23 +01:00
Alexander Demin b3a28deca7 Review fixes 2020-02-13 17:12:45 +00:00
Alexander Demin 75d4832e98 Unit test for empty AWS variables 2020-02-13 12:01:38 +00:00
Alexander Demin ace459bec5 Skip empty variables in detect_aws_credentials 2020-02-12 21:54:05 +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 612a4b18cf
fix regular expression for test files 2019-12-04 11:45:21 -08:00
Vinay Karanam 189e33e48c Fixed sorting for non editable requirement urls 2019-11-14 02:22:07 +05:30
iconmaster5326 a33a8f0d8a Change parameter name to "chars" and move encoding outside loop 2019-10-25 12:20:04 -04:00
Iconmaster dcbf43489c
Apply suggestion: the `bytes(...)` call does nothing here 2019-10-25 12:15:11 -04:00
iconmaster5326 c431f09ac3 Fix failure on Python 2 2019-10-25 11:54:00 -04:00
iconmaster5326 a2f836a23b fix-whitespace: Added test for custom charsets 2019-10-25 11:34:26 -04:00
iconmaster5326 886dfc4205 trailing-whitespace: add option for custom chars to strip 2019-10-25 11:12:49 -04:00
Anthony Sottile 86a010b750 Remove unnecessary double printing of filename 2019-10-12 13:48:13 -07:00
Barak Y. Reif e4cfaa6b68 remove redundent type annotation 2019-09-28 22:16:20 +03: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 ea8fbf9cf0 Remove unneeded string join 2019-09-24 15:47:53 -04:00
Joey Pinhas ec6c39ee62 Print filenames in the diff 2019-09-24 15:42:24 -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 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
Joey Pinhas 0ff23d4e9f Remove extra cli flag, and update test case
This commit uses capsys to test the output of the diff, which is now
hidden behind the autofix flag if it's disabled
2019-09-13 14:30:52 -04:00
Joey Pinhas b28837a038 Add test case to test diffing function 2019-08-23 14:14:10 -04:00
Joey Pinhas 780f20249f Add option to show expected output
This prints a diff between the given json file and the expected
(pretty) output, with this functionality hidden behind a cli flag
2019-08-16 12:40:57 -04:00
Joey Pinhas 3e9db01775 Add logic to print line number of JSON errors
This commit makes the pretty JSON check more verbose when it encounters
errors, that way developers can see which lines are causing errors in
order to debug.
2019-08-15 12:32:33 -04:00
Anthony Sottile c245a7c5e5
Merge pull request #400 from pycontribs/toml-checker
Toml checker
2019-08-05 10:28:00 -07:00
Sorin Sbarnea 317aef4961 Added tests for check_toml
Also assures we print filename when error occurs.
2019-08-03 19:40:57 +01:00
Squeaky 611a4443d7 add sys.exit(main()) to file_contents_sorter.py 2019-08-03 20:34:39 +02:00
Semyon Maryasin 771156fb5e Use toml rather than pytoml
Pytoml has an issue with error messages: https://github.com/avakar/pytoml/issues/41
2019-08-03 19:16:51 +01:00
Semyon Maryasin ae70f7e3c7 Add check-toml hook 2019-08-03 19:16:51 +01:00
Dan LaManna e34f0c44aa Add the rpdb debugger to the list of debugger packages 2019-06-05 12:29:23 -04:00
Anthony Sottile 711b730b67 Fix crlf line endings for double-quote-string-fixer 2019-05-16 09:42:04 -07:00
Anthony Sottile 79a1b2676e Handle crlf endings in fix-encoding-pragma 2019-05-15 10:04:18 -07:00
roottool fc9fb8bfa8 Changed position of 'import io' 2019-04-22 04:24:41 +09:00
roottool 47c89785e8 Added newline 2019-04-22 04:17:09 +09:00
roottool e7924b53e4 Changed from open() to io.open() 2019-04-22 03:48:18 +09:00
Anthony Sottile 053feb1e6f Use AbstractSet to appease mypy 2019-04-20 16:21:58 -07:00
Marc Jay a7af812449 Make optional argument use an immutable set for the default value
in no-commit-to-branch. Make other sets immutable to satisfy type-checking
and be consistent
2019-04-20 23:07:14 +01:00
Marc Jay 8d2785b9d6 Amend approach for no-commit-to-branch to use regex matching based on
feedback. Adds --pattern optional argument which can be used alongside
--branch to block commits to a branch which matches a supplied
regex expression
2019-04-20 13:46:49 +01:00
Marc Jay d6847c4827 Add wildcard matching to no-commit-to-branch hook so that commits can
be blocked on, for example, all release branches with 'release/*'
2019-04-09 23:53:39 +01:00
Anthony Sottile 2f6a2515ec Don't require an encoding for check-docstring-first 2019-03-30 15:31:42 -07:00
Anthony Sottile 8bb94f0bd4 azure pipelines [skip travis] [skip appveyor] 2019-03-10 16:56:44 -07:00
Anthony Sottile 8626e266dd double-quote-string-fixer 2019-02-11 19:57:37 -08:00
Anthony Sottile 4575652bd2 Use default flake8 config 2019-02-11 19:56:15 -08:00
Anthony Sottile 030bfac7e4 Apply typing to all of pre-commit-hooks 2019-01-31 20:09:15 -08:00
Anthony Sottile 63cc3414e9 Updates for flake8 3.7 2019-01-30 00:15:11 -08:00
Anthony Sottile e7158ce14d pre-commit autoupdate 2019-01-02 10:31:51 -08:00
Anthony Sottile a762639038 switch from pyyaml to ruamel.yaml 2018-12-28 13:09:17 -08:00
Andy Gimblett 59ed512020 In mixed-line-endings, move check/print to main() as suggested by asottile (PR 341) 2018-11-26 17:35:03 +00:00
Andy Gimblett f3c65bcd20 Report failing filenames when --fix=no in mixed-line-endings 2018-11-26 10:17:52 +00:00
Ryan Delaney 0d83fed4fa Reword usage info to clarify required usage syntax 2018-10-28 16:00:01 -07:00
Ryan Delaney 2d4833c73e Rename metavar to clarify required usage syntax 2018-10-28 15:58:14 -07:00
Ryan Delaney b1feed0ced Add ban for pgp/gpg private key blocks 2018-10-22 12:11:59 -07:00
mtkennerly e694a6cfc2 Incorporate patch to support isolated CR 2018-10-13 19:44:02 -04:00
mtkennerly 2ab5832ce1 Preserve CRLF if file already ends that way 2018-10-13 19:00:22 -04:00
mtkennerly abd3d0ec3f Fix CRLF lines 2018-10-13 07:26:53 -04:00
Anthony Sottile 08e2918d60
Merge pull request #321 from pre-commit/suggest_mirrors_autopep8
Remove autopep8-wrapper in favor of autopep8
2018-10-12 19:23:26 -07:00
Anthony Sottile 99453a5366 Default --no-markdown-linebreak-ext for trailing-whitespace 2018-10-12 18:15:39 -07:00
Anthony Sottile 526904b159 Remove autopep8-wrapper in favor of autopep8 2018-10-11 17:19:35 -07:00
Vinay Karanam 64b9f3dcf0 Added --assume-in-merge option for check-merge-conflict
Fixes #300
2018-06-26 23:59:40 +05:30
Anthony Sottile 9bf684c131
Merge pull request #297 from pre-commit/warnings
Fix resource warnings
2018-06-18 08:21:00 -07:00
Anthony Sottile 5dc306b35d Fix resource warnings 2018-06-18 00:00:38 -07:00
Anthony Sottile 6239384547 Fix invalid escape sequences 2018-06-17 23:52:13 -07:00
Anthony Sottile baec308367 Allow multiple branches to be protected
Original patch by @moas
2018-06-09 11:18:33 -07:00
Anthony Sottile c72ad40a6d Improve vcs regex (don't match whitespace) 2018-06-04 10:10:14 -07:00
vin01 45d3850244 Detect putty & sshcom private keys 2018-05-19 00:31:16 +01:00
Anthony Sottile df93509aed Explicitly check for `ast.Name` 2018-05-17 17:14:25 -07:00
Anthony Sottile 18b3ab7cd2 debug-statements: detect python3.7+ breakpoint() 2018-05-13 15:28:39 -07:00
Michał Sochoń 54c0f8c937 Open files as UTF-8 2018-03-26 12:00:48 +02:00
Michał Sochoń 980fc9bdc3 Fix flake8 error
Forgot to rename one var...
2018-03-26 00:41:21 +02:00
Michał Sochoń b0d44c7084 Ensure not to alter list in 'for' loop 2018-03-26 00:17:13 +02:00
Michał Sochoń 9e28aaf275 Simplify check, extend README 2018-03-26 00:02:23 +02:00
Michał Sochoń 1d6ad0d6ed Provide automatic removal of pkg-resources==0.0.0
Should help to deal with that pretty paintuly issue under Ubuntu/Debian
family:
https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1635463
2018-03-25 23:34:02 +02:00
Anthony Sottile a21def36e3 Add an `--unsafe` option to `check-yaml` 2018-03-19 09:28:18 -07:00
Anthony Sottile 38e02ff508 Don't add end-of-file newline while trimming whitespace 2018-02-28 08:43:07 -08:00
Anthony Sottile 93f319c1f8 Fix no-commit-to-branch when not on a branch 2018-02-19 12:56:14 -08:00
Pablo Vega 83fca4c614 Adding a check to make sure either spaces or null values are not mistakenly added into the key variable 2018-01-26 00:28:39 -08:00
nicain 70ee59f9e6
Update detect_private_key.py 2018-01-13 17:16:50 -08:00
Anthony Sottile cf04ab0186
Merge pull request #254 from cas--/refactor/pretty-format-json
Refactor/pretty format json
2017-12-11 08:33:13 -08:00
Calum Lind 5b6ddaf9f7 Fix pretty_format_json to use int indent
The indent parameter for json should be integer and under Python2 is
will raise an error if not. So switch from str to int and mention
default value in help text.
2017-12-10 22:33:33 +00:00
Calum Lind 00974efa31 Remove pretty_format_json simplejson dependency
* The simplejson module is only needed for <=py25 so replace with builtin json.
 * Replace six dependecy for simple Py2 check for convertion to unicode.
 * Cleanup quotes.
2017-12-10 22:33:33 +00:00
Ben Webber 775867626d check-builtin-literals: Ignore function attribute calls 2017-11-30 18:33:36 +00:00