Skip to content

Commit 278e2f2

Browse files
committed
add pre-commit-config
1 parent b9fb872 commit 278e2f2

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.pre-commit-config.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
default_stages: [commit, push]
2+
exclude: ^images/
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.4.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: check-yaml
10+
- id: check-added-large-files # prevent giant files from being committed
11+
- id: requirements-txt-fixer
12+
- id: mixed-line-ending
13+
args: ["--fix=lf"]
14+
description: Forces to replace line ending by the UNIX 'lf' character.
15+
16+
# black
17+
- repo: https://github.com/psf/black
18+
rev: 22.12.0
19+
hooks:
20+
- id: black
21+
- id: black-jupyter
22+
args:
23+
- --line-length=88
24+
25+
# isort
26+
- repo: https://github.com/pycqa/isort
27+
rev: 5.11.2
28+
hooks:
29+
- id: isort
30+
description: Sorts imports in an alphabetical order
31+
32+
# flake8
33+
- repo: https://github.com/pycqa/flake8
34+
rev: 4.0.1
35+
hooks:
36+
- id: flake8
37+
args: # arguments to configure flake8
38+
# making isort line length compatible with black
39+
- "--max-line-length=88"
40+
- "--max-complexity=18"
41+
- "--select=B,C,E,F,W,T4,B9"
42+
43+
# these are errors that will be ignored by flake8
44+
# check out their meaning here
45+
# https://flake8.pycqa.org/en/latest/user/error-codes.html
46+
- "--ignore=E203,E266,E501,W503,F403,F401,E402,W605"

0 commit comments

Comments
 (0)