Skip to content

Commit

Permalink
FIX: run prettier on GitHub Actions if v4 alpha (#232)
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer authored Dec 1, 2023
1 parent 6621d5e commit b8b5ef5
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions src/repoma/check_dev_files/precommit.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@
__NON_SKIPPED_HOOKS = {
"editorconfig-checker",
}
__SKIPPED_HOOKS = {
"check-jsonschema",
"pyright",
"taplo",
}


def main() -> None:
Expand Down Expand Up @@ -116,5 +111,19 @@ def get_non_functional_hooks(config: PrecommitConfig) -> List[str]:
for repo in config.repos
for hook in repo.hooks
if repo.repo
if hook.id in __SKIPPED_HOOKS
if hook.id in __get_skipped_hooks(config)
]


def __get_skipped_hooks(config: PrecommitConfig) -> Set[str]:
skipped_hooks = {
"check-jsonschema",
"pyright",
"taplo",
}
repo = config.find_repo(r"^.*/mirrors-prettier$")
if repo is not None and repo.rev is not None:
rev = repo.rev
if rev.startswith("v4") and "alpha" in rev:
skipped_hooks.add("prettier")
return skipped_hooks

0 comments on commit b8b5ef5

Please sign in to comment.