mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +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
|
|
@ -306,7 +306,7 @@ def test_updates_old_format_to_new_format(tmpdir, capsys):
|
|||
' language: script\n',
|
||||
)
|
||||
ret = autoupdate(Runner(tmpdir.strpath, C.CONFIG_FILE), tags_only=True)
|
||||
assert ret == 1
|
||||
assert ret == 0
|
||||
contents = cfg.read()
|
||||
assert contents == (
|
||||
'repos:\n'
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ def test_migrate_config_normal_format(tmpdir, capsys):
|
|||
' entry: ./bin/foo.sh\n'
|
||||
' language: script\n',
|
||||
)
|
||||
assert migrate_config(Runner(tmpdir.strpath, C.CONFIG_FILE)) == 1
|
||||
assert not migrate_config(Runner(tmpdir.strpath, C.CONFIG_FILE))
|
||||
out, _ = capsys.readouterr()
|
||||
assert out == 'Configuration has been migrated.\n'
|
||||
contents = cfg.read()
|
||||
|
|
@ -61,7 +61,7 @@ def test_migrate_config_document_marker(tmpdir):
|
|||
' entry: ./bin/foo.sh\n'
|
||||
' language: script\n',
|
||||
)
|
||||
assert migrate_config(Runner(tmpdir.strpath, C.CONFIG_FILE)) == 1
|
||||
assert not migrate_config(Runner(tmpdir.strpath, C.CONFIG_FILE))
|
||||
contents = cfg.read()
|
||||
assert contents == (
|
||||
'# comment\n'
|
||||
|
|
@ -88,7 +88,7 @@ def test_migrate_config_list_literal(tmpdir):
|
|||
' }]\n'
|
||||
'}]',
|
||||
)
|
||||
assert migrate_config(Runner(tmpdir.strpath, C.CONFIG_FILE)) == 1
|
||||
assert not migrate_config(Runner(tmpdir.strpath, C.CONFIG_FILE))
|
||||
contents = cfg.read()
|
||||
assert contents == (
|
||||
'repos:\n'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue