-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
136 lines (124 loc) · 3.93 KB
/
.pre-commit-config.yaml
File metadata and controls
136 lines (124 loc) · 3.93 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
# Pre-commit configuration for dataing
# Install: pip install pre-commit && pre-commit install
# Run manually: pre-commit run --all-files
default_language_version:
python: python3
repos:
# Standard pre-commit hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
exclude: ^(demo/fixtures/|\.lock$|frontend/node_modules/)
- id: end-of-file-fixer
exclude: ^(demo/fixtures/|\.lock$|frontend/node_modules/)
- id: check-yaml
args: [--unsafe] # Allow custom tags
- id: check-json
exclude: ^(demo/fixtures/|frontend/node_modules/)
- id: check-toml
- id: check-added-large-files
args: [--maxkb=1000]
exclude: ^demo/fixtures/
- id: check-merge-conflict
- id: check-case-conflict
- id: detect-private-key
- id: debug-statements
- id: check-executables-have-shebangs
exclude: ^frontend/node_modules/
- id: check-shebang-scripts-are-executable
exclude: ^frontend/node_modules/
# Python: Ruff for linting and formatting
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.0
hooks:
# Linting
- id: ruff
args: [--fix]
files: ^python-packages/
# Formatting
- id: ruff-format
files: ^python-packages/
# Python: mypy for type checking
- repo: local
hooks:
- id: mypy
name: mypy (python-packages)
entry: bash -c 'uv run mypy python-packages/dataing/src python-packages/dataing-ee/src'
language: system
files: ^python-packages/.*\.py$
pass_filenames: false
types: [python]
# Frontend: TypeScript, ESLint and Prettier
- repo: local
hooks:
- id: tsc
name: tsc (frontend)
entry: bash -c 'cd frontend && pnpm tsc --noEmit'
language: system
files: ^frontend/src/.*\.(ts|tsx)$
pass_filenames: false
- id: eslint
name: eslint (frontend)
entry: bash -c 'cd frontend && pnpm lint --fix'
language: system
files: ^frontend/src/.*\.(ts|tsx|js|jsx)$
pass_filenames: false
- id: prettier
name: prettier (frontend)
entry: bash -c 'cd frontend && pnpm exec prettier --write --ignore-unknown'
language: system
files: ^frontend/src/.*\.(ts|tsx|js|jsx|json|css|scss|md)$
pass_filenames: true
# SQL formatting (optional - comment out if not using)
# - repo: https://github.com/sqlfluff/sqlfluff
# rev: 3.0.0
# hooks:
# - id: sqlfluff-lint
# files: ^backend/migrations/.*\.sql$
# Security checks
- repo: https://github.com/Yelp/detect-secrets
rev: v1.5.0
hooks:
- id: detect-secrets
args: [--baseline, .secrets.baseline]
exclude: |
(?x)^(
node_modules/.*|
demo/fixtures/.*|
tests/.*|
.*\/tests\/.*|
.*\.lock$|
uv\.lock$|
pnpm-lock\.yaml$|
package-lock\.json$|
frontend/jupyterlab-dataing/tsconfig\.tsbuildinfo|
frontend/jupyterlab-dataing/jupyterlab_dataing/labextension/static/.*|
dist/.*|
\.next/.*|
\.venv/.*|
\.flow/.*
)$
# Dockerfile linting
- repo: https://github.com/hadolint/hadolint
rev: v2.12.0
hooks:
- id: hadolint-docker
files: Dockerfile
# Shell script linting
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.6
hooks:
- id: shellcheck
files: \.(sh|bash)$
exclude: ^demo/fixtures/
# CI configuration
ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit hooks
autofix_prs: true
autoupdate_branch: ''
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: weekly
skip: [mypy, tsc, eslint, prettier] # Skip hooks that need full project context in CI
submodules: false