Skip to content

Commit 57f9f52

Browse files
committed
Add pre-commit configuration
Run `pre-commit install` to start using it Signed-off-by: Aline Manera <[email protected]>
1 parent 8334268 commit 57f9f52

File tree

4 files changed

+41
-0
lines changed

4 files changed

+41
-0
lines changed

.flake8

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[flake8]
2+
ignore = E203, E266, E501, W503, W504, E741, C901
3+
max-line-length = 88
4+
max-complexity = 18
5+
select = B,C,E,F,W,T4,B9,B950

.pre-commit-config.yaml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Pre-commit git hooks, run locally before every commit
2+
# Init with
3+
# $ pip install -r requirements-dev.txt
4+
# $ pre-commit install
5+
6+
repos:
7+
- repo: https://github.com/pre-commit/pre-commit-hooks
8+
rev: v2.1.0
9+
hooks:
10+
- id: trailing-whitespace
11+
- id: end-of-file-fixer
12+
#- id: check-docstring-first
13+
- id: check-json
14+
#- id: check-added-large-files
15+
- id: check-yaml
16+
- id: debug-statements
17+
#- id: name-tests-test
18+
- id: double-quote-string-fixer
19+
- id: requirements-txt-fixer
20+
- repo: https://gitlab.com/pycqa/flake8
21+
rev: 3.7.1
22+
hooks:
23+
- id: flake8
24+
- repo: https://github.com/pre-commit/mirrors-autopep8
25+
rev: v1.4.4
26+
hooks:
27+
- id: autopep8
28+
- repo: https://github.com/asottile/reorder_python_imports
29+
rev: v1.3.5
30+
hooks:
31+
- id: reorder-python-imports
32+
language_version: python3

requirements-dev.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pre-commit

setup.cfg

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[pycodestyle]
2+
ignore = E226,E302,E41,W503,W504,E741
3+
max-line-length = 88

0 commit comments

Comments
 (0)