-
Notifications
You must be signed in to change notification settings - Fork 6
/
.pre-commit-config.yaml
86 lines (81 loc) · 3.06 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
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_language_version:
python: python3
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
# https://blog.mphomphego.co.za/blog/2019/10/03/Why-you-need-to-stop-using-Git-Hooks.html
- id: check-ast
name: check-ast
description: Simply check whether files parse as valid python.
- id: check-builtin-literals
name: check-builtin-literals
description: Require literal syntax when initializing empty,
or zero Python builtin types.
- id: check-docstring-first
name: check-docstring-first
description: Checks for a common error of placing code before the docstring.
- id: check-added-large-files
name: check-added-large-files
description: Prevent giant files from being committed.
- id: check-merge-conflict
name: check-merge-conflict
description: Check for files that contain merge conflict strings.
- id: check-symlinks
name: check-symlinks
description: Checks for symlinks which do not point to anything.
- id: check-yaml
name: check-yaml
description: Attempts to load all yaml files to verify syntax.
- id: check-toml
name: check-toml
description: Attempts to load all TOML files to verify syntax.
- id: debug-statements
name: debug-statements
description: Check for debugger imports and py37+ breakpoint() calls in python source.
- id: detect-private-key
name: detect-private-key
description: Checks for the existence of private keys.
- id: end-of-file-fixer
name: end-of-file-fixer
description: Makes sure files end in a newline and only a newline.
- id: trailing-whitespace
name: trailing-whitespace
description: Trims trailing whitespace
- id: requirements-txt-fixer
name: requirements-txt-fixer
description: Sorts entries in requirements.txt
- id: check-json
name: check-json
description: Attempts to load all json files to verify syntax.
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.9.0
hooks:
- id: mypy
name: mypy
description: Check typing
- repo: local
hooks:
- id: git_tag
name: tag git version
description: tag git version if it's outdated
pass_filenames: false
verbose: true
entry: pipenv run python tag_from_version.py
language: system
# git version check only needed if version could have changed
files: main.py
types: [ python ]
# TODO: use post-commit
stages: [ push ]
- id: tests
name: run tests
description: Run pytest
# don't run for every file, always full execution (with default filters to skip untestable files)
pass_filenames: false
entry: pipenv run python -m pytest -sv
language: system
types: [ python ]
stages: [ push ]