forked from arthur-ai/arthur-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
129 lines (129 loc) · 5.18 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
129 lines (129 loc) · 5.18 KB
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
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude: (^genai-engine/staging.openapi.json)
- id: end-of-file-fixer
exclude: (^genai-engine/staging.openapi.json)
- id: check-yaml
exclude: (^deployment/cloudformation/|^deployment/helm/|^genai-engine/helm/|^ml-engine/helm/)
- id: debug-statements
- id: name-tests-test
args: ["--pytest-test-first"]
exclude: |
(?x)^(
genai-engine/tests/mocks|
genai-engine/tests/constants.py|
genai-engine/tests/clients|
genai-engine/tests/unit/routes/tasks/helpers.py|
ml-engine/tests/unit/connectors/helpers.py|
ml-engine/tests/unit/mock_data/mock_data_generator.py|
ml-engine/tests/unit/mock_data/api_mock_helpers.py|
ml-engine/tests/unit/mock_data/connector_helpers.py
)
- repo: https://github.com/pycqa/autoflake
rev: v2.3.1
hooks:
- id: autoflake
args:
- "--in-place"
- "--remove-all-unused-imports"
- "--recursive"
fail_fast: true
exclude: (^genai-engine/src/routers/v2/routers.py|^arthur-observability-sdk/python/src/arthur_genai_client/)
- repo: https://github.com/pycqa/isort
rev: 7.0.0
hooks:
- id: isort
name: "sort imports"
args: ["--profile", "black"]
fail_fast: true
exclude: ^arthur-observability-sdk/python/src/arthur_genai_client/
- repo: https://github.com/psf/black
rev: 25.1.0
hooks:
- id: black
language_version: python3.12
fail_fast: true
exclude: ^arthur-observability-sdk/python/src/arthur_genai_client/
- repo: https://github.com/asottile/add-trailing-comma
rev: v3.1.0
hooks:
- id: add-trailing-comma
name: "add trailing commas"
fail_fast: true
- repo: local
hooks:
- id: genai-engine-ui-lint-format
name: "genai-engine: UI ESLint fix and Prettier format"
entry: bash -c "cd genai-engine/ui && node_modules/.bin/prettier --write src/ && node_modules/.bin/eslint --fix --cache --cache-location node_modules/.cache/eslint src/"
language: system
pass_filenames: false
always_run: false
files: ^genai-engine/ui/src/.*\.(ts|tsx|js|jsx)$
- id: genai-engine-routes-security-check
name: "genai-engine: check routes security"
entry: bash -c "export GENAI_ENGINE_SECRET_STORE_KEY=changeme_secret_store_key && uv run --project genai-engine routes_security_check"
language: system
types: [python]
pass_filenames: false
always_run: false
files: ^genai-engine/src/
- id: genai-engine-pytest-check
name: "genai-engine: pytest unit tests and coverage"
entry: bash -c "export GENAI_ENGINE_SECRET_STORE_KEY=changeme_secret_store_key && uv run --directory genai-engine pytest tests/ -m \"unit_tests\" --cov=src --cov-fail-under=79"
language: system
types: [python]
pass_filenames: false
always_run: false
files: ^genai-engine/src/
- id: genai-engine-mypy-check
name: "genai-engine: mypy type checking"
entry: uv run --directory genai-engine mypy src
language: system
types: [python]
pass_filenames: false
files: ^genai-engine/src/
- id: genai-engine-api-changelog-check
name: "genai-engine: api changelog"
entry: bash -c "export GENAI_ENGINE_SECRET_STORE_KEY=changeme_secret_store_key && uv run --project genai-engine generate_changelog"
language: system
always_run: false
files: ^genai-engine/src/schemas/
- id: ml-engine-pytest-check
name: "ml-engine: pytest unit tests"
entry: uv run --directory ml-engine pytest tests/unit
language: system
types: [python]
pass_filenames: false
always_run: false
files: ^ml-engine/src/
- id: ml-engine-mypy-check
name: "ml-engine: mypy type checking"
entry: uv run --directory ml-engine mypy src/ml_engine
language: system
types: [python]
pass_filenames: false
files: ^ml-engine/src/
- id: arthur-observability-sdk-pytest-check
name: "arthur-observability-sdk: pytest unit tests"
entry: uv run --directory arthur-observability-sdk/python pytest tests -m "unit_tests"
language: system
types: [python]
pass_filenames: false
always_run: false
files: ^arthur-observability-sdk/python/src/arthur_observability_sdk/
- id: arthur-observability-sdk-mypy-check
name: "arthur-observability-sdk: mypy type checking"
entry: uv run --directory arthur-observability-sdk/python mypy src/arthur_observability_sdk
language: system
types: [python]
pass_filenames: false
files: ^arthur-observability-sdk/python/src/arthur_observability_sdk/
- id: docs-update-reminder
name: "arthur-observability-sdk: docs update reminder"
entry: bash arthur-observability-sdk/scripts/check_docs_update.sh
language: system
pass_filenames: false
verbose: true