-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
85 lines (72 loc) · 3.27 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
# Run `pre-commit autoupdate` to update hooks to latest version
repos:
- repo: local
hooks:
- id: yq_yaml_prettier
name: Alphabetize YAML arrays
description: |
Use the full power of YQ to do what you want, by default - alphabetize YAML arrays
For more info check - scripts/pre-commit-hooks/hooks/README.md
language: script
entry: hooks/yq_yaml_prettier.sh
files: \.ya?ml$
exclude: |
(?x)
# Try to sort consecutive steps
(^.github/workflows
|^.pre-commit-config.yaml
)
- 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]
# 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://github.com/syntaqx/git-hooks
rev: v0.0.18
hooks:
- id: shfmt
args: ["-l", "-i", "2", "-ci", "-sr", "-w"]
- id: shellcheck
name: "shellcheck: check regular scripts"
args:
- --source-path=SCRIPTDIR
- --external-sources
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
hooks:
- id: prettier
# https://prettier.io/docs/en/options.html#parser
files: '.json5$'