-
Notifications
You must be signed in to change notification settings - Fork 1
/
.pre-commit-config.yaml
159 lines (159 loc) · 4.65 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
---
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
# - Added pkgs feature flag auto generated code to flake8 exclude list
# Force all unspecified python hooks to run python 3.10
default_language_version:
python: python3.9
default_stages:
- commit
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
# TODO: Exclude tests/test_data directory
exclude: ^tests/test_data/
exclude_types:
- "markdown"
- id: end-of-file-fixer
exclude: "tests/test_data/.*"
- id: check-yaml
args: [--unsafe]
- id: check-added-large-files
args: ["--maxkb=10240"]
- id: check-case-conflict
- id: check-docstring-first
- id: check-ast
- id: check-json
exclude: ".vscode/launch.json"
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: check-toml
- id: debug-statements
- id: detect-private-key
- id: check-merge-conflict
- id: check-symlinks
- id: destroyed-symlinks
- id: forbid-new-submodules
- id: mixed-line-ending
- id: no-commit-to-branch
- repo: https://github.com/adrienverge/yamllint
rev: v1.35.1
hooks:
- id: yamllint
args: ["-d", "relaxed"]
language: system
- repo: https://github.com/rhysd/actionlint
rev: v1.6.26
hooks:
- id: actionlint-docker
args: [-ignore, 'label ".+" is unknown']
- repo: https://github.com/psf/black
rev: 24.2.0
hooks:
- id: black
args: [--config=pyproject.toml, -l 120]
language: system
exclude: |
(?x)^(
pkgs/unstract-flags/src/unstract/flags/evaluation_.*\.py|
)$
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
hooks:
- id: flake8
args: [--max-line-length=120]
exclude: |
(?x)^(
tests/test_data/.*|
)$
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
files: "\\.(py)$"
args:
[
"--profile",
"black",
"--filter-files",
--settings-path=pyproject.toml,
]
- repo: https://github.com/hadialqattan/pycln
rev: v2.4.0
hooks:
- id: pycln
args: [--config=pyproject.toml]
- repo: https://github.com/pycqa/docformatter
rev: v1.7.5
hooks:
- id: docformatter
# - repo: https://github.com/MarcoGorelli/absolufy-imports
# rev: v0.3.1
# hooks:
# - id: absolufy-imports
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade
entry: pyupgrade --py39-plus --keep-runtime-typing
types:
- python
- repo: https://github.com/gitleaks/gitleaks
rev: v8.18.2
hooks:
- id: gitleaks
- repo: https://github.com/asottile/yesqa
rev: v1.5.0
hooks:
- id: yesqa
# TODO: Uncomment after typing the SDK
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v1.8.0
# hooks:
# - id: mypy
# language: system
# entry: mypy .
# pass_filenames: false
# # IMPORTANT!
# # Keep args same as tool.mypy section in pyproject.toml
# args:
# [
# --allow-subclassing-any,
# --allow-untyped-decorators,
# --check-untyped-defs,
# --exclude, ".*migrations/.*.py",
# --exclude, "backend/prompt/.*",
# --exclude, "document_display_service/.*",
# --exclude, "pkgs/unstract-connectors/tests/.*",
# --exclude, "pkgs/unstract-core/.*",
# --exclude, "pkgs/unstract-flags/src/unstract/flags/.*",
# --exclude, "sdks/.*",
# --exclude, "unstract-document-service/.*",
# --exclude, "__pypackages__/.*",
# --follow-imports, "silent",
# --ignore-missing-imports,
# --implicit-reexport,
# --pretty,
# --python-version=3.9,
# --show-column-numbers,
# --show-error-codes,
# --strict,
# --warn-redundant-casts,
# --warn-return-any,
# --warn-unreachable,
# --warn-unused-configs,
# --warn-unused-ignores,
# ]
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.39.0
hooks:
- id: markdownlint
args: [--disable, MD013]
- id: markdownlint-fix
args: [--disable, MD013]
- repo: https://github.com/pdm-project/pdm
rev: 2.12.3
hooks:
- id: pdm-lock-check