Skip to content

Commit d1d4c41

Browse files
author
Mattia Baldari
committed
Add pre-commit hooks configuration
Configure pre-commit with: - Ruff linting and formatting - Standard checks (trailing whitespace, EOF, AST validation, etc.) Pre-commit hooks help catch issues before committing and ensure consistent code quality across contributors.
1 parent c962f41 commit d1d4c41

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.pre-commit-config.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
default_stages: [pre-commit]
2+
3+
repos:
4+
- repo: https://github.com/astral-sh/ruff-pre-commit
5+
rev: v0.14.5
6+
hooks:
7+
- id: ruff
8+
name: Check 'ruff linter' passes
9+
args: [--fix, --exit-non-zero-on-fix]
10+
11+
- id: ruff-format
12+
name: Check 'ruff format' passes
13+
14+
- repo: https://github.com/pre-commit/pre-commit-hooks
15+
rev: v6.0.0
16+
hooks:
17+
- id: trailing-whitespace
18+
name: Remove trailing whitespace
19+
args: [--markdown-linebreak-ext=md]
20+
21+
- id: end-of-file-fixer
22+
name: Check files end in a newline character
23+
24+
- id: check-ast
25+
name: Check files parse as valid Python
26+
27+
- id: check-json
28+
name: Validate JSON syntax
29+
30+
- id: check-yaml
31+
name: Validate YAML syntax
32+
33+
- id: check-merge-conflict
34+
name: Check for merge conflict markers
35+
36+
- id: debug-statements
37+
name: Check for debug breakpoints
38+
39+
- id: check-added-large-files
40+
name: Check for large files

0 commit comments

Comments
 (0)