Files
slither/.pre-commit-config.yaml
Dan GuidoandClaude Opus 4.5 a68c3ab2a0 chore: modernize pre-commit hooks with prek (#2894)
- Replace pre-commit with prek (Rust-based, faster)
- Add shellcheck and shfmt for shell script linting
- Add actionlint for GitHub Actions validation
- Add actionlint.yaml config for ubuntu-slim runner label
- Update Makefile: lint target adds actionlint/zizmor, reformat adds ruff format
- Update make dev to auto-install hooks
- Update CLAUDE.md and CONTRIBUTING.md to document prek
- Remove redundant hooks (debug-statements, check-yaml, mixed-line-ending)
- Auto-fix formatting issues caught by new hooks

Co-authored-by: Claude Opus 4.5 <[email protected]>
2026-01-16 00:57:56 -05:00

51 lines
1.2 KiB
YAML

repos:
# Python linting & formatting
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.13
hooks:
- id: ruff-check
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
# Shell scripts
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
args: [-x]
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.11.0-1
hooks:
- id: shfmt
args: [-i, "2", -ci, -bn]
# GitHub Actions validation
- repo: https://github.com/rhysd/actionlint
rev: v1.7.7
hooks:
- id: actionlint
# YAML validation
- repo: https://github.com/adrienverge/yamllint
rev: v1.37.1
hooks:
- id: yamllint
args: [-c, .yamllint]
exclude: ^tests/|^docs/
# File hygiene
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude: ^tests/
- id: end-of-file-fixer
exclude: ^tests/|^docs/
- id: check-added-large-files
args: [--maxkb=1000]
- id: check-merge-conflict
- id: check-toml
default_stages: [pre-commit, pre-push]