-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
170 lines (169 loc) · 6.73 KB
/
.pre-commit-config.yaml
File metadata and controls
170 lines (169 loc) · 6.73 KB
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
---
default_stages: [pre-commit, pre-push]
default_language_version:
# force all unspecified Python hooks to run python3
python: python3
minimum_pre_commit_version: "3.2.0"
repos:
- repo: meta
hooks:
- id: identity
description: A simple hook which prints all arguments passed to it, useful for debugging
- id: check-hooks-apply
description: Useful when testing new hooks to see if they apply to the repository
- repo: local
hooks:
- id: check-zip-file-is-not-committed
name: Check no Zip files are committed
description: Zip files are not allowed in the repository
language: fail
entry: |
Zip files are not allowed in the repository as they are hard to
track and have security implications. Please remove the zip file from the repository
files: (?i)\.zip$
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.6
hooks:
- id: chmod
name: set file permissions
description: manual hook to be run by macOS or Linux users for a full repository clean up
args: ['644']
files: \.md$
stages: [manual]
- repo: https://github.com/codespell-project/codespell
rev: v2.4.2
hooks:
- id: codespell
name: run codespell
description: Check spelling with codespell
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-case-conflict
description: Check for files with names that would conflict on a case-insensitive filesystem like MacOS HFS+ or Windows FAT
- id: check-executables-have-shebangs
description: Checks that non-binary executables have a proper shebang
- id: check-illegal-windows-names
description: Check for files that cannot be created on Windows
- id: check-json
description: Attempts to load all json files to verify syntax
- id: check-merge-conflict
description: Check for files that contain merge conflict strings
- id: check-shebang-scripts-are-executable
description: Checks that scripts with shebangs are executable
- id: check-vcs-permalinks
description: Ensures that links to vcs websites are permalinks
- id: check-xml
description: Attempts to load all xml files to verify syntax
- id: check-yaml
description: Attempts to load all yaml files to verify syntax
- id: destroyed-symlinks
description: Detects symlinks which are changed to regular files with a content of a path which that symlink was pointing to
- id: detect-aws-credentials
description: Checks for the existence of AWS secrets that you have set up with the AWS CLI
args: [--allow-missing-credentials]
- id: detect-private-key
description: Checks for the existence of private keys
- id: end-of-file-fixer
description: Makes sure files end in a newline and only a newline
- id: file-contents-sorter
description: sort the lines in specified files (defaults to alphabetical)
args: [--unique]
files: ^\.github/linters/codespell\.txt$
- id: fix-byte-order-marker
description: removes UTF-8 byte order marker
- id: forbid-submodules
description: Forbids any submodules in the repository
- id: mixed-line-ending
description: replaces or checks mixed line ending
- id: pretty-format-json
description: checks that all your JSON files are pretty
args: [--autofix, --no-sort-keys]
- id: trailing-whitespace
description: Trims trailing whitespace
args: [--markdown-linebreak-ext=md]
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.48.0
hooks:
- id: markdownlint
name: run markdownlint
description: check Markdown files with markdownlint
args: [--config=.github/linters/.markdown-lint.yml]
exclude: ^\.github/.*$
types: [markdown]
files: \.md$
- repo: https://github.com/adrienverge/yamllint
rev: v1.38.0
hooks:
- id: yamllint
name: run yamllint
description: check YAML files with yamllint
args: [--strict, -c=.github/linters/.yaml-lint.yml]
types: [yaml]
files: \.ya?ml$
- repo: https://github.com/gitleaks/gitleaks
rev: v8.30.1
hooks:
- id: gitleaks
name: run gitleaks
description: check for secrets with gitleaks
- repo: https://github.com/zizmorcore/zizmor-pre-commit
rev: v1.23.1
hooks:
- id: zizmor
name: run zizmor
description: zizmor is a static analysis tool for GitHub Actions
# args: [--config=.github/linters/zizmor.yml]
files: ^\.github/workflows/.*$
types: [yaml]
- repo: https://github.com/rhysd/actionlint
rev: v1.7.12
hooks:
- id: actionlint
name: run actionlint
description: actionlint is a static checker for GitHub Actions workflow files
- repo: https://github.com/tcort/markdown-link-check
rev: v3.14.2
hooks:
- id: markdown-link-check
name: run markdown-link-check
description: checks all of the hyperlinks in a Markdown text to determine if they are alive or dead
args: [--config=.github/linters/mlc_config.json, -q]
types: [markdown]
files: \.md$
- repo: https://github.com/oxipng/oxipng
rev: v10.1.0
hooks:
- id: oxipng
name: run oxipng
description: check PNG files with oxipng
args: ['--fix', '-o', '4', '--strip', 'safe', '--alpha']
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.11.0.1
hooks:
- id: shellcheck
name: run shellcheck
description: check Shell scripts with shellcheck
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: 3.6.1
hooks:
- id: editorconfig-checker
name: run editorconfig-checker
description: a tool to verify that your files are in harmony with your .editorconfig
alias: ec