forked from xia2/xia2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
61 lines (56 loc) · 1.81 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
repos:
# Syntax validation and some basic sanity checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: check-merge-conflict
- id: check-ast
fail_fast: true
- id: check-json
- id: check-added-large-files
args: [--maxkb=200]
- id: check-yaml
- id: no-commit-to-branch
name: Don't commit to 'main'
# Automatically sort imports
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
args: [
'-a', 'from __future__ import annotations', # 3.7-3.11
'--rm', 'from __future__ import absolute_import', # -3.0
'--rm', 'from __future__ import division', # -3.0
'--rm', 'from __future__ import generator_stop', # -3.7
'--rm', 'from __future__ import generators', # -2.3
'--rm', 'from __future__ import nested_scopes', # -2.2
'--rm', 'from __future__ import print_function', # -3.0
'--rm', 'from __future__ import unicode_literals', # -3.0
'--rm', 'from __future__ import with_statement', # -2.6
]
# Automatic source code formatting
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
args: [--safe, --quiet]
# Linting
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
additional_dependencies: [flake8-comprehensions==3.8.0]
# Type checking
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.941
hooks:
- id: mypy
files: src/.*\.py$
additional_dependencies: [types-docutils, types-PyYAML]
# YAML formatter
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
rev: 0.2.1 # or specific tag
hooks:
- id: yamlfmt
args: [--mapping, '2', --sequence, '2', --offset, '0', --width, '150', --implicit_start]
exclude: .pre-commit-config.yaml