-
Notifications
You must be signed in to change notification settings - Fork 361
/
Copy path.pre-commit-config.yaml
128 lines (113 loc) · 3.92 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
# Files
- id: check-added-large-files
description: "Prevent large files from being committed."
args: ["--maxkb=10000"]
- id: check-case-conflict
description: "Check for files that would conflict in case-insensitive filesystems."
- id: fix-byte-order-marker
description: "Remove utf-8 byte order marker."
- id: mixed-line-ending
description: "Replace mixed line ending."
# Links
- id: destroyed-symlinks
description: "Detect symlinks which are changed to regular files with a content of a path which that symlink was pointing to."
# File files for parseable syntax: python
- id: check-ast
# File and line endings
- id: end-of-file-fixer
description: "Ensure that a file is either empty, or ends with one newline."
- id: trailing-whitespace
description: "Trim trailing whitespace."
# Python
- id: check-docstring-first
description: "Check a common error of defining a docstring after code."
- id: requirements-txt-fixer
description: "Sort entries in requirements.txt."
- repo: https://github.com/MarcoGorelli/absolufy-imports
rev: v0.3.1
hooks:
- id: absolufy-imports
description: "Automatically convert relative imports to absolute. (Use `args: [--never]` to revert.)"
- repo: https://github.com/psf/black
rev: 24.10.0
hooks:
- id: black
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.1
hooks:
- id: pyupgrade
description: "Automatically upgrade syntax for newer versions."
args: [--py3-plus, --py36-plus, --py38-plus, --py39-plus, --py310-plus]
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: python-check-blanket-noqa
description: "Enforce that `noqa` annotations always occur with specific codes. Sample annotations: `# noqa: F401`, `# noqa: F401,W203`."
- id: python-check-blanket-type-ignore
description: "Enforce that `# type: ignore` annotations always occur with specific codes. Sample annotations: `# type: ignore[attr-defined]`, `# type: ignore[attr-defined, name-defined]`."
- id: python-use-type-annotations
description: "Enforce that python3.6+ type annotations are used instead of type comments."
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
description: "Sort imports alphabetically, and automatically separated into sections and by type."
- repo: https://github.com/djlint/djLint
rev: v1.36.4
hooks:
- id: djlint-reformat-jinja
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.43.0
hooks:
- id: markdownlint
description: "Lint markdown files."
args: ["--disable=line-length"]
- repo: https://github.com/terrencepreilly/darglint
rev: v1.8.1
hooks:
- id: darglint
name: darglint for source
args: [--docstring-style=numpy]
files: ^src/
- repo: https://github.com/pycqa/pylint
rev: v3.3.3
hooks:
- id: pylint
name: pylint for source
files: ^src/
additional_dependencies:
[
click,
fastapi-analytics,
pytest-asyncio,
python-dotenv,
slowapi,
starlette,
tiktoken,
uvicorn,
]
- id: pylint
name: pylint for tests
files: ^tests/
args:
- --rcfile=tests/.pylintrc
additional_dependencies:
[
click,
fastapi-analytics,
pytest,
pytest-asyncio,
python-dotenv,
slowapi,
starlette,
tiktoken,
uvicorn,
]
- repo: meta
hooks:
- id: check-hooks-apply
- id: check-useless-excludes