forked from OpenLineage/OpenLineage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
109 lines (109 loc) · 4.03 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
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=*.js,*.svg,*.xml,*/**/test/*,*/**/tests/*
- 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: pmd
name: pmd
description: "Runs the PMD static code analyzer."
language: docker_image
entry: -v ./.pmd_cache:/opt/.pmd_cache --entrypoint .pre_commit/run-pmd.sh cimg/openjdk:8.0
files: ^client/java/src/.*\.java$
exclude: ".*test.*"
require_serial: true