mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-15 01:51:46 +04:00
Add freeze config option for autoupdate command
This commit adds a new 'freeze' option to the CONFIG_SCHEMA, allowing users to set 'freeze: true' in their pre-commit configuration file. The intend are two effects, when setting `freeze: True`: * Enables freeze automatically when running `pre-commit autoupdate` (no need then anymore to specify --freeze). * Enables https://pre-commit.ci/ to freeze hooks as part of update PRs.
This commit is contained in:
parent
aa48766b88
commit
7c81f11d63
3 changed files with 15 additions and 0 deletions
|
|
@ -176,6 +176,8 @@ def autoupdate(
|
|||
if repo['repo'] not in {LOCAL, META}
|
||||
]
|
||||
|
||||
freeze = freeze or load_config(config_file)['freeze']
|
||||
|
||||
rev_infos: list[RevInfo | None] = [None] * len(config_repos)
|
||||
jobs = jobs or xargs.cpu_count() # 0 => number of cpus
|
||||
jobs = min(jobs, len(repos) or len(config_repos)) # max 1-per-thread
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue