Skip to content

Commit 726f2ad

Browse files
committed
remove duplicate warnings while running autoupdate
1 parent a96bb23 commit 726f2ad

File tree

2 files changed

+0
-17
lines changed

2 files changed

+0
-17
lines changed

pre_commit/commands/migrate_config.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
import yaml
55

6-
from pre_commit.clientlib import load_config
76
from pre_commit.util import yaml_load
87

98

@@ -40,9 +39,6 @@ def _migrate_sha_to_rev(contents: str) -> str:
4039

4140

4241
def migrate_config(config_file: str, quiet: bool = False) -> int:
43-
# ensure that the configuration is a valid pre-commit configuration
44-
load_config(config_file)
45-
4642
with open(config_file) as f:
4743
orig_contents = contents = f.read()
4844

tests/commands/migrate_config_test.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import pytest
2-
31
import pre_commit.constants as C
4-
from pre_commit.clientlib import InvalidConfigError
52
from pre_commit.commands.migrate_config import migrate_config
63

74

@@ -130,13 +127,3 @@ def test_migrate_config_sha_to_rev(tmpdir):
130127
' rev: v1.2.0\n'
131128
' hooks: []\n'
132129
)
133-
134-
135-
@pytest.mark.parametrize('contents', ('', '\n'))
136-
def test_migrate_config_invalid_configuration(tmpdir, contents):
137-
cfg = tmpdir.join(C.CONFIG_FILE)
138-
cfg.write(contents)
139-
with tmpdir.as_cwd(), pytest.raises(InvalidConfigError):
140-
migrate_config(C.CONFIG_FILE)
141-
# even though the config is invalid, this should be a noop
142-
assert cfg.read() == contents

0 commit comments

Comments
 (0)