Something went wrong. Try again.
fork of gitlab.com/devnw/zig/thread-pool for zig 0.17
Something went wrong. Try again.
devnw-thread-pool .pre-commit-config.yaml
6.2 kB · 182 lines
YAML
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183# Pre-commit configuration for thread-pool project# https://pre-commit.com/## Install: pip install pre-commit && pre-commit install# Run manually: pre-commit run --all-files# Update hooks: pre-commit autoupdate
default_stages: [pre-commit]fail_fast: false
repos: # ============================================================================= # Standard pre-commit hooks (best practices) # =============================================================================- repo: https://github.com/pre-commit/pre-commit-hooks rev: v6.0.0 hooks: # Formatting - id: trailing-whitespace args: [--markdown-linebreak-ext=md] exclude: ^(vendor/|dist/|zig-out/|\.zig-cache/) - id: end-of-file-fixer exclude: ^(vendor/|dist/|zig-out/|\.zig-cache/|.*\.bin$|.*\.der$|.*\.pem$) - id: mixed-line-ending args: [--fix=lf] exclude: ^(vendor/|dist/|zig-out/)
# Syntax validation - id: check-yaml args: [--unsafe] # Allow custom tags exclude: ^(vendor/|dist/) - id: check-json exclude: ^(vendor/|dist/|zig-out/|\.devcontainer/) - id: check-toml - id: check-xml exclude: ^(vendor/|dist/)
# Security - id: detect-private-key exclude: ^(certs/|test.*certs/|.*test.*\.pem$|tests/|src/tests/|docker/zig-packages/) - id: check-added-large-files args: [--maxkb=1024] exclude: ^(vendor/|dist/)
# Git hygiene - id: check-merge-conflict - id: check-case-conflict - id: check-symlinks - id: destroyed-symlinks
# Code quality - id: check-executables-have-shebangs exclude: ^(vendor/|dist/|zig-out/) - id: check-shebang-scripts-are-executable exclude: ^(vendor/|dist/|\.envrc)
# ============================================================================= # Shell script linting # =============================================================================- repo: https://github.com/shellcheck-py/shellcheck-py rev: v0.11.0.1 hooks: - id: shellcheck args: [--severity=error, --shell=bash] exclude: ^(vendor/|dist/|tests/)
# ============================================================================= # Python linting (for test scripts and tools) # =============================================================================- repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.16.9 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] exclude: ^(vendor/|dist/) - id: ruff-format exclude: ^(vendor/|dist/)
# ============================================================================= # Markdown linting # =============================================================================- repo: https://github.com/igorshubovych/markdownlint-cli rev: v0.49.1 hooks: - id: markdownlint args: [--fix, --disable, MD013, MD033, MD041, MD024, MD060, MD036, MD051, MD052, MD055, --] exclude: ^(vendor/|dist/|CHANGELOG\.md|specs/)
# ============================================================================= # YAML formatting # =============================================================================- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks rev: v2.16.0 hooks: - id: pretty-format-yaml args: [--autofix, --indent, '2'] exclude: ^(vendor/|dist/|\.gitlab-ci\.yml)
# ============================================================================= # Commit message validation (Conventional Commits) # =============================================================================- repo: https://github.com/commitizen-tools/commitizen rev: v4.19.0 hooks: - id: commitizen stages: [commit-msg]
# ============================================================================= # Local/Custom hooks for Zig # =============================================================================- repo: local hooks: # Zig formatting check — runs at BOTH pre-commit and pre-push so a # --no-verify on commit is still caught on push. - id: zig-fmt name: zig fmt (check) entry: mise x zig@0.16.0 -- zig fmt --check language: system files: \.zig$ exclude: ^(vendor/|dist/|zig-out/|\.zig-cache/) pass_filenames: false args: [src/, build.zig, tests/, benchmarks/, examples/] stages: [pre-commit, pre-push]
# Zig build check (compilation) — moved to pre-push per #471 to reduce commit friction - id: zig-build name: zig build (compilation check) entry: mise x zig@0.16.0 -- zig build language: system files: \.(zig|zon)$ exclude: ^(vendor/|dist/|zig-out/|\.zig-cache/) pass_filenames: false stages: [pre-push]
# Quick unit tests - id: zig-test name: zig build test entry: mise x zig@0.16.0 -- zig build test language: system files: \.(zig|zon)$ exclude: ^(vendor/|dist/|zig-out/|\.zig-cache/) pass_filenames: false stages: [pre-push] # Only on push, may be slow
# Check for TODO/FIXME in committed code (warning only) - id: check-todos name: check for TODOs/FIXMEs entry: bash args: - -c - | git diff --cached --name-only | xargs grep -l -E "(TODO|FIXME|XXX|HACK)" 2>/dev/null && echo "Warning: Found TODO/FIXME markers in staged files" && exit 0 || exit 0 language: system pass_filenames: false verbose: true
- repo: local hooks: - id: detect-diamond-deps name: detect diamond deps in build.zig.zon entry: uvx --refresh --from git+https://gitlab.com/devnw/zig/zig-tool detect-diamond-deps language: system files: ^build\.zig\.zon$ pass_filenames: false - id: check-version-tag name: release tag matches build.zig.zon version entry: uvx --refresh --from git+https://gitlab.com/devnw/zig/zig-tool zig-tool check-version-tag language: system stages: [pre-push] pass_filenames: false always_run: trueci: autofix_prs: true autofix_commit_msg: | [pre-commit.ci] auto fixes from pre-commit hooks
For more info see https://pre-commit.ci autoupdate_branch: '' autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate' autoupdate_schedule: weekly skip: [zig-fmt, zig-build, zig-test, detect-diamond-deps, check-version-tag] submodules: false