-
Notifications
You must be signed in to change notification settings - Fork 41
/
.pre-commit-config.yaml
58 lines (57 loc) · 2 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
repos:
- repo: local
hooks:
- id: generate
name: Generate
language: system
entry: bash -c "./generate.sh"
files: '^(\.generator/.*|\.pre-commit-config\.yaml|Makefile|\tests/v*/features/.*|src/.*)'
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: api-docs
name: Generate API docs
stages: [manual]
language: python
entry: bash -c "SPHINX_APIDOC_OPTIONS=members,show-inheritance sphinx-apidoc --output-dir docs --force --no-toc --templatedir docs/_templates src/datadog_api_client *apis *models *version.py"
pass_filenames: false
additional_dependencies:
- Sphinx
- 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/"
files: "^.generator/(config|schemas/v1|src|poetry.lock|pyproject.toml)"
stages: [manual]
pass_filenames: false
additional_dependencies:
- "poetry"
- 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"
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.4
hooks:
- id: ruff
entry: ruff --fix --quiet --exit-zero --fixable I001,F401 --ignore E501 src examples tests
pass_filenames: false
- id: ruff-format
entry: ruff format src examples tests
pass_filenames: false