Douglas Eichelberger
887db502c6
Sync fork ( #1 )
...
* [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/setup-cfg-fmt: v2.1.0 → v2.2.0](https://github.com/asottile/setup-cfg-fmt/compare/v2.1.0...v2.2.0 )
- [github.com/asottile/reorder_python_imports: v3.8.5 → v3.9.0](https://github.com/asottile/reorder_python_imports/compare/v3.8.5...v3.9.0 )
- [github.com/asottile/pyupgrade: v3.1.0 → v3.2.0](https://github.com/asottile/pyupgrade/compare/v3.1.0...v3.2.0 )
- [github.com/pre-commit/mirrors-autopep8: v1.7.0 → v2.0.0](https://github.com/pre-commit/mirrors-autopep8/compare/v1.7.0...v2.0.0 )
* [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v3.2.0 → v3.2.2](https://github.com/asottile/pyupgrade/compare/v3.2.0...v3.2.2 )
- [github.com/pre-commit/mirrors-mypy: v0.982 → v0.990](https://github.com/pre-commit/mirrors-mypy/compare/v0.982...v0.990 )
* remove no_implicit_optional
this is the default in mypy 0.990
Committed via https://github.com/asottile/all-repos
* [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-mypy: v0.990 → v0.991](https://github.com/pre-commit/mirrors-mypy/compare/v0.990...v0.991 )
* v4.4.0
* [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/PyCQA/flake8: 5.0.4 → 6.0.0](https://github.com/PyCQA/flake8/compare/5.0.4...6.0.0 )
* [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v3.2.2 → v3.3.0](https://github.com/asottile/pyupgrade/compare/v3.2.2...v3.3.0 )
* [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/add-trailing-comma: v2.3.0 → v2.4.0](https://github.com/asottile/add-trailing-comma/compare/v2.3.0...v2.4.0 )
- [github.com/asottile/pyupgrade: v3.3.0 → v3.3.1](https://github.com/asottile/pyupgrade/compare/v3.3.0...v3.3.1 )
* [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-autopep8: v2.0.0 → v2.0.1](https://github.com/pre-commit/mirrors-autopep8/compare/v2.0.0...v2.0.1 )
* azure pipelines -> github actions
* add constraints file to requirements-txt-fixer files
* [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-mypy: v0.991 → v1.0.0](https://github.com/pre-commit/mirrors-mypy/compare/v0.991...v1.0.0 )
* [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-mypy: v1.0.0 → v1.0.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.0.0...v1.0.1 )
* [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-autopep8: v2.0.1 → v2.0.2](https://github.com/pre-commit/mirrors-autopep8/compare/v2.0.1...v2.0.2 )
* [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-mypy: v1.0.1 → v1.1.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.0.1...v1.1.1 )
* [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-mypy: v1.1.1 → v1.2.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.1.1...v1.2.0 )
* [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v3.3.1 → v3.3.2](https://github.com/asottile/pyupgrade/compare/v3.3.1...v3.3.2 )
* [pre-commit.ci] pre-commit autoupdate
updates:
- https://github.com/asottile/reorder_python_imports → https://github.com/asottile/reorder-python-imports
- [github.com/asottile/pyupgrade: v3.3.2 → v3.4.0](https://github.com/asottile/pyupgrade/compare/v3.3.2...v3.4.0 )
* [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-mypy: v1.2.0 → v1.3.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.2.0...v1.3.0 )
* fix tags trigger for github actions
the old syntax worked for azure pipelines but not GHA
Committed via https://github.com/asottile/all-repos
* [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/setup-cfg-fmt: v2.2.0 → v2.3.0](https://github.com/asottile/setup-cfg-fmt/compare/v2.2.0...v2.3.0 )
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/add-trailing-comma: v2.4.0 → v2.5.1](https://github.com/asottile/add-trailing-comma/compare/v2.4.0...v2.5.1 )
- [github.com/asottile/pyupgrade: v3.4.0 → v3.6.0](https://github.com/asottile/pyupgrade/compare/v3.4.0...v3.6.0 )
* [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/reorder-python-imports: v3.9.0 → v3.10.0](https://github.com/asottile/reorder-python-imports/compare/v3.9.0...v3.10.0 )
- [github.com/asottile/pyupgrade: v3.6.0 → v3.7.0](https://github.com/asottile/pyupgrade/compare/v3.6.0...v3.7.0 )
* [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-mypy: v1.3.0 → v1.4.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.3.0...v1.4.1 )
* py38-plus
Committed via https://github.com/asottile/all-repos
* shlex.join is always available in 3.8+
* Fix missing file-contents-sorter options in the README
* [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v3.8.0 → v3.9.0](https://github.com/asottile/pyupgrade/compare/v3.8.0...v3.9.0 )
* Fix a typo in check_yaml
* [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/add-trailing-comma: v3.0.0 → v3.0.1](https://github.com/asottile/add-trailing-comma/compare/v3.0.0...v3.0.1 )
- [github.com/asottile/pyupgrade: v3.9.0 → v3.10.1](https://github.com/asottile/pyupgrade/compare/v3.9.0...v3.10.1 )
- [github.com/PyCQA/flake8: 6.0.0 → 6.1.0](https://github.com/PyCQA/flake8/compare/6.0.0...6.1.0 )
* Add bpdb to debug_statements_hook
This patch adds the bpython debugger import `bpdb` to the
debug_statements_hook.
* Fix blank lines
As stated in the documentation: `Note that this hook WILL remove blank lines`
Previously this hook would always add blank a blank line.
With this fix, if the file is empty, a newline will not be added, and multpline blanklines in a file will be removed.
Fixes #935
* [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-mypy: v1.4.1 → v1.5.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.4.1...v1.5.0 )
* [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-mypy: v1.5.0 → v1.5.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.5.0...v1.5.1 )
* [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-autopep8: v2.0.2 → v2.0.4](https://github.com/pre-commit/mirrors-autopep8/compare/v2.0.2...v2.0.4 )
* [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/add-trailing-comma: v3.0.1 → v3.1.0](https://github.com/asottile/add-trailing-comma/compare/v3.0.1...v3.1.0 )
- https://github.com/pre-commit/mirrors-autopep8 → https://github.com/hhatto/autopep8
* Document newline behavior of `file-contents-sorter`
* [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/reorder-python-imports: v3.10.0 → v3.11.0](https://github.com/asottile/reorder-python-imports/compare/v3.10.0...v3.11.0 )
- [github.com/asottile/pyupgrade: v3.10.1 → v3.11.0](https://github.com/asottile/pyupgrade/compare/v3.10.1...v3.11.0 )
* Remove redundant int() conversion
* [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v3.11.0 → v3.13.0](https://github.com/asottile/pyupgrade/compare/v3.11.0...v3.13.0 )
* [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/setup-cfg-fmt: v2.4.0 → v2.5.0](https://github.com/asottile/setup-cfg-fmt/compare/v2.4.0...v2.5.0 )
- [github.com/asottile/reorder-python-imports: v3.11.0 → v3.12.0](https://github.com/asottile/reorder-python-imports/compare/v3.11.0...v3.12.0 )
- [github.com/asottile/pyupgrade: v3.13.0 → v3.14.0](https://github.com/asottile/pyupgrade/compare/v3.13.0...v3.14.0 )
* don't rewrite string quotes inside f-strings
* v4.5.0
* [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v3.14.0 → v3.15.0](https://github.com/asottile/pyupgrade/compare/v3.14.0...v3.15.0 )
* [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-mypy: v1.5.1 → v1.6.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.5.1...v1.6.0 )
* [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-mypy: v1.6.0 → v1.6.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.6.0...v1.6.1 )
* [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-mypy: v1.6.1 → v1.7.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.6.1...v1.7.0 )
* [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-mypy: v1.7.0 → v1.7.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.7.0...v1.7.1 )
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Anthony Sottile <asottile@umich.edu>
Co-authored-by: Lev Blit <levblt1@gmail.com>
Co-authored-by: Abel Soares Siqueira <abel.s.siqueira@gmail.com>
Co-authored-by: Viktor Szépe <viktor@szepe.net>
Co-authored-by: mwip <matthias.weigand@protonmail.com>
Co-authored-by: Roel Adriaans <roel@adriaans.org>
Co-authored-by: Max R <mxr@users.noreply.github.com>
Co-authored-by: Mészáros Gergely <maetveis@gmail.com>
Co-authored-by: Miroslav Šedivý <6774676+eumiro@users.noreply.github.com>
2023-12-18 12:06:00 -08:00
Anthony Sottile
412564fa95
add --pytest-test-first convention
2022-06-07 09:10:42 -07:00
Daniël van Noord
fc88f3fa49
Use tomli and tomllib instead of toml
2022-05-31 10:48:00 -04:00
MDW
bd70bc119d
Add instruction to change executable mode on windows
2022-05-26 17:31:24 +02:00
Kurt von Laven
2cbabf90cc
Check Git core.fileMode rather than infer from OS.
...
There was already a guard preventing the check-executables-have-shebangs
hook from raising false positives on win32 by looking up the Git file
mode rather than relying on the file mode in the file system. Git already
automatically probes the file system for executable bit support. Leverage
Git's core.fileMode config variable to prevent false positives on all
file systems that don't track executable bits.
2022-04-28 11:23:36 -07:00
Anthony Sottile
b13ff9b868
adjust error outputs to be more standardized
2022-04-06 16:59:53 -04:00
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
Alex Martani
03a65ca357
Fix check-added-large-files --enforce-all to correctly consider all git-lfs files.
...
`git lfs status` only outputs status for files that are pending some git-lfs related operation.
For usage with --enforce-all, we need the list of all files that are tracked, which can be
achived by `git lfs ls-files`.
Fixes: https://github.com/pre-commit/pre-commit-hooks/issues/560
2021-12-20 23:04:50 -05:00
Pujit Mehrotra
16bc739ce7
Suggest usable call when exec files lack shebang on Windows
...
Resolves Issue #686
2021-12-07 15:53:54 -05:00
Anthony Sottile
39ab2ed85e
replace exit(main()) with raise SystemExit(main())
...
Committed via https://github.com/asottile/all-repos
2021-10-23 13:23:50 -04:00
Janosh Riebesell
05a5297dbb
fix typos
2021-10-23 13:11:40 -04:00
Anthony Sottile
81c6c559e0
remove unneeded executable bits
2021-10-18 20:00:49 -04:00
Ersin Yildirim
07af54024c
Adjust git dir when checking for merge in worktree
2021-10-15 18:23:43 -04:00
Luís Ferreira
1b4e30e9aa
detect_private_key: add OpenVPN shared-secret key block
...
'OpenVPN Static key V1' label is often used by OpenVPN for providing hardening
security with additional HMAC signatures to the SSL/TLS handshake packets. They
are shared secrets and should be kept private.
Signed-off-by: Luís Ferreira <contact@lsferreira.net>
2021-10-02 20:53:39 +01:00
Luís Ferreira
ccdf02dfd4
detect_private_key: add textual version of PKCS #8 encrypted private keys
...
As described by RFC7468 and RFC5958, keys that are encoded using the "ENCRYPTED
PRIVATE KEY" label are described as private key information and therefore can
contain secrets, even though encrypted.
Signed-off-by: Luís Ferreira <contact@lsferreira.net>
2021-10-02 20:53:33 +01: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
Guy Kisel
2468167371
remove unused os.path
2021-07-09 12:29:20 -07:00
Guy Kisel
8a4333fcff
optimize check_case_conflict.parents
2021-07-09 12:26:07 -07:00
Can Sarıgöl
41b29e8c8d
Added pdbr into debug statements
2021-06-15 09:28:11 +02: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
Ville Skyttä
9e7cd9f13a
Refactor check_executables_have_shebangs for git ls-files reuse
2021-05-04 18:45:42 -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
jack1142
1de4fe6b42
Update pretty-format-json to write to stdout with utf-8 encoding
2021-03-15 17:48:24 -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
Ville Skyttä
dae0cbd2fa
check_executables_have_shebangs: avoid unneeded shebang reads on win32
2021-01-08 16:22:33 +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
Anthony Sottile
64d3fbd5cf
fix mypy by correcting the __lt__ annotation
2020-11-16 10:41:32 -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
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