forked from OpenLineage/OpenLineage
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
199 lines (199 loc) · 7.78 KB
/
.pre-commit-config.yaml
File metadata and controls
199 lines (199 loc) · 7.78 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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
repos:
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: insert-license
name: Add license for all Python files
files: \.py$|\.pyi$|\.sh$
args:
- --comment-style
- "#"
- --license-filepath
- LICENSE.insert.txt
- --fuzzy-match-generates-todo
- --use-current-year
- id: insert-license
name: Add license for all Java files
files: \.java$|\.groovy$|\.gradle$
args:
- --comment-style
- "/*|/*|*/"
- --license-filepath
- LICENSE.insert.txt
- --fuzzy-match-generates-todo
- --use-current-year
- id: insert-license
name: Add license for all Scala files
files: \.kt$|\.scala$
args:
- --comment-style
- "/** | *| */"
- --license-filepath
- LICENSE.insert.txt
- --fuzzy-match-generates-todo
- --use-current-year
- id: insert-license
name: Add license for all Rust files
files: \.rs$
args:
- --comment-style
- "//"
- --license-filepath
- LICENSE.insert.txt
- --fuzzy-match-generates-todo
- --use-current-year
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-ast
files: ^client/python/
- id: check-builtin-literals
files: ^client/python/
- id: check-merge-conflict
files: ^client/python/
- id: check-toml
files: ^client/python/
- id: debug-statements
files: ^client/python/
- id: end-of-file-fixer
files: ^client/python/
- id: trailing-whitespace
files: ^client/python/
exclude: ^.*\.cfg$
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.2
hooks:
- id: ruff
name: ruff-lint
args: [--fix]
files: ^client/python/|^dev/|^integration/airflow/|^integration/common/|^integration/dagster/|^integration/dbt/|^integration/spark/|^integration/sql/
- id: ruff-format
name: ruff-format
files: ^client/python/|^dev/|^integration/airflow/|^integration/common/|^integration/dagster/|^integration/dbt/|^integration/spark/|^integration/sql/
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
name: Run codespell to check for common misspellings in files
entry:
bash -c 'echo "If you think that this failure is an error, consider adding the word(s) to the codespell
dictionary at spelling_wordlist.txt. The word(s) should be in lowercase." && exec codespell "$@"' --
language: python
types: [text]
args:
- --ignore-words=spelling_wordlist.txt
- --skip=*.css,*.js,*.svg,*.xml,*/**/test/*,*/**/tests/*,*/yarn.lock,**/openapi/*.html,*/package-lock.json,*/spec/*
- repo: https://github.com/koalaman/shellcheck-precommit
rev: v0.10.0
hooks:
- id: shellcheck
args: ["--exclude=1090,1091,2207"]
exclude: ".*gradlew$"
- repo: local
hooks:
- id: check-version-files
name: Check version file paths in new-version.sh
description: "Verifies that file paths in new-version.sh exist and are only defined in that file"
language: script
entry: .pre_commit/check_version_update_path.sh
files: new-version\.sh$|\.gradle$|gradle\.properties$|README\.md$|version\.properties$
pass_filenames: false
- id: forbid-attr-s
name: Check for @attr.s
description: "Checks if @attr.s is used instead of desired @attr.define"
language: pygrep
entry: "@(attr\\.s|s)(\\s|\\n|\\()"
files: "\\.(py|md)$"
# Exclude tests directories and deprecated modules that can use @attr.s
exclude: |
(?x)^(
.*tests.* |
client/python/openlineage/client/facet\.py |
client/python/openlineage/client/run\.py
)$
- id: prettier
name: prettier
description: ""
entry: prettier --write --ignore-unknown
files: ^spec/|\.ts$|\.tsx$|^website.*\.js$|^website.*\.jsx$|\.css$|^\..*\.yaml$|\^\..*\.yml$|^integration/.*\.json$
exclude: run_results\.json|manifest\.json|catalog\.json|metadata/.*\.json|bigquery/.*\.json|data/great_expectations/|integration/airflow/tests/extractors/|test_data/serde/
args: ["--print-width=120", "--prose-wrap=always"]
language: node
types: [text]
require_serial: false
additional_dependencies: ["[email protected]"]
- id: check_schemas
name: Check JSON Schema spec files.
language: golang
additional_dependencies: ["github.com/santhosh-tekuri/jsonschema/cmd/jv@latest"]
entry: ./.pre_commit/json-schema/check-spec.sh
files: ^spec/.*\.json$
exclude: ^spec/tests/.*$
- id: test_events
name: Test events against JSON Schema spec files.
language: golang
additional_dependencies: ["github.com/santhosh-tekuri/jsonschema/cmd/jv@latest"]
entry: ./.pre_commit/json-schema/test-facets.sh
files: ^spec/facets/.*\.json$
- id: generate_facets
name: Generate OpenLineage facets for Python client.
language: python
entry: python ./client/python/openlineage/client/generator/generate.py
files: ^spec/.*\.json$|^client/python/facets\.py$
exclude: ^spec/tests/.*$
pass_filenames: false
additional_dependencies: ["ruff==0.3.5", "click", "datamodel-code-generator==0.25.4"]
- id: check_facets_redactions
name: Check if all Facets have redacted fields defined
language: python
additional_dependencies: ["pyyaml"]
entry: python ./.pre_commit/check-redactions.py
always_run: true
pass_filenames: false
- id: spec-changes
name: Verify spec changes committed to website
language: script
files: ^spec/
exclude: ".*tests.*"
entry: .pre_commit/run-spec-snapshot.sh
pass_filenames: false
- id: pmd-client-java
name: pmd-client-java
description: "Runs the PMD static code analyzer - Java client."
language: script
entry: .pre_commit/run-pmd.sh --java-version 17 --ruleset-file client/java/pmd-openlineage.xml
files: ^client/java/src/.*\.java$
exclude: ".*test.*"
require_serial: true
- id: pmd-flink
name: pmd-flink
description: "Runs the PMD static code analyzer - Flink"
language: script
entry: .pre_commit/run-pmd.sh --java-version 17 --ruleset-file integration/flink/pmd-openlineage.xml
files: ^integration/flink/.*\.java$
exclude: ".*test.*"
require_serial: true
- id: pmd-spark
name: pmd-spark
description: "Runs the PMD static code analyzer - Spark."
language: script
entry: .pre_commit/run-pmd.sh --java-version 17 --ruleset-file integration/spark/pmd-openlineage.xml
files: ^integration/flink/.*\.java$
exclude: ".*test.*"
require_serial: true
- id: spotless-client-java
name: spotless-client-java
description: "Runs the Spotless formatter - Java client."
language: system
entry: .pre_commit/run-spotless.sh --java-version 17 --location client/java
files: ^client/java/src/.*\.java$
exclude: ".*test.*"
pass_filenames: false
- id: spotless-integration-spark
name: spotless-integration-spark
description: "Runs the Spotless formatter - Spark."
language: system
entry: .pre_commit/run-spotless.sh --java-version 17 --location integration/spark
files: ^integration/spark/.*\.java$
exclude: ".*test.*"
pass_filenames: false