mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 16:24:40 +04:00
pre-commit migrate-config should not return nonzero when successful
This commit is contained in:
parent
04018ad4e7
commit
a78f5d5c24
4 changed files with 5 additions and 10 deletions
|
|
@ -104,8 +104,8 @@ def _write_new_config_file(path, output):
|
|||
|
||||
def autoupdate(runner, tags_only):
|
||||
"""Auto-update the pre-commit config to the latest versions of repos."""
|
||||
migrate_config(runner, quiet=True)
|
||||
retv = 0
|
||||
retv |= migrate_config(runner, quiet=True)
|
||||
output_repos = []
|
||||
changed = False
|
||||
|
||||
|
|
|
|||
|
|
@ -17,8 +17,6 @@ def _is_header_line(line):
|
|||
|
||||
|
||||
def migrate_config(runner, quiet=False):
|
||||
retv = 0
|
||||
|
||||
with io.open(runner.config_file_path) as f:
|
||||
contents = f.read()
|
||||
|
||||
|
|
@ -45,8 +43,5 @@ def migrate_config(runner, quiet=False):
|
|||
f.write(contents)
|
||||
|
||||
print('Configuration has been migrated.')
|
||||
retv = 1
|
||||
elif not quiet:
|
||||
print('Configuration is already migrated.')
|
||||
|
||||
return retv
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue