-
Notifications
You must be signed in to change notification settings - Fork 3
/
.pre-commit-config.yaml
67 lines (60 loc) · 1.99 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
default_stages: [commit, push]
exclude: (^.github/|^docs/|^images/|^notebooks/py_scripts/)
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files # prevent giant files from being committed
- id: requirements-txt-fixer
- id: mixed-line-ending
args: ["--fix=lf"]
description: Forces to replace line ending by the UNIX 'lf' character.
# black
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
- id: black-jupyter
args:
- --line-length=88
# isort
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
args: ["--profile", "black"]
description: Sorts imports in an alphabetical order
# markdownlint
- repo: https://github.com/markdownlint/markdownlint/
rev: v0.12.0
hooks:
- id: markdownlint
name: Markdownlint
description: Run markdownlint on your Markdown files
entry: mdl
language: ruby
files: \.(md|mdown|markdown)$
args:
- "-r ~MD013"
# flake8
- repo: https://github.com/pycqa/flake8
rev: 4.0.1
hooks:
- id: flake8
args: # arguments to configure flake8
# making isort line length compatible with black
- "--max-line-length=88"
- "--max-complexity=18"
- "--select=B,C,E,F,W,T4,B9"
# these are errors that will be ignored by flake8
# https://www.flake8rules.com/rules/{code}.html
- "--ignore=E203,E501,W503"
# E203 - Colons should not have any space before them.
# Needed for list indexing
# E501 - Line lengths are recommended to be no greater than 79 characters.
# Needed as we conform to 88
# W503 - Line breaks should occur after the binary operator.
# Needed because not compatible with black