@@ -39,13 +39,17 @@ def make_repo(tempdir_factory, repo_source):
3939
4040@contextlib .contextmanager
4141def modify_manifest (path ):
42- """Modify the manifest yielded by this context to write to hooks.yaml."""
42+ """Modify the manifest yielded by this context to write to
43+ .pre-commit-hooks.yaml.
44+ """
4345 manifest_path = os .path .join (path , C .MANIFEST_FILE )
4446 manifest = ordered_load (io .open (manifest_path ).read ())
4547 yield manifest
4648 with io .open (manifest_path , 'w' ) as manifest_file :
4749 manifest_file .write (ordered_dump (manifest , ** C .YAML_DUMP_KWARGS ))
48- cmd_output ('git' , 'commit' , '-am' , 'update hooks.yaml' , cwd = path )
50+ cmd_output (
51+ 'git' , 'commit' , '-am' , 'update .pre-commit-hooks.yaml' , cwd = path ,
52+ )
4953
5054
5155@contextlib .contextmanager
@@ -75,8 +79,11 @@ def config_with_local_hooks():
7579 ))
7680
7781
78- def make_config_from_repo (repo_path , sha = None , hooks = None , check = True ):
79- manifest = load_manifest (os .path .join (repo_path , C .MANIFEST_FILE ))
82+ def make_config_from_repo (
83+ repo_path , sha = None , hooks = None , check = True , legacy = False ,
84+ ):
85+ filename = C .MANIFEST_FILE_LEGACY if legacy else C .MANIFEST_FILE
86+ manifest = load_manifest (os .path .join (repo_path , filename ))
8087 config = OrderedDict ((
8188 ('repo' , repo_path ),
8289 ('sha' , sha or get_head_sha (repo_path )),
0 commit comments