-
Notifications
You must be signed in to change notification settings - Fork 219
/
Copy path.pre-commit-config.yaml
114 lines (111 loc) · 3.3 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
110
111
112
113
114
default_language_version:
python: python3
exclude: 'dotnet'
ci:
autofix_prs: true
autoupdate_commit_msg: '[pre-commit.ci] pre-commit suggestions'
autoupdate_schedule: 'monthly'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-yaml
- id: check-toml
- id: check-json
exclude: |
(?x)^(
.devcontainer/.*devcontainer\.json |
^notebook/agentchat_pdf_rag/(parsed_elements|processed_elements)\.json$
)$
- id: check-byte-order-marker
exclude: .gitignore
- id: check-merge-conflict
- id: detect-private-key
- id: trailing-whitespace
- id: end-of-file-fixer
- id: no-commit-to-branch
- repo: local
hooks:
- id: build-setup-scripts
name: build setup scripts
entry: "scripts/pre-commit-build-setup-files.sh"
language: python
# language_version: python3.9
types: [python]
require_serial: true
verbose: true
additional_dependencies: ['jinja2', 'toml', 'ruff']
- repo: local
hooks:
- id: lint
name: linting and formatting
entry: "scripts/pre-commit-lint.sh"
language: python
# language_version: python3.9
types: [python]
require_serial: true
verbose: true
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
additional_dependencies:
- tomli
# args: ["-L", "ans,linar,nam,tread,ot,assertIn,dependin,socio-economic,Regio"]
# ./notebook,./website/node_modules,./website/notebooks
exclude: |
(?x)^(
# notebook/.* |
notebook/agentchat_lmm_gpt-4v.ipynb |
notebook/agentchat_graph_rag_neo4j.ipynb |
notebook/agentchat_swarm_graphrag_telemetry_trip_planner.ipynb |
website/node_modules/.* |
website/notebooks/.*
)$
# See https://jaredkhan.com/blog/mypy-pre-commit
- repo: local
hooks:
- id: mypy
name: mypy
entry: "./scripts/pre-commit-mypy-run.sh"
language: python
# use your preferred Python version
# language_version: python3.9
additional_dependencies: []
types: [python]
# use require_serial so that script
# is only called once per commit
require_serial: true
# Print the number of files as a sanity-check
verbose: true
- id: check-license-headers
name: check license headers
entry: python ./scripts/pre-commit-license-check.py
language: python
types: [python]
exclude: |
(?x)^(
notebook/.* |
website/.*
)$
- repo: https://github.com/Yelp/detect-secrets
rev: v1.5.0
hooks:
- id: detect-secrets
args: ["--baseline", ".secrets.baseline"]
exclude: |
(?x)^(
package.lock.json
)$
- repo: local
hooks:
- id: generate-devcontainer-files
name: Generate devcontainer files
entry: "scripts/devcontainer/generate-devcontainers.sh"
language: python
require_serial: true
verbose: true
additional_dependencies: ['jinja2']
files: ^(scripts/devcontainer/.*)$