Commit graph

848 commits

Author SHA1 Message Date
helly25
689f1203f7
When run is called with -v, then show hook.description if available.
When developers run the pre-commit, they don't always understand what to or where to find more information. The hook description field is already present and often used to provide more descriptive information. For brevity this is not shown in normal cases, but this PR changes the tool behavior to show the description in verbose mode (`-v`). So most users won't see any difference but this can easily be enabled for people who want it.

Alternatives considered:
* Always show the description: Some people may not like this though as it can be spammy.
* Provide a new field: Possible but seems to be just more work with description already present and not otherwise used.
* Show the `repo` link. This is at the wrong level and has a slightly different purpose. Though description can just be set to the same url where that is correct.
2024-04-25 09:10:44 +00:00
Anthony Sottile
fc622159a6 fix per-hook fail_fast to not fail on previous failures 2024-03-24 13:17:00 -04:00
Gaëtan Lehmann
e58009684c give docker a tty output when expecting color
this makes the behavior more consistent with the system language
and would help the executable run in a docker container to
produce a colored output.
2024-03-02 11:51:34 -05:00
Anthony Sottile
61d9c95cc1 fix building golang hooks during commit --all 2024-02-18 13:03:44 -05:00
Anthony Sottile
032d8e2704 staged_files_only can handle a crlf-only diff 2024-02-10 14:01:49 -05:00
Anthony Sottile
7dc0a59ee5
Merge pull request #3093 from pre-commit/removeprefix
python 3.9+: use removeprefix
2023-12-09 16:13:25 -05:00
Anthony Sottile
08478ec176 python 3.9+: use removeprefix 2023-12-09 16:04:25 -05:00
Anthony Sottile
047439abff attempt minimum_pre_commit_version first when parsing configs 2023-12-09 15:34:16 -05:00
Anthony Sottile
7f15dc75ee python3.9+ 2023-10-28 14:20:37 -04:00
Anthony Sottile
c9945b9aa3
Merge pull request #3029 from adamchainz/improve_duration_timing
Improve hook duration timing
2023-10-13 11:49:53 -04:00
Adam Johnson
d988767b41 Improve hook duration timing 2023-10-13 16:40:30 +01:00
Anthony Sottile
997ea0ad52 use sys.executable instead of echo.exe in parse_shebang
the GHA runners now have echo.exe in a path with spaces
2023-10-09 16:49:30 -04:00
Eric Long
5e05b01215
Bump Node.js version to 18.14.0 and Go to 1.21.1
On riscv64, nodeenv will pull binary from unofficial-builds [1], and
unfortunately 18.13.0 seems to be the only version above 18 that is
missing riscv64 builds. Shifting the version slightly to make test work.

Go's binary now ships with linux/riscv64 binary since 1.21.
2023-09-25 17:02:13 +08:00
Max R
5d692d7e06 Short-circuit hooks 2023-09-11 19:41:40 -04:00
Max R
9ac229dad8 Refactor target_concurrency tests 2023-09-10 08:39:19 -04:00
Joe Bateson
ea8244b229 Use os.sched_getaffinity for cpu counts when available 2023-08-30 13:39:20 -04:00
Chris Kuehl
5a4b5b1f8e Fix exit code for commands terminated by signals
Fixes https://github.com/pre-commit/pre-commit/issues/2970
2023-08-21 20:02:27 -05:00
Anthony Sottile
8c75a26f2d
update hello world go test 2023-08-01 12:08:52 -04:00
Alex Brandt
60273ca81e Add haskell language support to pre-commit. 2023-07-22 16:28:48 -04:00
Anthony Sottile
4f045cbc21 perform autoupdate without Store contention 2023-04-29 15:32:20 -04:00
marsha
d3c0a66d23 move slowest python-specific tests out of repository_test 2023-03-12 08:24:38 -05:00
Marcelo Galigniana
f39154f69f Add pre-rebase hook support 2023-03-11 15:17:42 -05:00
Anthony Sottile
e3e17a1617 make --hook-type and stages match 2023-03-11 14:26:14 -05:00
marsha
63a180a935 rewrite args with spaces test to not require python 2023-03-09 00:41:27 -06:00
marsha
5ce4a549d3 prefer sys.platform over os.name when checking for windows OS 2023-03-03 22:13:07 -06:00
Anthony Sottile
a631abdabf remove sorting for repo key for additional_deps
in other languages this order can matter (such as ruby)
2023-02-22 20:31:14 -05:00
Anthony Sottile
4ded56efac fix trailing whitespace in CalledProcessError output 2023-02-21 12:42:09 -05:00
Anthony Sottile
cddc9cff0f only treat exit code 1 as a successful diff 2023-02-21 12:20:25 -05:00
Anthony Sottile
1054afd978
Merge pull request #2772 from pre-commit/run-language-for-repository-test
use run_language for repository_test
2023-02-20 22:49:55 -05:00
Anthony Sottile
d23990cc8b use run_language for repository_test 2023-02-20 22:21:31 -05:00
Anthony Sottile
51b14c2b37
Merge pull request #2771 from pre-commit/ruby-is-the-only-bytesio
resources_bytesio is only used by ruby
2023-02-20 22:17:20 -05:00
Anthony Sottile
8d84a7a270 resources_bytesio is only used by ruby 2023-02-20 21:47:01 -05:00
Anthony Sottile
25b8ad7528 improve unit test coverage of lang_base 2023-02-20 21:32:32 -05:00
Anthony Sottile
4f6ba18cad
Merge pull request #2767 from pre-commit/test-more-directly
test things more directly to improve coverage
2023-02-20 18:52:11 -05:00
Anthony Sottile
c3613b954a test things more directly to improve coverage 2023-02-20 18:18:08 -05:00
Anthony Sottile
d3883ce7f7 move languages.all and languages.helpers out of languages 2023-02-20 18:03:45 -05:00
marsha
a2373d0a81 test pygrep inline 2023-02-18 17:54:44 -05:00
marsha
4fdfb25a52 test fail language inline 2023-02-13 17:03:59 -06:00
marsha
915b930a5d test dotnet directly 2023-02-07 21:47:26 -06:00
marsha
6804100701 test golang directly 2023-02-06 17:02:20 -06:00
Anthony Sottile
0afb95ccca test docker and docker_image directly 2023-02-04 17:22:06 -05:00
Anthony Sottile
0c1267b214 deprecate python_venv language 2023-02-04 14:26:09 -05:00
Adam Johnson
7783a3e63a Add --no-textconv to git diff calls 2023-02-03 15:56:11 +00:00
Anthony Sottile
1129e7d222 fixup Gemfile in ruby tests 2023-02-01 18:17:24 -05:00
Anthony Sottile
d216cdd5c1 fix golang version regex in test 2023-02-01 18:16:09 -05:00
Anthony Sottile
909dd0e8a1 test node directly 2023-01-31 21:13:11 -05:00
Anthony Sottile
5b50acbd2c test ruby directly 2023-01-30 21:36:13 -05:00
Anthony Sottile
77b4ea38ca
Merge pull request #2729 from pre-commit/rust-tests
test rust directly
2023-01-29 19:00:09 -05:00
Anthony Sottile
2adca78c6f test rust directly 2023-01-29 18:27:10 -05:00
Anthony Sottile
420902f67c fix r local hooks
`language: r` acts more like `language: script` so we have to *not* append
the prefix when run with `repo: local`
2023-01-29 17:27:42 -05:00