-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
76 lines (69 loc) · 2.49 KB
/
.pre-commit-config.yaml
File metadata and controls
76 lines (69 loc) · 2.49 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Pre-commit configuration for statuspro-openapi-client
# See https://pre-commit.com for more information
#
# This configuration uses LOCAL hooks that run via uv to avoid network
# restrictions in CI environments (e.g., GitHub Copilot agents that block
# pip.pypa.io). All tools are installed via project dependencies.
#
# See issue #134 for background on why we use local hooks.
# Make `pre-commit install` set up the pre-push hook too. Without this, the
# pre-push hook would silently not run for contributors who only ran the bare
# `pre-commit install` from the README. See block-push-to-main below.
default_install_hook_types: [pre-commit, pre-push]
repos:
- repo: local
hooks:
# Python formatting and linting with Ruff (via uv)
- id: ruff-format
name: ruff format
entry: uv run ruff format
language: system
types: [python]
pass_filenames: true
- id: ruff-check
name: ruff check
entry: uv run ruff check --fix
language: system
types: [python]
pass_filenames: true
# Markdown formatting (prettier via pnpm)
- id: prettier-markdown
name: prettier (markdown)
entry: pnpm exec prettier --write
language: system
types: [markdown]
exclude: |
(?x)(
(^|.+/)CHANGELOG\.md$|
\.agent\.md$|
statuspro_mcp_server/src/statuspro_mcp/templates/.*\.md$|
\.claude/skills/.*\.md$
)
pass_filenames: true
# YAML linting (via uv)
- id: yamllint
name: yamllint
entry: uv run yamllint -c=.yamllint.yml
language: system
types: [yaml]
pass_filenames: true
# Run tests (via poe task)
- id: pytest
name: pytest
entry: uv run poe test
language: system
pass_filenames: false
always_run: true
# Refuse pushes that would land non-main commits on the `main` ref.
# See CLAUDE.md "Known Pitfalls" — git's tracked-upstream resolution can
# silently route `git push -u origin <branch>` to main when the local
# branch was created from origin/main. Mechanical guardrail, ported
# from katana-openapi-client (#434) after a real release-pipeline
# incident there.
- id: block-push-to-main
name: block direct push to main from a non-main branch
entry: scripts/pre-push-guard.sh
language: system
stages: [pre-push]
pass_filenames: false
always_run: true