mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Add repo option to autoupdate
This commit is contained in:
parent
0ec3b5556f
commit
4d0c400066
3 changed files with 38 additions and 3 deletions
|
|
@ -106,7 +106,7 @@ def _write_new_config_file(path, output):
|
|||
f.write(to_write)
|
||||
|
||||
|
||||
def autoupdate(runner, tags_only):
|
||||
def autoupdate(runner, tags_only, repo=None):
|
||||
"""Auto-update the pre-commit config to the latest versions of repos."""
|
||||
migrate_config(runner, quiet=True)
|
||||
retv = 0
|
||||
|
|
@ -116,6 +116,10 @@ def autoupdate(runner, tags_only):
|
|||
input_config = load_config(runner.config_file_path)
|
||||
|
||||
for repo_config in input_config['repos']:
|
||||
# Skip any repo_configs that aren't the specified repo
|
||||
if repo and repo != repo_config['repo']:
|
||||
continue
|
||||
|
||||
if is_local_repo(repo_config) or is_meta_repo(repo_config):
|
||||
output_repos.append(repo_config)
|
||||
continue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue