pre-commit migrate-config should not return nonzero when successful · precommit/pre-commit@a78f5d5 · GitHub
Skip to content

Commit a78f5d5

Browse files
committed
pre-commit migrate-config should not return nonzero when successful
1 parent 04018ad commit a78f5d5

4 files changed

Lines changed: 5 additions & 10 deletions

File tree

pre_commit/commands/autoupdate.py

Lines changed: 1 addition & 1 deletion

pre_commit/commands/migrate_config.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ def _is_header_line(line):
1717

1818

1919
def migrate_config(runner, quiet=False):
20-
retv = 0
21-
2220
with io.open(runner.config_file_path) as f:
2321
contents = f.read()
2422

@@ -45,8 +43,5 @@ def migrate_config(runner, quiet=False):
4543
f.write(contents)
4644

4745
print('Configuration has been migrated.')
48-
retv = 1
4946
elif not quiet:
5047
print('Configuration is already migrated.')
51-
52-
return retv

tests/commands/autoupdate_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ def test_updates_old_format_to_new_format(tmpdir, capsys):
306306
' language: script\n',
307307
)
308308
ret = autoupdate(Runner(tmpdir.strpath, C.CONFIG_FILE), tags_only=True)
309-
assert ret == 1
309+
assert ret == 0
310310
contents = cfg.read()
311311
assert contents == (
312312
'repos:\n'

tests/commands/migrate_config_test.py

Lines changed: 3 additions & 3 deletions

0 commit comments

Comments
 (0)