-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.pre-commit-config.yaml
46 lines (42 loc) · 2.01 KB
/
.pre-commit-config.yaml
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
# This file contains configuration for the pre-commit (https://pre-commit.com/) tool.
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files # Prevent giant files from being committed
- id: check-case-conflict # Checks for files that conflict in case-insensitive filesystems
- id: check-json # Attempts to load all json files to verify syntax
- id: check-merge-conflict # Check for files that contain merge conflict strings
- id: check-symlinks # Checks for symlinks which do not point to anything
- id: check-xml # Attempts to load all xml files to verify syntax
- id: check-yaml # Attempts to load all yaml files to verify syntax
- id: debug-statements # Check for debugger imports and breakpoint() calls in python code
- id: end-of-file-fixer # Makes sure files end in a newline and only a newline
- id: no-commit-to-branch
# Protect 'main' branch from direct commits and also ensure branch names are lowercase to
# avoid clashes on case-insensitive filesystems
args: ['-p', '.*[^0-9a-z-_/.=].*']
- id: trailing-whitespace # Trims trailing whitespace
- repo: local
# We prefer to use local hooks as much as possible for formatting and linting checks. We
# install these tools locally anyway so editors can run them on a pre-save hook. Using local
# tools here ensures the versions used by the editor, pre-commit and CI all stay in sync.
hooks:
- id: ruff-lint
name: "lint Python code with ruff"
entry: "ruff check --fix"
language: system
types: [python]
require_serial: true
- id: ruff-format
name: "check Python formatting with ruff"
entry: "ruff format"
language: system
types: [python]
require_serial: true
- id: cargo-format
name: "check Rust formatting"
entry: "cargo fmt --"
language: system
types: [ rust ]
require_serial: true