-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
77 lines (77 loc) · 2.79 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
77 lines (77 loc) · 2.79 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
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-yaml
exclude: 'construct.yaml'
- id: check-json
- id: end-of-file-fixer
exclude_types: [css, markdown, text, svg]
- id: trailing-whitespace
exclude_types: [html, markdown, text]
- id: check-merge-conflict
- id: detect-private-key
- repo: local
hooks:
- id: ruff-format
name: ruff format
entry: ruff format --force-exclude
language: system
types_or: [python, pyi]
files: '^(openbb_platform/|cli/)'
exclude: '^openbb_platform/(tests|extensions/tests|providers/tests|core/openbb/package)/'
- id: ruff-check
name: ruff check
entry: ruff check --force-exclude
language: system
types_or: [python, pyi]
files: '^(openbb_platform/|cli/)'
exclude: '^openbb_platform/(tests|extensions/tests|providers/tests|core/openbb/package)/'
- id: ty
name: ty check (per package root)
entry: .github/scripts/ty_per_package.sh
language: script
types_or: [python, pyi]
files: '^(openbb_platform/|cli/).*\.pyi?$'
exclude: '(^|/)(tests|integration)/|(^|/)test_[^/]*\.py$|^openbb_platform/core/openbb/package/'
- id: codespell
name: codespell
entry: bash -c 'codespell --ignore-words=.codespell.ignore --skip="$(tr "\n" "," < .codespell.skip | sed "s/,$//")" --quiet-level=2 "${@/#/./}"' --
language: system
types: [text]
- id: check-generated-files
name: Check for generated files
entry: bash
args:
- -c
- |
if git ls-files | grep "^openbb_platform/core/openbb/package/" | grep -v "^openbb_platform/core/openbb/package/__init__\.py$"; then
echo "Error: Attempting to commit generated files in package directory. Only __init__.py should exist."
exit 1
fi
language: system
pass_filenames: false
always_run: true
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.26.0
hooks:
- id: markdownlint
files: '^([^/]+|changelogs/[^/]+|openbb_platform/.+)\.md$'
exclude: '^openbb_platform/extensions/mcp_server/openbb_mcp_server/skills/|^openbb_platform/providers/sec/openbb_sec/utils/STATEMENT_SCHEMA_README\.md$'
- repo: https://github.com/kynan/nbstripout
rev: 0.8.1
hooks:
- id: nbstripout
name: Strip notebooks output
- repo: https://github.com/Yelp/detect-secrets
rev: v1.5.0
hooks:
- id: detect-secrets
args:
[
"--baseline",
".secrets.baseline",
"--exclude-files",
"cassettes/.*|record/.*",
]
exclude: package.lock.json