Last active
September 14, 2025 15:30
-
-
Save hugovk/d601e651e08d229714a86fb5b04bc6c9 to your computer and use it in GitHub Desktop.
Run "prek install" in all subdirectories with a .pre-commit-config.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| uv run https://gist.github.com/hugovk/d601e651e08d229714a86fb5b04bc6c9 | |
| """ | |
| import subprocess | |
| from pathlib import Path | |
| for directory in sorted(Path(".").iterdir(), key=lambda x: x.name.lower()): | |
| if directory.is_dir() and (directory / ".pre-commit-config.yaml").is_file(): | |
| print(directory) | |
| subprocess.run( | |
| ["prek", "install", "--allow-missing-config"], cwd=directory, check=True | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment