-
Notifications
You must be signed in to change notification settings - Fork 4.2k
/
.pre-commit-config.yaml
59 lines (51 loc) · 1.85 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
exclude: |
(?x)(
# Python/system files
^.*/__init__\.py$|
^.*?/\.venv/.*$|
^.*?/node_modules/.*$|
^.*?/charts/.*$|
^airbyte-integrations/bases/base-normalization/.*$|
^.*?/normalization_test_output/.*$|
^.*?/pnpm-lock\.yaml$|
^.*?/source-amplitude/unit_tests/api_data/zipped\.json$|
# Generated/test files
^airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/.*$|
^.*?/airbyte-ci/connectors/metadata_service/lib/tests/fixtures/.*/invalid/.*$|
^airbyte-ci/connectors/metadata_service/lib/tests/fixtures/.*/invalid/.*$|
^.*?/airbyte-ci/connectors/pipelines/tests/test_format/non_formatted_code/.*$|
^airbyte-ci/connectors/pipelines/tests/test_format/non_formatted_code/.*$|
^.*?/airbyte-integrations/connectors/destination-.*/expected-spec\.json$
)
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.3
hooks:
# Run the linter.
- id: ruff
args:
- --fix
- --select=I
# Run the formatter.
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.3
hooks:
- id: prettier
types_or: [json, yaml]
additional_dependencies:
- prettier@3.0.3
- repo: local
hooks:
- id: addlicense
name: Add license headers
entry: addlicense -c "Airbyte, Inc." -l apache -v -f LICENSE_SHORT
language: golang
additional_dependencies: [github.com/google/addlicense@v1.1.1]
files: \.(java|kt|py)$
- id: spotless
name: Format Java files with Spotless
entry: bash -c 'command -v mvn >/dev/null 2>&1 || { echo "Maven not installed, skipping spotless" >&2; exit 0; }; mvn -f spotless-maven-pom.xml spotless:apply'
language: system
files: \.(java|kt|gradle)$
pass_filenames: false