-
Notifications
You must be signed in to change notification settings - Fork 695
/
.pre-commit-config.yaml
186 lines (185 loc) · 6.38 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
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# 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.
---
# https://pre-commit.com/#installation
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
name: run identity check
- id: check-hooks-apply
name: run check hooks apply
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: insert-license
name: add license for all Markdown files
files: \.md$
args:
- --comment-style
- "<!--|| -->"
- --license-filepath
- .github/workflows/license-templates/LICENSE.txt
- --fuzzy-match-generates-todo
exclude: ^docs/index\.md$|^\.github/pull_request_template\.md$|\.github/issue_template\.md$
- id: insert-license
name: add license for all Makefile files
files: ^Makefile$
args:
- --comment-style
- "|#|"
- --license-filepath
- .github/workflows/license-templates/LICENSE.txt
- --fuzzy-match-generates-todo
- id: insert-license
name: add license for all TOML files
files: \.toml$
args:
- --comment-style
- "|#|"
- --license-filepath
- .github/workflows/license-templates/LICENSE.txt
- --fuzzy-match-generates-todo
- id: insert-license
name: add license for all YAML files
files: \.ya?ml$
args:
- --comment-style
- "|#|"
- --license-filepath
- .github/workflows/license-templates/LICENSE.txt
- --fuzzy-match-generates-todo
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.10.0
hooks:
- id: black-jupyter
name: run black-jupyter
description: format Python files and Jupyter Notebooks with black
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v19.1.4
hooks:
- id: clang-format
name: run clang-format
description: format C files with clang-format
args: [--style=Google]
types_or: [c]
- repo: https://github.com/PyCQA/bandit
rev: 1.7.10
hooks:
- id: bandit
name: run bandit
description: check Python code for security issues
args: ["-c=pyproject.toml", "-r"]
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
name: run codespell
description: check spelling with codespell
args: [--ignore-words=.github/linters/codespell.txt]
exclude: ^docs/image|^spark/common/src/test/resources|^docs/usecases|^tools/maven/scalafmt
- repo: https://github.com/gitleaks/gitleaks
rev: v8.21.2
hooks:
- id: gitleaks
name: run gitleaks
description: check for secrets with gitleaks
- repo: https://github.com/shssoichiro/oxipng
rev: v9.1.2
hooks:
- id: oxipng
name: run oxipng
description: check PNG files with oxipng
args: ["-o", "4", "--strip", "safe", "--alpha"]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-ast
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-illegal-windows-names
# - id: check-json
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-toml
- id: check-vcs-permalinks
- id: check-xml
- id: check-yaml
exclude: ^mkdocs\.yml$
- id: debug-statements
- id: destroyed-symlinks
- id: detect-aws-credentials
args: [--allow-missing-credentials]
- id: detect-private-key
- id: end-of-file-fixer
exclude: \.svg$|^docs/image|^spark/common/src/test/resources
- id: file-contents-sorter
args: [--unique]
files: ^\.github/linters/codespell\.txt$
- id: fix-byte-order-marker
- id: forbid-submodules
- id: mixed-line-ending
exclude: \.csv$
- id: name-tests-test
args: [--pytest-test-first]
exclude: |
(?x)^(
python/tests/properties/crs_transform\.py|
python/tests/properties/linestring_properties\.py|
python/tests/properties/point_properties\.py|
python/tests/properties/polygon_properties\.py|
python/tests/sql/resource/sample_data\.py|
python/tests/streaming/spark/cases_builder\.py|
python/tests/tools\.py
)$
- id: requirements-txt-fixer
files: ^docker/sedona-spark-jupyterlab/requirements\.txt$
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
exclude: ^docs-overrides/main\.html$|\.Rd$
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.43.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|mdown|markdown)$
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
name: run shellcheck
description: check Shell scripts with shellcheck
- repo: https://github.com/adrienverge/yamllint
rev: v1.35.1
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$