forked from OpenLineage/OpenLineage
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.pre-commit-config.yaml
147 lines (146 loc) · 5.61 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
repos:
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.4
hooks:
- id: insert-license
name: Add license for all Python files
files: \.py$|\.pyi$
args:
- --comment-style
- "#"
- --license-filepath
- .pre_commit/license-python.txt
- --fuzzy-match-generates-todo
- --use-current-year
- id: insert-license
name: Add license for all Java files
files: \.java$
args:
- --comment-style
- ""
- --license-filepath
- .pre_commit/license-java.txt
- --fuzzy-match-generates-todo
- --use-current-year
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.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/pre-commit/mirrors-prettier
rev: "v2.7.1"
hooks:
- id: prettier
files: ^spec/
args: ["--print-width=120", "--prose-wrap=always"]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.5
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: local
hooks:
- 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 ./.pre_commit/generate-facets/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/
entry: .pre_commit/run-spec-snapshot.sh
- 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."
language: system
entry: bash -c "cd client/java && ./gradlew spotlessApply"
files: ^client/java/src/.*\.java$
exclude: ".*test.*"
pass_filenames: false
- id: spotless-integration-spark
name: spotless-integration-spark
description: "Runs the Spotless formatter for Spark."
language: system
entry: bash -c "cd integration/spark && ./gradlew spotlessApply"
files: ^integration/spark/.*\.java$
exclude: ".*test.*"
pass_filenames: false