-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
122 lines (114 loc) · 3.9 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
121
122
# Python oriented pre-commit
#
# Note that the check-yaml argument does not work
#
# so only single document in a yaml file is allowed
# tried dockerfilelint but too strict and disabling does not work
---
# python regex syntax for inclusion
# https://www.w3schools.com/python/python_regex.asp
# So this means only look at python files
#files: ".py$"
# This is only for python and other files
# This means exclude directories ./typescript
#exclude: "typescript|golang"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-json
# do not run this since we do include.sh from elsewhere
#- id: check-symlinks
- id: check-merge-conflict
- id: check-toml
- id: check-xml
- id: check-yaml
args: [--allow-multiple-documents]
- id: destroyed-symlinks
# https://github.com/pre-commit/pre-commit-hooks/blob/master/pre_commit_hooks/detect_aws_credentials.py
- id: detect-aws-credentials
args: [--allow-missing-credentials]
- id: detect-private-key
- id: end-of-file-fixer
- id: forbid-new-submodules
- id: mixed-line-ending
- id: name-tests-test
- id: no-commit-to-branch
- id: pretty-format-json
args: [--autofix]
- id: requirements-txt-fixer
- id: trailing-whitespace
- repo: https://github.com/jumanjihouse/pre-commit-hooks
# temp fix for pre-commit breakage in shellcheck
# https://github.com/jumanjihouse/pre-commit-hooks/issues/82
rev: 2.1.5
hooks:
# as of Feb 2020, error with ruby 3.0
# https://github.com/jumanjihouse/pre-commit-hooks/issues/86
#- id: markdownlint
- id: shellcheck
- id: shfmt
# switch from using mdl to markdown-cli because it handles disabling
# checks on a per line basis rather than per project with .mdlrc
#- repo: local
# hooks:
# # https://github.com/markdownlint/markdownlint/blob/master/.pre-commit-hooks.yaml
# - id: markdownlintlocal
# name: Markdownlint Local
# description: Run Markdownlint locally
# entry: mdl
# language: ruby
#files: \.(md|mdown|markdown)$
# https://github.com/igorshubovych/markdownlint-cli
# node version of markdownlint with better disabling of checks
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.29.0
hooks:
- id: markdownlint
# https://ljvmiranda921.github.io/notebook/2018/06/21/precommits-using-black-and-flake8/
# https://github.com/pre-commit/mirrors-mypy
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v0.910-1'
hooks:
- id: mypy
- repo: https://github.com/pycqa/flake8
rev: 4.0.1
hooks:
- id: flake8
- repo: https://github.com/pycqa/pydocstyle
rev: 6.1.1
hooks:
- id: pydocstyle
# puts the isort.cfg at the root we do not want that
# https://pypi.org/project/seed-isort-config/
# - repo: https://github.com/asottile/seed-isort-config
# rev: v2.2.0
# hooks:
# # remember this will place things at the root of the repo
# # but running in lint locally places it in the current directory
# - id: seed-isort-config
# does not respect the local arguments
# - repo: https://github.com/timothycrosley/isort
# rev: 5.2.0
# hooks:
# - id: isort
# args: [--profile=black, -w 79]
# https://ljvmiranda921.github.io/notebook/2018/06/21/precommits-using-black-and-flake8/
- repo: https://github.com/psf/black
rev: 21.9b0
hooks:
- id: black
language_version: python3.9
args: [-l 79]
# check shell scripts you check in
- repo: git://github.com/detailyang/pre-commit-shell
rev: 1.0.5
hooks:
- id: shell-lint
args: [--format=json]