-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
58 lines (52 loc) · 1.65 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
58 lines (52 loc) · 1.65 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
# Pre-commit configuration for sleep-ST
# Runs basic hygiene + Python formatting/lint + notebook checks
# Docs: https://pre-commit.com/
# Exclude large data and cache folders
exclude: |
^(data/|tmp/|.venv/|.mypy_cache/|.pytest_cache/|.ruff_cache/|.git/)
repos:
# Generic file checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-yaml
- id: check-json
- id: check-toml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: mixed-line-ending
- id: detect-private-key
- id: check-added-large-files
args: ["--maxkb=500"] # Warn if files > 500KB
- id: check-merge-conflict
# Ruff for Python linting/formatting (fast)
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.9
hooks:
- id: ruff
args: ["--fix"]
- id: ruff-format
# Type checking with mypy
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.2
hooks:
- id: mypy
args: ["--ignore-missing-imports", "--no-strict-optional"]
# Exclude data/tmp folders and notebooks
exclude: ^(data/|tmp/|notebooks/)
# Security linting with bandit
- repo: https://github.com/PyCQA/bandit
rev: 1.7.9
hooks:
- id: bandit
args: ["-ll", "-i"] # Low/Medium severity, skip .gitignore files
exclude: ^(data/|tmp/|notebooks/)
# nbQA to run tools on Jupyter Notebooks
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.9.0
hooks:
- id: nbqa-ruff
additional_dependencies: ["ruff==0.6.9"]
args: ["--fix"]
- id: nbqa-ruff-format
additional_dependencies: ["ruff==0.6.9"]