pre-commit - Hook Runner Flow

            flowchart TD
                Start([Start]) --> Wrapper["Ensure Bash / win-bash-wrapper"]
                Wrapper --> SetupLog["Create .logs + tee output"]
                SetupLog --> AutoUpdate{PRECOMMIT_AUTOUPDATE=1?}
                AutoUpdate -->|yes| MaybeUpdate["Run pre-commit autoupdate (daily)"]
                AutoUpdate -->|no| SkipUpdate["Skip autoupdate"]
                MaybeUpdate --> RunHook
                SkipUpdate --> RunHook
                RunHook["Run pre-commit from ./venv"] --> VenvOk{venv pre-commit + Python 3.12+?}
                VenvOk -->|yes| RunHooks["pre-commit run --hook-stage pre-commit"]
                VenvOk -->|no| Missing["Print install instructions"]
                RunHooks --> Summary["Summarize Passed/Failed"]
                Summary --> Done([Exit with hook status])
                Missing --> Fail([Exit 1])

                classDef action fill:#ecfeff,stroke:#06b6d4
                classDef decision fill:#fef3c7,stroke:#f59e0b
                classDef success fill:#d1fae5,stroke:#10b981
                classDef error fill:#fee2e2,stroke:#ef4444
                class Wrapper,SetupLog,MaybeUpdate,RunHook,RunHooks,Summary action
                class AutoUpdate,VenvOk decision
                class Done success
                class Missing,Fail error
        

Back to build scripts