-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
90 lines (82 loc) · 2.49 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
90 lines (82 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Pre-commit hooks for pyngb
# See https://pre-commit.com for more information
repos:
# Linting and code quality
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.8
hooks:
- id: ruff
name: "Lint Python code with Ruff"
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
name: "Format Python code with Ruff"
# Type checking
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.17.1
hooks:
- id: mypy
name: "Type check with mypy"
additional_dependencies:
- types-setuptools
args: [--ignore-missing-imports]
files: ^src/pyngb/.*\.py$
# General file checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
name: "Remove trailing whitespace"
- id: end-of-file-fixer
name: "Ensure files end with newline"
- id: check-yaml
name: "Check YAML syntax"
- id: check-toml
name: "Check TOML syntax"
- id: check-json
name: "Check JSON syntax"
- id: check-merge-conflict
name: "Check for merge conflict markers"
- id: check-added-large-files
name: "Check for large files"
args: [--maxkb=1000]
- id: check-case-conflict
name: "Check for case conflicts"
- id: mixed-line-ending
name: "Check line endings"
args: [--fix=lf]
# Security checks
- repo: https://github.com/PyCQA/bandit
rev: 1.8.6
hooks:
- id: bandit
name: "Security check with Bandit"
args: [-c, pyproject.toml]
additional_dependencies: ["bandit[toml]"]
exclude: tests/
# Docstring checks (temporarily disabled while focusing on core functionality)
# - repo: https://github.com/pycqa/pydocstyle
# rev: 6.3.0
# hooks:
# - id: pydocstyle
# name: "Check docstrings with pydocstyle"
# additional_dependencies: [toml]
# files: ^src/pyngb/.*\.py$
# args: [--convention=numpy]
# Spell checking
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
name: "Check spelling"
args: [--write-changes]
exclude: |
(?x)^(
.*\.lock|
.*\.ngb-ss3|
tests/test_files/.*
)$
# Configuration for specific hooks
default_install_hook_types: [pre-commit, pre-push]
default_stages: [pre-commit]
# Minimum pre-commit version
minimum_pre_commit_version: '3.0.0'