-
Notifications
You must be signed in to change notification settings - Fork 2
/
.pre-commit-config.yaml
83 lines (81 loc) · 2.4 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
83
ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
autofix_prs: true
autoupdate_branch: ''
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: weekly
skip: [pylint,pytest-check]
submodules: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
exclude: ^data/.*\.xml$
- id: end-of-file-fixer
exclude: ^tests/data/|^data/.*\.xml$
- id: check-docstring-first
- id: check-json
- id: check-yaml
exclude: colrev/template/github_pages/_config.yml
- id: check-toml
- id: debug-statements
- id: name-tests-test
exclude: ^data/parse.py
- repo: https://github.com/psf/black
rev: 23.10.1
hooks:
- id: black
language_version: python3
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8
additional_dependencies: [flake8-typing-imports==1.12.0]
args: ['--max-line-length=110', '--extend-ignore=E203,TYP006']
- repo: https://github.com/asottile/reorder-python-imports
rev: v3.12.0
hooks:
- id: reorder-python-imports
args: [--py3-plus]
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade
args: [--py36-plus, --keep-runtime-typing]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.6.1'
hooks:
- id: mypy
args: [--disallow-untyped-defs, --disallow-incomplete-defs, --disallow-untyped-calls]
exclude: ^data/parse.py|^docs/source/conf.py
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.3
hooks:
- id: ruff # runs faster than pylint
args: [--fix, --exit-non-zero-on-fix]
- repo: local
hooks:
- id: pytest-check
name: pytest-check
entry: pytest
language: system
pass_filenames: false
always_run: true
args:
["--disable-warnings"]
- repo: local # pylint should mostly be covered by ruff. Once custom checkers are supported (.pylintrc), we will switch to ruff completely.
hooks:
- id: pylint
name: pylint
entry: pylint
language: system
types: [python]
files: colrev
args:
[
"-rn", # Only display messages
"-sn", # Don't display the score
]