-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy path.pre-commit-config.yaml
82 lines (73 loc) · 2.13 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
default_stages: [pre-commit]
exclude: 'torchlaplace/_iltcme.py|.*__init__\.py$'
# Install
# 1. pip install e - .[testing] && pip install e - .[experiments]
# 2. pre-commit install
# 3. pre-commit run --all-files # make sure all files are clean
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: trailing-whitespace
- id: check-ast
- id: check-json
- id: check-merge-conflict
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: requirements-txt-fixer
- id: mixed-line-ending
args: ['--fix=auto'] # replace 'auto' with 'lf' to enforce Linux/Mac line endings or 'crlf' for Windows
- repo: https://github.com/pycqa/isort
rev: 5.11.5
hooks:
- id: isort
args: ['--profile', 'black']
exclude: >-
(?x)^(
.*__init__\.py$
)
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.0.284
hooks:
- id: ruff
args: [--fix]
# - repo: https://github.com/psf/black
# rev: 23.3.0
# hooks:
# - id: black
# args: ['--line-length', '80'] # Adhere to Google Style Guide
- repo: https://github.com/pre-commit/mirrors-yapf
rev: v0.32.0
hooks:
- id: yapf
args: ['--style', '{based_on_style: google, column_limit: 80, indent_width: 2}'] # Google Style with 2 spaces
additional_dependencies: [configparser] # Ensures compatibility
- repo: local
hooks:
- id: pylint
name: Pylint (Google Style)
entry: pylint
args: ['--rcfile=pylintrc']
language: system
types: [python]
- repo: https://github.com/google/pytype
rev: 2024.10.11
hooks:
- id: pytype
name: Pytype (Type Checking)
entry: bash -c 'pytype --config=pytype.cfg || true'
language: python
pass_filenames: false
always_run: true
- repo: local
hooks:
- id: pytest
name: Run Pytest
entry: pytest
args: ['tests']
language: system
pass_filenames: false
always_run: true
verbose: true