-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
47 lines (43 loc) · 1.44 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
47 lines (43 loc) · 1.44 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
default_install_hook_types: [pre-push]
exclude: ^reports/ # skip auto-generated code coverage files
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-ast # Is it valid Python?
- id: debug-statements # no debbuging statements used
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
- id: check-case-conflict
- id: check-json
- id: pretty-format-json
args: [ "--autofix", "--no-sort-keys", "--no-ensure-ascii" ]
exclude: ^(model/data/testing)/
- id: check-merge-conflict
- id: detect-private-key
- id: check-executables-have-shebangs
- repo: https://github.com/asottile/pyupgrade
rev: v2.29.1
hooks:
- id: pyupgrade
exclude: ^(TAG)
# Remove blocks that are only compatible with Python ≤ 3.11
args: [--py311-plus]
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version
rev: v0.11.13
hooks:
# Run the linter
- id: ruff-check
# Fix lint issues, including docstrings, sorting imports and commented code
args: ["--extend-select", "D,I,ERA001", "--line-length", "120", "--fix"]
# Run the formatter
- id: ruff-format
# Type checking
- repo: local
hooks:
- id: ty-check
name: Type checking
entry: bash -c 'uvx ty==0.0.1a29 check --config-file ty.toml'
language: system