-
Notifications
You must be signed in to change notification settings - Fork 1
/
.pre-commit-config.yaml
83 lines (75 loc) · 3.11 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
repos:
# Quick content checks based on grepping for python specific patterns:
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: rst-backticks # Find single rather than double backticks
- id: rst-directive-colons # Missing double-colons after directives
- id: rst-inline-touching-normal # Inline code should never touch normal text
- id: python-use-type-annotations # Use annotations not old-style type comments
# Other file formatting, plus common Git mistakes & text file standardization:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files # Don't accidentally commit giant files.
- id: check-merge-conflict # Watch for lingering merge markers.
- id: check-yaml # Validate all YAML files.
- id: check-case-conflict # Avoid case sensitivity in file names.
- id: debug-statements # Watch for lingering debugger calls.
- id: mixed-line-ending # Only newlines, no line-feeds.
args: ["--fix=lf"]
- id: trailing-whitespace # Remove trailing whitespace.
- id: name-tests-test # Follow PyTest naming convention.
########################################################################################
# Formatters: hooks that re-write Python and RST files
########################################################################################
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.4
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
types_or: [yaml]
########################################################################################
# Linters: hooks that check but don't alter Python & RST files
########################################################################################
# Check for errors in restructuredtext (.rst) files under the doc hierarchy
- repo: https://github.com/PyCQA/doc8
rev: v1.1.2
hooks:
- id: doc8
args: ["--config", "pyproject.toml"]
# Check Github Actions
- repo: https://github.com/rhysd/actionlint
rev: v1.7.5
hooks:
- id: actionlint
########################################################################################
# Custom local hooks
########################################################################################
- repo: local
hooks:
# Run the unit tests
- id: unit-tests
name: unit-tests
stages: [pre-commit]
language: system
verbose: false
pass_filenames: false
always_run: true
entry: pytest --doctest-modules src/ferc_xbrl_extractor tests/unit
# Configuration for pre-commit.ci
ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit.com hooks
For more information, see https://pre-commit.ci
autofix_prs: true
autoupdate_branch: main
autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate"
autoupdate_schedule: weekly
skip: [unit-tests]
submodules: false