forked from rinikerlab/PyGromosTools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
87 lines (77 loc) · 2.53 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
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
submodules: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: trailing-whitespace
exclude: docs
- id: end-of-file-fixer
exclude: docs
- id: check-yaml
args: ["--unsafe"]
- id: check-added-large-files
exclude: docs
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
name: Fixes formatting
language_version: python3
args: ["--line-length=120"]
- repo: https://github.com/pycqa/flake8.git
rev: 3.8.4
hooks:
- id: flake8
name: Checks pep8 style
args: [
"--max-line-length=120",
# Ignore imports in init files
"--per-file-ignores=
*/__init__.py:F401,setup.py:E121
versioneer.py:W605
*/sphinx*/conf.py:E402
pygromos/analysis/free_energy_calculation.py:W605
",
# ignore long comments (E501), as long lines are formatted by black
# ignore Whitespace before ':' (E203)
# ignore lambdas (E731)
# ignore Line break occurred before a binary operator (W503)
# needed to not remove * imports (for example in _all_blocks.py)
"--ignore=E501,E203, E731,W503,F405",
]
- 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" --sync
files: \.ipynb$
language: python
stages: [push]
- id: jupyblack
name: Fixes ipynb format
entry: jupytext --pipe-fmt ".py" --pipe "black - --line-length=120" --sync
files: \.ipynb$
language: python
stages: [push]
# - id: nbconvert
# name: Removes ipynb content
# entry: jupyter nbconvert
# args:
# [
# "--ClearOutputPreprocessor.enabled=True",
# "--ClearMetadataPreprocessor.enabled=True",
# "--RegexRemovePreprocessor.enabled=True",
# "--to=notebook",
# "--log-level=ERROR",
# "--inplace",
# ]
# files: \.ipynb$
# language: python