-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy path.pre-commit-config.yaml
69 lines (61 loc) · 1.66 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
default_stages: [pre-commit]
exclude: '.*__init__\.py$'
# Install
# 1. pip install l2mac[dev]
# 2. pre-commit install
# 3. pre-commit run --all-files # make sure all files are clean
repos:
- 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: pytype
args: ['--disable=import-error', '--config=pytype.cfg']
language: python
types: [python]
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