-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
140 lines (127 loc) · 4.15 KB
/
.pre-commit-config.yaml
File metadata and controls
140 lines (127 loc) · 4.15 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
---
# Pre-commit hooks for code quality and consistency
# Install: uv add --dev pre-commit && uv run pre-commit install
# Run manually: uv run pre-commit run --all-files
# Update hooks: uv run pre-commit autoupdate
default_language_version:
python: python3
repos:
# Git workflow enforcement
# - repo: https://github.com/compilerla/conventional-pre-commit
# rev: v3.4.0
# hooks:
# - id: conventional-pre-commit
# stages: [commit-msg]
# args: [optional, feat, fix, docs, test, refactor, chore, ci,
# build]
# Prevent direct commits to main branch
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: no-commit-to-branch
args: ['--branch', 'main', '--branch', 'master']
# General file checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
args: ['--maxkb=1000']
- id: check-ast
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: check-merge-conflict
- id: check-toml
- id: check-vcs-permalinks
- id: check-yaml
args: ['--unsafe']
- id: debug-statements
- id: detect-private-key
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: fix-encoding-pragma
args: ['--remove']
- id: mixed-line-ending
args: ['--fix=lf']
- id: name-tests-test
args: ['--pytest-test-first']
- id: trailing-whitespace
# Python linting and formatting with Ruff
# (replaces Black, isort, bandit, etc.)
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.13.1
hooks:
- id: ruff
args: ['--fix', '--exit-non-zero-on-fix']
- id: ruff-format
# Type checking with MyPy
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.18.2
hooks:
- id: mypy
additional_dependencies:
- pandas-stubs>=2.2.3
- types-aiofiles>=24.1.0.20250822
- types-chardet>=5.0.4.6
- types-jsonschema>=4.25.1.20250822
- types-psutil>=7.0.0.20250822
- types-tabulate>=0.9.0.20241207
- types-pytz>=2025.2.0.20250809
- pydantic>=2.0.0
- pydantic-settings>=2.0.0
- simpleeval>=1.0.3
- fastmcp>=0.1.0
- pandera>=0.22.0
- smithery>=0.4.2
- .
args: ['--config-file', 'pyproject.toml']
pass_filenames: true
# YAML linting with yamllint
- repo: https://github.com/adrienverge/yamllint
rev: v1.37.1
hooks:
- id: yamllint
args: [--format, parsable, --strict]
exclude: "^(.github/workflows/|docs/blog/)"
# Markdown formatting and linting (Python-based)
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.22
hooks:
- id: mdformat
additional_dependencies:
- mdformat-gfm
- mdformat-frontmatter
- mdformat-ruff
args: [--wrap=80]
# exclude: ^(CODE_OF_CONDUCT\.md|CONTRIBUTING\.md|docs/blog/).*
- repo: https://github.com/jackdewinter/pymarkdown
rev: v0.9.32
hooks:
- id: pymarkdown
args: ["--config", ".pymarkdownlnt", "scan"]
# exclude: ^(CODE_OF_CONDUCT\.md|CONTRIBUTING\.md|docs/blog/).*
# MCP documentation standards enforcement
- repo: local
hooks:
- id: check-docstring-args
name: check-docstring-args
entry: ./scripts/check_docstring_args.py
language: script
files: ^src/.*\.py$
description: >-
Check for Args sections in docstrings
(MCP tools use Field descriptions)
- id: check-mcp-field-descriptions
name: check-mcp-field-descriptions
entry: ./scripts/check_mcp_field_descriptions.py
language: script
files: ^src/.*\.py$
description: >-
Check that all MCP tool parameters have Field descriptions
ci:
autofix_prs: true
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit hooks
for more information, see https://pre-commit.ci
autoupdate_schedule: weekly
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'