forked from charnley/rmsd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
95 lines (88 loc) · 2.78 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
84
85
86
87
88
89
90
91
92
93
94
95
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
args: ["--unsafe"]
- id: check-added-large-files
- repo: https://github.com/myint/autoflake
rev: v1.4
hooks:
- id: autoflake
name: Removes unused variables
args:
- --in-place
- --remove-all-unused-imports
- --remove-unused-variables
- --expand-star-imports
- --ignore-init-module-imports
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.7.0
hooks:
- id: isort
name: Sorts imports
args: [
# Align isort with black formatting
"--multi-line=3",
"--trailing-comma",
"--force-grid-wrap=0",
"--use-parentheses",
"--line-width=99",
]
- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
- id: black
name: Fixes formatting
language_version: python3
args: ["--line-length=99"]
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
hooks:
- id: flake8
name: Checks pep8 style
args:
- --max-line-length=99
# F405 - init imports * from module
# F401 - ignore imports used in init
# F403 - import * used in init
- --exclude=__init__.py
# ignore long comments (E501), as long lines are formatted by black
# ignore Whitespace before ':' (E203)
# ignore Line break occurred before a binary operator (W503)
- --ignore=E501,E203,W503
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v0.790
# hooks:
# - id: mypy
# name: Checks code types
# args: ["--strict"]
#
# - repo: https://github.com/pycqa/pylint
# rev: pylint-2.6.0
# hooks:
# - id: pylint
# name: Checks code quality
# args:
# - --max-line-length=99
# - --ignore-imports=yes
# - -d duplicate-code
- repo: local
hooks:
- id: jupyisort
name: Sorts ipynb imports
entry: jupytext --pipe-fmt ".py" --pipe "isort - --multi-line=3 --trailing-comma --force-grid-wrap=0 --use-parentheses --line-width=99"
files: .ipynb
language: python
- id: jupyblack
name: Fixes ipynb format
entry: jupytext --pipe-fmt ".py" --pipe "black - --line-length=99"
files: .ipynb
language: python
- id: nbconvert
name: Removes ipynb content
entry: jupyter nbconvert --ClearOutputPreprocessor.enabled=True --ClearMetadataPreprocessor.enabled=True RegexRemovePreprocessor.enabled=True --to=notebook --log-level=ERROR --inplace
files: .ipynb
language: python