forked from dgunning/edgartools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
47 lines (46 loc) · 1.48 KB
/
.pre-commit-config.yaml
File metadata and controls
47 lines (46 loc) · 1.48 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
default_language_version:
python: python3
exclude: "^$"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-added-large-files
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.12.8
hooks:
- id: ruff-check
types_or: [ python, pyi, jupyter ]
args: [ --fix ]
- id: ruff-format
types_or: [ python, pyi, jupyter ]
- repo: local
hooks:
- entry: pyright
id: "pyright"
name: "pyright"
types_or: [python]
language: node
pass_filenames: true
additional_dependencies: ["pyright"]
- id: check-hardcoded-sec-urls
name: Check for hardcoded SEC URLs
entry: bash -c
args:
- |
if grep -rn --include="*.py" -E "https?://(www\.|data\.)?sec\.gov" edgar/ --exclude-dir=__pycache__ | \
grep -v "edgar/config.py" | \
grep -v "# sec.gov OK" | \
grep -v "See https://www.sec.gov" | \
grep -v "xbrl.sec.gov" | \
grep -v "e.g." | \
grep -v "e.g.," | \
grep -v "example:"; then
echo "Error: Found hardcoded SEC URLs. Use SEC_BASE_URL, SEC_DATA_URL, or URL builders from edgar.urls instead."
echo "To allow a specific URL, add comment: # sec.gov OK"
exit 1
fi
language: system
pass_filenames: false
always_run: true