-
Notifications
You must be signed in to change notification settings - Fork 32
/
.pre-commit-config.yaml
64 lines (64 loc) · 1.98 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
repos:
- repo: local
hooks:
- id: generate
name: Generate
language: node
entry: bash -c "./generate.sh"
files: '^(\.generator/.*|\.pre-commit-config\.yaml|\.prettierrc\.yml|Makefile|src/test/resources/com/datadog/api/v*/client/api/.*|src/main/.*)'
pass_filenames: false
- id: docs
name: Format documentation
stages: [manual]
language: node
language_version: 20.5.0
entry: prettier --write --list-different --ignore-unknown README.md
"types": [text]
files: 'README.md'
pass_filenames: false
additional_dependencies:
# When updating the version of prettier, make sure to check the pre-commit file
# And keep the `entry` here up to date https://github.com/pre-commit/mirrors-prettier/blob/master/.pre-commit-hooks.yaml
- id: generator
name: generator
language: python
entry: bash -c "cd .generator && poetry install && poetry run python -m generator ./schemas/v1/openapi.yaml ./schemas/v2/openapi.yaml -o ../src/main/java/com/datadog/api/client"
files: "^.generator/(config|schemas/v1|src|poetry.lock|pyproject.toml)"
stages: [manual]
pass_filenames: false
additional_dependencies:
- "poetry"
- id: lint
name: Format generated code
stages: [manual]
language: script
entry: ./format.sh
files: '^src/'
types: [file, java]
pass_filenames: false
args: ['src/']
- id: lint-examples
name: Format examples
stages: [manual]
language: script
entry: ./format.sh
files: '^examples/'
types: [file, java]
pass_filenames: false
args: ['examples/']
- id: java-format
name: Format non-generated code
language: script
entry: ./format.sh
files: '^src/test/'
types: [file, java]
- id: examples
name: examples
language: python
entry: bash -c "cd .generator && poetry install && poetry run pytest"
files: "^.generator/"
stages: [manual]
pass_filenames: false
additional_dependencies:
- "poetry"