-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
49 lines (44 loc) · 1.49 KB
/
.pre-commit-config.yaml
File metadata and controls
49 lines (44 loc) · 1.49 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
# See https://pre-commit.com for more information
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0 # Use the ref you want to point at
hooks:
- id: check-ast # if the files parsed as valid python
- id: check-added-large-files
- id: check-builtin-literals # requires literal syntax when initializing empty
- id: check-merge-conflict # if the files that contain merge conflict
- id: check-toml
- id: check-yaml
args: [ --unsafe ]
- id: trailing-whitespace
- id: end-of-file-fixer # ensures files end with a newline
- id: mixed-line-ending # replaces or checks mixed line ending
- repo: local
hooks:
- id: pylint
name: Run pylint
entry: pylint
# system - pylint is in the venv. Use language: python for new env
language: system
types: [ python ]
args: [ "--output-format=colorized" ]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.8 # the latest ruff version
hooks:
# Run the linter
- id: ruff-check
types_or: [ python, pyi ]
args: [ --fix, --exit-non-zero-on-fix ]
# Run the formatter
- id: ruff-format
types_or: [ python, pyi ]
args: [ --diff, --check ]
- repo: local
hooks:
- id: run-pytest
name: Run Pytest
entry: pytest
language: system # pytest is in the dev .venv
types: [ python ]
pass_filenames: false
exclude: ^tests