File size: 1,348 Bytes
eca55dc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v5.0.0
    hooks:
      # Trim whitespace at end of lines.
      - id: trailing-whitespace
      # Ensure files end with a single newline.
      - id: end-of-file-fixer
      # Catch unresolved merge conflict markers.
      - id: check-merge-conflict
      # Validate YAML syntax (Hydra configs, etc.).
      - id: check-yaml
      # Validate TOML syntax (e.g., pyproject.toml).
      - id: check-toml
      # Detect mixed CRLF/LF endings without auto-rewriting.
      - id: mixed-line-ending
        args: ["--fix=no"]
      # Catch accidental debug leftovers (breakpoint/pdb).
      - id: debug-statements
      # Block accidental private key commits.
      - id: detect-private-key
      # Prevent case-colliding paths across filesystems.
      - id: check-case-conflict
      # Block newly added large files unless explicitly allowlisted below.
      - id: check-added-large-files
        args: ["--maxkb=5000"]
        exclude: ^(documents/LeJEPA\.pdf|documents/Audio-LeJEPA\.pdf)$

  - repo: https://github.com/astral-sh/ruff-pre-commit
    # Ruff version.
    rev: v0.15.0
    hooks:
      # Run the linter.
      - id: ruff-check
        types_or: [python, pyi]
        args: [--fix]
      # Run the formatter.
      - id: ruff-format
        types_or: [python, pyi]