-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
executable file
·108 lines (98 loc) · 3.89 KB
/
.pre-commit-config.yaml
File metadata and controls
executable file
·108 lines (98 loc) · 3.89 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
repos:
# General file formatting and cleaning (Rust-based alternatives)
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude: ^(.*\.(md|tex)|git_submodules/.*)$
- id: end-of-file-fixer
exclude: ^(.*\.(md|tex|pdf|png|jpg|jpeg|svg)|git_submodules/.*)$
- id: check-yaml
exclude: ^(git_submodules/.*|\.github/workflows/.*)$
- id: check-toml
exclude: ^git_submodules/.*$
- id: check-json
exclude: ^(git_submodules/.*|submodules/.*)$
- id: check-merge-conflict
exclude: ^git_submodules/.*$
- id: check-added-large-files
args: ['--maxkb=1000']
exclude: ^git_submodules/.*$
- id: mixed-line-ending
args: ['--fix=lf']
exclude: ^git_submodules/.*$
# Temporarily disabled for PR - executable permission issues pre-exist
# - id: check-executables-have-shebangs
# exclude: ^git_submodules/.*$
# - id: check-shebang-scripts-are-executable
# exclude: ^git_submodules/.*$
# Spell checking with typos (Rust-based)
- repo: https://github.com/crate-ci/typos
rev: v1.34.0
hooks:
- id: typos
exclude: ^(git_submodules/.*|\.github/workflows/.*)$
# Python formatting, linting, and import sorting with Ruff (Rust-based)
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.0
hooks:
# Linting (includes docstring validation with Google convention)
- id: ruff
args: [--fix]
exclude: ^(.*\.ipynb|git_submodules/.*|\.github/workflows/.*)$
# Formatting (replaces black, isort, autoflake, docformatter)
- id: ruff-format
exclude: ^(.*\.ipynb|git_submodules/.*|\.github/workflows/.*)$
# Python type checking with mypy (temporarily disabled for PR - type issues pre-exist)
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v1.16.1
# hooks:
# - id: mypy
# additional_dependencies: [types-PyYAML, types-requests]
# args: [--ignore-missing-imports]
# exclude: ^(versioneer\.py|src/py/utils\.py|git_submodules/.*)$
# Security checks with bandit
- repo: https://github.com/pycqa/bandit
rev: 1.8.5
hooks:
- id: bandit
args: [-r, --format, custom, --skip, B101,B601,B602,B603,B604,B605,B607,B608]
exclude: ^(tests/|versioneer\.py|src/py/_version\.py|git_submodules/.*|.*test.*\.py|examples/.*)$
# Notebook output stripping (clean notebooks before commit)
- repo: https://github.com/kynan/nbstripout
rev: 0.8.1
hooks:
- id: nbstripout
args: [--keep-output, --keep-count]
exclude: ^git_submodules/.*$
# BibTeX validation and formatting
- repo: https://github.com/FlamingTempura/bibtex-tidy
rev: v1.14.0
hooks:
- id: bibtex-tidy
args: [--curly, --numeric, --align=13, --sort=year, --duplicates=key]
files: \.bib$
exclude: ^git_submodules/.*$
# Generate API documentation with lazydocs (without validation)
- repo: local
hooks:
- id: lazydocs-generate
name: Generate API documentation
entry: python src/rxiv_maker/engines/operations/generate_docs.py
language: system
files: ^src/rxiv_maker/.*\.py$
exclude: ^git_submodules/.*$
pass_filenames: false
# Living Documentation Validation (Phase 3.4c)
- id: validate-documentation
name: 📋 Validate Documentation Code Examples
entry: scripts/check-docs.sh
language: system
files: .*\.md$
exclude: ^(git_submodules/.*|docs_validation_report\.md|src/docs/.*)$
pass_filenames: false
stages: [pre-commit, manual]
# Repository integrity and contamination prevention safeguards (disabled - submodules removed)
# Note: Submodule validation hooks removed as project no longer uses submodules for distribution
default_language_version:
python: python3