-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.pre-commit-config.yaml
81 lines (74 loc) · 2.33 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
repos:
#####################################
# Makes code clean and pretty #
#####################################
- repo: https://github.com/ambv/black
rev: 18.9b0
hooks:
- id: black
args: [--safe, --line-length=99]
name: Prettify Python Code
always_run: true
#####################################
# Sorts module imports #
#####################################
- repo: https://github.com/timothycrosley/isort
rev: 5.6.4
hooks:
- id: isort
name: Sort Python Imports
always_run: false
args: [--multi-line=3, --trailing-comma, --force-grid-wrap=0, --use-parentheses, --line-width=99]
#####################################
# Strips trailing whitespace #
#####################################
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.0.0
hooks:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: check-json
- id: pretty-format-json
args: [--autofix, --no-sort-keys]
- id: end-of-file-fixer
#####################################
# Checks for code style issues #
#####################################
- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.3
hooks:
- id: flake8
additional_dependencies: [flake8~=3.7.3]
args: [--max-line-length=99]
name: Check Python Style
stages: [push]
#####################################
# Checks for documentation issues #
#####################################
- repo: https://github.com/pycqa/pydocstyle
rev: 5.0.2
hooks:
- id: pydocstyle
name: Check Python Documentation
stages: [push]
#####################################
# Format Nix files #
#####################################
- repo: local
hooks:
- id: nixpkgs-fmt
name: Prettify Nix Files
entry: nixpkgs-fmt
language: system
types: [nix]
#####################################
# Runs unit tests #
#####################################
- repo: local
hooks:
- id: tests
name: Run tests
entry: nix-shell ./nix/shell.nix --run "python -m pytest"
language: system
types: [python]
always_run: true