Rob Broadley
b6c3bf3763
Fix highlighted text not readable with some color schemes
...
Make the foreground (text) color be the usual background color,
when highlighting text. This is done by setting the foreground
color instead of the background color, then inverting (code 7)
to swap the foreground and background colors.
Previously, with some color schemes there was not enough contrast
between the text and highlight color.
Based on the assumption that there should be contrast between
terminal colors and the background, this should make the text
readable with a wider set of color schemes.
2025-01-06 18:40:26 +00:00
Anthony Sottile
cb14bc2d9c
Merge pull request #3304 from AleksaC/go-toolchain
...
disable automatic toolchain switching for golang hooks
2024-11-25 18:54:37 -05:00
AleksaC
109628c505
disable automatic toolchain switching for golang hooks
2024-11-25 18:47:18 -05:00
Fredrik Ekre
85783bdc0b
Add support for julia hooks
...
This patch adds 2nd class support for hooks using julia as the language.
pre-commit will install any dependencies defined in the hooks repo
`Project.toml` file, with support for `additional_dependencies` as well.
Julia doesn't (yet) have a way to install binaries/scripts so for julia
hooks the `entry` value is a (relative) path to a julia script within
the hooks repository. When executing a julia hook the (globally
installed) julia interpreter is prepended to the entry.
Example `.pre-commit-hooks.yaml`:
```yaml
- id: foo
name: ...
language: julia
entry: bin/foo.jl --arg1
```
Example hooks repo: https://github.com/fredrikekre/runic-pre-commit/tree/fe/julia
Accompanying pre-commit.com PR: https://github.com/pre-commit/pre-commit.com/pull/998
Fixes #2689 .
2024-11-25 18:31:25 -05:00
Anthony Sottile
222c62bc5d
fix migrate-config for purelib yaml
2024-10-08 11:46:48 -04:00
Anthony Sottile
801b956304
remove deprecated python_venv alias
2024-10-05 13:30:25 -04:00
Anthony Sottile
d31722386e
add warning for deprecates stages for remote repos on init
2024-09-30 20:41:50 -04:00
Anthony Sottile
33e020f315
add warning for deprecated stages values in default_stages
2024-09-30 19:22:14 -04:00
Anthony Sottile
7441a62eb1
add warning for deprecated stages names
2024-09-30 18:41:13 -04:00
Anthony Sottile
fa08d1d637
also apply sensible regex warning for repo: meta
2024-09-30 18:09:04 -04:00
Anthony Sottile
c9454e2ec3
regenerate ruby-build archive
2024-09-28 13:07:55 -04:00
Anthony Sottile
e687548842
regenerate archives with python3.12
2024-09-28 13:07:38 -04:00
Anthony Sottile
5679399d90
migrate-config rewrites deprecated stages
2024-09-16 20:36:33 -04:00
Anthony Sottile
364e6d77f0
change migrate-config to use yaml parse tree instead
2024-09-16 20:16:16 -04: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
Lorenz Walthert
da0c1d0cfa
implement health check for language:r
2024-07-28 15:44:07 -04:00
Anthony Sottile
a68a19d217
fixes for mypy 1.11
2024-07-28 14:57:13 -04:00
Anthony Sottile
296f59266e
determine rust default language version independent of rust-toolchain.toml
2024-05-10 17:06:29 -04:00
Anthony Sottile
0d4c6da36e
adjust _handle_readonly for typeshed updates
2024-04-29 21:05:41 -04: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
pre-commit-ci[bot]
96e0712f43
[pre-commit.ci] auto fixes from pre-commit.com hooks
...
for more information, see https://pre-commit.ci
2024-01-12 16:32:44 +00:00
Markus Unterwaditzer
3388e2dbdf
Pop PYTHONEXECUTABLE
2024-01-12 17:30:01 +01: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
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
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
Max R
5d692d7e06
Short-circuit hooks
2023-09-11 19:41:40 -04:00
Roel Adriaans
493c20ce91
Use the --include command, hides warning messages
...
Fixes #1983
2023-09-08 15:12:54 +02: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
Alex Brandt
60273ca81e
Add haskell language support to pre-commit.
2023-07-22 16:28:48 -04:00
Anthony Sottile
1c439b5a79
shlex.join is always available in 3.8+
2023-07-01 17:22:42 -04:00
pre-commit-ci[bot]
50b1511a5b
[pre-commit.ci] auto fixes from pre-commit.com hooks
...
for more information, see https://pre-commit.ci
2023-06-13 22:04:03 +00:00
Jay Soffian
9a7ed8be09
Force gem installation into envdir
...
RubyGems allows OS packagers to specify defaults for `--install-dir`
and `--bindir` and these take precedence over `GEM_HOME`. The only way
to override the defaults is to explicitly specify the options ourselves
when running `gem install`.
Examples of OSes where this is the case are RedHat 9.2 and Gentoo.
Fixes #2799 .
2023-06-13 18:03:52 -04:00
Lorenz Walthert
cd09c3525e
avoid quoting and escaping while installing R hooks by writing code to tempfile instead of execute R code inline
2023-05-17 18:00:00 -04:00
Anthony Sottile
8923fa368a
r does not support language_version currently
2023-05-13 15:46:34 -04:00
Anthony Sottile
420a15f87e
add partial clone hack to fix autoupdate for windows
2023-05-02 09:54:25 -04:00
Anthony Sottile
ddbee32ad0
add --jobs option to autoupdate
2023-04-29 15:42:01 -04:00
Anthony Sottile
4f045cbc21
perform autoupdate without Store contention
2023-04-29 15:32:20 -04:00
Anthony Sottile
e885f2e76e
use -C for git commands in autoupdate
2023-04-29 15:12:51 -04:00
Anthony Sottile
4727922b93
use blobless clone for faster autoupdate
2023-04-29 13:29:00 -04:00
Jamie Alessio
cfcb88364e
Upgrade to ruby-build v20230330
2023-04-18 10:58:57 -07:00
Eric DeLabar
84f040f58a
fix #2235
2023-04-03 15:50:55 -04:00