-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.pre-commit-config.yaml
120 lines (106 loc) · 3.12 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# See https://pre-commit.com/ for usage and config
# List of pre-commit-hooks:
# https://github.com/pre-commit/pre-commit-hooks/blob/master/.pre-commit-hooks.yaml#L38
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0 # Use the ref you want to point at
hooks:
# - id: check-docstring-first
# name: check-docstring-first
# description: Checks a common error of defining a docstring after code.
# entry: check-docstring-first
# language: system
# types: [python]
- id: check-ast
name: Check python ast (abstract syntax tree)
description: Simply check whether the files parse as valid python.
entry: check-ast
language: python
types: [python]
- id: check-merge-conflict
name: Check for merge conflicts
description: Check for files that contain merge conflict strings.
entry: check-merge-conflict
language: python
types: [text]
- id: check-yaml
name: Check Yaml
description: This hook checks yaml files for parseable syntax.
entry: check-yaml
language: python
types: [yaml]
- id: detect-private-key
name: Detect Private Key
description: Detects the presence of private keys
entry: detect-private-key
language: python
types: [text]
- id: end-of-file-fixer
name: Fix End of Files
description: Ensures that a file is either empty, or ends with one newline.
entry: end-of-file-fixer
language: python
types: [text]
stages: [commit, push, manual]
- id: fix-encoding-pragma
name: Fix python encoding pragma
language: python
entry: fix-encoding-pragma
description: "Add # -*- coding: utf-8 -*- to the top of python files"
types: [python]
- repo: local
hooks:
- id: isort
name: isort
stages: [commit]
language: system
# running isort with these settings to avoid clash with black
# see: https://copdips.com/2020/04/making-isort-compatible-with-black.html
entry: pipenv run isort -m 3 -tc
types: [python]
# - id: pylint
# name: pylint
# entry: pylint
# language: system
# types: [python]
- id: flake8
name: flake8
stages: [commit]
language: system
entry: pipenv run flake8
types: [python]
exclude: setup.py
- id: mypy
name: mypy
stages: [commit]
language: system
entry: pipenv run mypy
types: [python]
require_serial: true
- id: bandit
name: bandit
stages: [commit]
language: system
entry: pipenv run bandit -r ./personroles/
types: [python]
- id: pytest-cov
name: pytest
stages: [commit]
language: system
entry: pipenv run pytest --cov --cov-append --cov-report=term-missing
types: [python]
pass_filenames: false
# - id: scss-lint
# name: scss-lint
# entry: scss-lint
# language: ruby
# language_version: 2.1.5
# types: [scss]
# additional_dependencies: ['scss_lint:0.52.0']
#
# - id: black
# name: black
# stages: [commit]
# language: system
# entry: pipenv run black
# types: [python]