Aleksey Ovcharenko
24d595fc95
fix: Use JSON to parse npm pack output.
2025-09-26 18:57:16 +03:00
pre-commit-ci[bot]
917e2102be
[pre-commit.ci] auto fixes from pre-commit.com hooks
...
for more information, see https://pre-commit.ci
2024-07-29 21:59:19 +00:00
Anthony Sottile
a68a19d217
fixes for mypy 1.11
2024-07-28 14:57:13 -04:00
Anthony Sottile
0d4c6da36e
adjust _handle_readonly for typeshed updates
2024-04-29 21:05:41 -04:00
Edgar Ramírez Mondragón
cffabe54be
Address deprecation warning in shutil.rmtree(onerror=...)
2023-12-09 14:51:01 -05:00
Anthony Sottile
75f2710bd4
3.13 removed the simpler importlib.resources api
2023-10-28 14:39:49 -04:00
Anthony Sottile
7f15dc75ee
python3.9+
2023-10-28 14:20:37 -04:00
marsha
5ce4a549d3
prefer sys.platform over os.name when checking for windows OS
2023-03-03 22:13:07 -06:00
Anthony Sottile
4ded56efac
fix trailing whitespace in CalledProcessError output
2023-02-21 12:42:09 -05:00
Anthony Sottile
8d84a7a270
resources_bytesio is only used by ruby
2023-02-20 21:47:01 -05:00
taoufik07
bf1a1fa5fd
Fix command normalization when a custom env is passed
2023-01-06 09:27:49 -05:00
Anthony Sottile
8529a0c1d3
add pre_commit.yaml module
2023-01-02 18:42:34 -05:00
Anthony Sottile
017fa5c0b8
Merge pull request #2665 from pre-commit/move-parse-version
...
move parse_version to pre_commit.clientlib
2023-01-01 17:51:11 -05:00
Anthony Sottile
5425c754a0
move parse_version to pre_commit.clientlib
2023-01-01 17:17:00 -05:00
Anthony Sottile
0a0754e44a
special rmtree is not needed for TemporaryDirectory in 3.8+
2023-01-01 17:12:28 -05:00
marsha
42102a1bfd
Remove expected_returncode from CalledProcessError
2022-10-30 15:31:45 -05:00
marsha
84b38f7b89
Change cmd_output_bs retcode arg to a boolean check
2022-10-30 14:49:42 -05:00
Gaige B. Paulsen
a84136d070
Switch pty use to fix solaris
...
Use the child instead of parent fd when manipulating pty for color.
2022-05-14 09:15:03 +00:00
Anthony Sottile
04de6a2e57
drop python 3.6 support
...
python 3.6 reached end of life on 2021-12-23
2022-01-18 18:44:20 -05:00
Anthony Sottile
270b539e8f
improve coverage pragmas with covdefaults 2.1
...
Committed via https://github.com/asottile/all-repos
2021-11-29 20:45:40 -05:00
Anthony Sottile
f8e21cb78b
add support for dart as a hook language
2021-08-29 08:57:56 -07:00
francisco souza
c598785b6f
util: use set instead of tuple in errno check
...
Co-authored-by: Paul Fischer <70564747+paulhfischer@users.noreply.github.com>
2020-12-06 07:45:31 -08:00
francisco souza
bb0d9573a9
util: also run chmod on EPERM
...
Writing a test for this one is tricky, because I was seeing the issue
only when the directory being removed is a docker volume, so instead of
getting EACCES we get EPERM.
This is easy to reproduce though. The existing test fails when the
directory being used for the files is a docker volume:
```
% docker run \
-v $(mktemp -d):/tmp \
-v ${PWD}:/src \
-w /src \
python:3 \
bash -c 'pip install -e . && pip install -r requirements-dev.txt && python -m pytest tests/util_test.py'
```
2020-12-05 22:26:38 -05:00
Anthony Sottile
24dfeed89c
Replace EnvironT with MutableMapping[str, str]
2020-10-28 13:00:25 -07:00
Marc Jay
98d8a3d60f
Maintain scalar quoting style when autoupdate re-writes rev
...
If rev is wrapped in single or double quotes (e.g. due to a yamllint quoted-strings rule), when
re-writing the rev to update it, honour the existing quotation style
2020-05-04 19:29:03 -07:00
Anthony Sottile
03617b2f98
Don't crash out on OSErrors in subprocess calls
2020-03-12 10:52:10 -07:00
Anthony Sottile
67c1beb322
Use covdefaults to handle coveragerc
2020-02-29 14:25:19 -08:00
Anthony Sottile
a64fa6d478
Replace aspy.yaml with sort_keys=False
2020-01-31 17:18:59 -08:00
Anthony Sottile
5779f93ec6
keyword only arguments in some places
2020-01-12 13:39:53 -08:00
Anthony Sottile
34c3a1580a
unrelated cleanup
2020-01-12 13:39:53 -08:00
Anthony Sottile
49cf490697
Remove noop_context
2020-01-12 13:39:53 -08:00
Anthony Sottile
2a9893d0f0
mkdirp -> os.makedirs(..., exist_ok=True)
2020-01-12 13:39:53 -08:00
Anthony Sottile
67c2dcd90d
Remove pre_commit.five
2020-01-12 13:39:53 -08:00
Anthony Sottile
9000e9dd41
Some manual .format() -> f-strings
2020-01-12 13:39:53 -08:00
Anthony Sottile
aefbe71765
Clean up calls to .encode() / .decode()
2020-01-12 10:46:33 -08:00
Anthony Sottile
327ed924a3
Add types to pre-commit
2020-01-12 10:15:01 -08:00
Anthony Sottile
fa536a8693
mypy passes with check_untyped_defs
2020-01-12 09:27:04 -08:00
Anthony Sottile
ab19b94811
some manual py2 cleanups
2020-01-12 09:27:04 -08:00
Anthony Sottile
30c1e8289f
upgrade hooks, pyupgrade pre-commit
2020-01-12 09:27:04 -08:00
Anthony Sottile
b90412742e
A few cleanups for CalledProcessError to hopefully make it more readable
2019-12-23 17:46:48 -08:00
Anthony Sottile
7c3404ef1f
show color in hook outputs when attached to a tty
2019-10-12 23:17:36 -07:00
Anthony Sottile
f612aeb22b
Split out cmd_output_b
2019-10-06 15:16:47 -07:00
Anthony Sottile
795506a486
Fix up some newlines in output
2019-09-24 10:22:44 -07:00
Anthony Sottile
da44d4267e
Fix rmtree for readonly directories
2019-05-22 11:04:35 -07:00
Anthony Sottile
b1389603e0
Speed up filename filtering.
...
Before there was a `getcwd` syscall for every filename which was filtered.
Instead this is now cached per-run.
- When all files are identified by filename only: ~45% improvement
- When no files are identified by filename only: ~55% improvement
This makes little difference to overall execution, the bigger win is
eliminating the `memoize_by_cwd` hack. Just removing the memoization would
have *increased* the runtime by 300-500%.
2019-01-23 20:48:41 -08:00
Anthony Sottile
bdc58cc33f
Teach pre-commit try-repo to clone uncommitted changes
2019-01-01 15:01:36 -08:00
Anthony Sottile
9f60561d6f
Replace resources with importlib_resources
2018-10-14 14:37:35 -07:00
Anthony Sottile
ebe5132576
Replace pkg_resources.get_distribution with importlib-metadata
2018-10-14 12:24:59 -07:00
Anthony Sottile
e55f51fb14
Remove unused __popen DI
2018-05-02 11:25:16 -04:00
Anthony Sottile
29033f10ca
Move cwd() to tests-only
2018-02-24 16:44:59 -08:00