/
.pre-commit-config.yaml
75 lines (63 loc) · 3.03 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
# Run `pre-commit autoupdate` to update hooks to latest version
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
# Git style
- id: check-added-large-files # prevents giant files from being committed.
- id: check-vcs-permalinks # ensures that links to vcs websites are permalinks.
- id: forbid-new-submodules # prevents addition of new git submodules.
- id: no-commit-to-branch # don't commit to branch
# Common errors
- id: trailing-whitespace # trims trailing whitespace.
args: [--markdown-linebreak-ext=md]
- id: end-of-file-fixer # ensures that a file is either empty, or ends with one newline.
- id: check-merge-conflict # checks for files that contain merge conflict strings.
- id: check-executables-have-shebangs # ensures that (non-binary) executables have a shebang.
# Cross platform
- id: check-case-conflict # checks for files that would conflict in case-insensitive filesystems.
- id: mixed-line-ending # replaces or checks mixed line ending.
args: [--fix=lf]
# Security
- id: detect-aws-credentials # detects *your* aws credentials from the aws cli credentials file.
args: ["--allow-missing-credentials"]
- id: detect-private-key # detects the presence of private keys.
# Python
- id: check-ast # simply checks whether the files parse as valid python.
- id: check-builtin-literals # requires literal syntax when initializing empty or zero python builtin types.
- id: check-docstring-first # checks a common error of defining a docstring after code.
- id: debug-statements # checks for debugger imports and py37+ `breakpoint()` calls in python source.
# JSON
- id: check-json # checks json files for parseable syntax.
- id: pretty-format-json # sets a standard for formatting json files.
args: [--autofix, --no-sort-keys]
exclude: default.json
# Symlinks
- id: check-symlinks # checks for symlinks which do not point to anything.
- id: destroyed-symlinks # detects symlinks which are changed to regular files with a content of a path which that symlink was pointing to.
# XML
- id: check-xml # checks xml files for parseable syntax.
# YAML
- id: check-yaml # checks yaml files for parseable syntax.
- repo: https://gitlab.com/bmares/check-json5
rev: v1.0.0
hooks:
- id: check-json5
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
hooks:
- id: prettier
# https://prettier.io/docs/en/options.html#parser
files: 'renovate.json5$'
- repo: https://github.com/renovatebot/pre-commit-hooks
rev: 37.89.5
hooks:
- id: renovate-config-validator
files: default.template.json5
- repo: local
hooks:
- id: renovate-gha-automation
name: Prevent update manually default.json
entry: bash -c 'echo "You should edit ./default.template.json5, not ./default.json"; exit 1'
files: default.json
language: system