-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
52 lines (47 loc) · 1.98 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
52 lines (47 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Pre-commit hooks for sql-sop itself — dogfoods the tool this repo ships.
#
# Install: ``pre-commit install``. On every commit, hooks in this file run
# against the staged files and either auto-fix (ruff --fix, trailing
# whitespace) or block the commit with a readable error.
#
# Hosted runs: pre-commit.ci runs these hooks on every PR and opens an
# auto-update PR weekly to bump the rev pins below.
ci:
autofix_commit_msg: |
style: pre-commit auto-fixes
[pre-commit.ci] auto-applied fixes from configured hooks
autoupdate_commit_msg: |
chore(deps): pre-commit autoupdate
autoupdate_schedule: weekly
repos:
# ── Standard hygiene ──────────────────────────────────────────────
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
args: ["--maxkb=500"]
- id: check-merge-conflict
# ── Ruff — lint + format, replaces flake8 + isort + black ──────────
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.22
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
# ── sql-sop dogfooding itself ─────────────────────────────────────
# Runs sql-sop on staged .sql files so a regression in a rule is
# caught before it ships. Test fixtures under ``tests/fixtures/`` are
# excluded because those files deliberately contain bad SQL
# (E001..E006, S001..S003, etc.) to drive the rule unit tests --
# running the linter against them is guaranteed to fail and was
# turning pre-commit.ci red on every PR.
- repo: https://github.com/Pawansingh3889/sql-guard
rev: v0.9.0
hooks:
- id: sql-sop
args: [--severity, error]
files: \.sql$
exclude: ^tests/fixtures/