File tree Expand file tree Collapse file tree 2 files changed +0
-17
lines changed
Expand file tree Collapse file tree 2 files changed +0
-17
lines changed Original file line number Diff line number Diff line change 33
44import yaml
55
6- from pre_commit .clientlib import load_config
76from pre_commit .util import yaml_load
87
98
@@ -40,9 +39,6 @@ def _migrate_sha_to_rev(contents: str) -> str:
4039
4140
4241def 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
Original file line number Diff line number Diff line change 1- import pytest
2-
31import pre_commit .constants as C
4- from pre_commit .clientlib import InvalidConfigError
52from 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
You can’t perform that action at this time.
0 commit comments