This repository was archived by the owner on Jul 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.pre-commit-config.yaml
47 lines (47 loc) · 1.6 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
repos:
- repo: git://github.com/pre-commit/pre-commit-hooks
rev: v2.2.1
hooks:
# tidy up extra whitespace at end of files
- id: trailing-whitespace
# ensure consistent newline endings for files (\n only)
- id: end-of-file-fixer
# fix newlines in general to prevent pesky windows users writing CRLF
- id: mixed-line-ending
args:
- --fix=lf
# do not allow pdb/breakpoint statements to be checked in
- id: debug-statements
# fed up of YAML breaking
- id: check-yaml
args:
- --allow-multiple-documents
# run flake8 for linting/ensuring pep8
- id: flake8
args:
- --max-line-length=120
# *_pb2.py are auto-generated / compiled from Google's protobuf definitions
- --exclude=*/migrations/*,docs/*,*_pb2.py,turnkey/test_settings.py
# Make flake8 ignore black's opinions
# E126 - continuation line over-indented for hanging indent
# E203 - whitespace before ':'
# E501 - line too long
# W503 - line break before binary operator
- --ignore=E126,E203,E501,W503
# organise requirment files alphabetically
- id: requirements-txt-fixer
args:
- requirements/requirements.txt
- requirements/requirements-dev.txt
- requirements/requirements-test.txt
# run the (very opinionated!) black code formatter - https://github.com/ambv/black
- repo: git://github.com/ambv/black
rev: 19.3b0
hooks:
- id: black
args:
- --line-length=120
- --safe
# *_pb2.py are auto-generated / compiled from Google's protobuf definitions
- --exclude='.*_pb2.py'
- --exclude='turnkey/test_settings.py'