Skip to content

Instantly share code, notes, and snippets.

@hugovk
Last active September 14, 2025 15:30
Show Gist options
  • Select an option

  • Save hugovk/d601e651e08d229714a86fb5b04bc6c9 to your computer and use it in GitHub Desktop.

Select an option

Save hugovk/d601e651e08d229714a86fb5b04bc6c9 to your computer and use it in GitHub Desktop.

Revisions

  1. hugovk revised this gist Sep 14, 2025. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions prek-install.py
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,6 @@
    """
    uv run https://gist.github.com/hugovk/d601e651e08d229714a86fb5b04bc6c9
    """
    import subprocess
    from pathlib import Path

  2. hugovk created this gist Sep 14, 2025.
    9 changes: 9 additions & 0 deletions prek-install.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    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
    )