-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
65 lines (50 loc) · 2.01 KB
/
.pre-commit-config.yaml
File metadata and controls
65 lines (50 loc) · 2.01 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
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
# Prevent giant files from being committed.
- id: check-added-large-files
# Simply check whether files parse as valid python.
- id: check-ast
# Attempts to load all json files to verify syntax.
- id: check-json
# Check for files that contain merge conflict strings.
- id: check-merge-conflict
# Checks for symlinks which do not point to anything.
- id: check-symlinks
# Attempts to load all TOML files to verify syntax.
- id: check-toml
# Attempts to load all yaml files to verify syntax.
- id: check-yaml
# Check for debugger imports and py37+ `breakpoint()` calls in python source.
- id: debug-statements
# Detects symlinks which are changed to regular files with a content of a path which that symlink was pointing to.
- id: destroyed-symlinks
# Makes sure files end in a newline and only a newline.
- id: end-of-file-fixer
# Prevent addition of new git submodules.
- id: forbid-new-submodules
# Replaces or checks mixed line ending.
- id: mixed-line-ending
args: [ --fix=auto ]
# Checks that all your JSON files are pretty. "Pretty" here means that keys are sorted and indented.
- id: pretty-format-json
args: [ --autofix ]
# Sorts entries in requirements.txt and constraints.txt and removes incorrect entry for pkg-resources==0.0.0
- id: requirements-txt-fixer
# Trims trailing whitespace.
- id: trailing-whitespace
# exclude: dvc.lock
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.3.7
hooks:
# Run the linter.
- id: ruff
args: [ --fix ]
types_or: [ python, pyi, jupyter ]
# Run the formatter.
- id: ruff-format
types_or: [ python, pyi, jupyter ]