Skip to content

Commit 012055f

Browse files
Skip local and meta hooks.
These hooks shouldn't have a `rev` field and therefore can't / shouldn't be checked by this tool. * check_pre_commit_config_frozen.py (Linter.lint_repo): Skip if `repo` is `local` or `meta`.
1 parent 876356a commit 012055f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

check_pre_commit_config_frozen.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,22 @@ async def lint_repo(self, repo_list_yaml, index: int, file: str):
724724
)
725725
return
726726

727+
if "repo" not in repo_yaml:
728+
complain(
729+
Rule.INVALID_CONFIG,
730+
repo_yaml.lc.line,
731+
repo_yaml.lc.col,
732+
False,
733+
msg=f"Missing yaml key `repo` for repo {index}",
734+
)
735+
return
736+
737+
# exclude repo `meta` and `local` from rev checks
738+
# since they shouldn't have a rev.
739+
if repo_yaml["repo"] in ["meta", "local"]:
740+
logger.debug(f'Skipped {repo_yaml["repo"]} repository {index}')
741+
return
742+
727743
for key in ["rev", "repo"]:
728744
if key not in repo_yaml:
729745
complain(

0 commit comments

Comments
 (0)