1
- ---
2
- # See https://pre-commit.com for more information
3
- # See https://pre-commit.com/hooks.html for more hooks
4
- # - Added pkgs feature flag auto generated code to flake8 exclude list
5
- # Force all unspecified python hooks to run python 3.10
6
1
default_language_version :
7
- python : python3.9
2
+ python : python3.12
8
3
default_stages :
9
- - commit
4
+ - pre- commit
10
5
repos :
11
6
- repo : https://github.com/pre-commit/pre-commit-hooks
12
- rev : v4.5 .0
7
+ rev : v5.0 .0
13
8
hooks :
14
9
- id : trailing-whitespace
15
- # TODO: Exclude tests/test_data directory
16
- exclude : ^tests/test_data/
17
10
exclude_types :
18
11
- " markdown"
19
12
- id : end-of-file-fixer
20
- exclude : " tests/test_data/.*"
21
13
- id : check-yaml
22
14
args : [--unsafe]
23
15
- id : check-added-large-files
@@ -37,123 +29,58 @@ repos:
37
29
- id : destroyed-symlinks
38
30
- id : forbid-new-submodules
39
31
- id : mixed-line-ending
40
- - id : no-commit-to-branch
41
- - repo : https://github.com/adrienverge/yamllint
42
- rev : v1.35.1
32
+
33
+ - repo : https://github.com/astral-sh/ruff-pre-commit
34
+ rev : v0.3.4
43
35
hooks :
44
- - id : yamllint
45
- args : ["-d", "relaxed"]
46
- language : system
47
- - repo : https://github.com/rhysd/actionlint
48
- rev : v1.6.26
49
- hooks :
50
- - id : actionlint-docker
51
- args : [-ignore, 'label ".+" is unknown']
52
- - repo : https://github.com/psf/black
53
- rev : 24.2.0
54
- hooks :
55
- - id : black
56
- args : [--config=pyproject.toml, -l 120]
57
- language : system
58
- exclude : |
59
- (?x)^(
60
- pkgs/unstract-flags/src/unstract/flags/evaluation_.*\.py|
61
- )$
62
- - repo : https://github.com/pycqa/flake8
63
- rev : 7.0.0
64
- hooks :
65
- - id : flake8
66
- args : [--max-line-length=120]
67
- exclude : |
68
- (?x)^(
69
- tests/test_data/.*|
70
- )$
71
- - repo : https://github.com/pycqa/isort
72
- rev : 5.13.2
73
- hooks :
74
- - id : isort
75
- files : " \\ .(py)$"
76
- args :
77
- [
78
- " --profile" ,
79
- " black" ,
80
- " --filter-files" ,
81
- --settings-path=pyproject.toml,
82
- ]
36
+ - id : ruff
37
+ args : [--fix]
38
+ - id : ruff-format
39
+
83
40
- repo : https://github.com/hadialqattan/pycln
84
41
rev : v2.4.0
85
42
hooks :
86
43
- id : pycln
44
+ entry : uv run pycln
87
45
args : [--config=pyproject.toml]
46
+
88
47
- repo : https://github.com/pycqa/docformatter
89
48
rev : v1.7.5
90
49
hooks :
91
50
- id : docformatter
92
- # - repo: https://github.com/MarcoGorelli/absolufy-imports
93
- # rev: v0.3.1
94
- # hooks:
95
- # - id: absolufy-imports
51
+ language : python
52
+
96
53
- repo : https://github.com/asottile/pyupgrade
97
- rev : v3.15 .0
54
+ rev : v3.17 .0
98
55
hooks :
99
56
- id : pyupgrade
100
57
entry : pyupgrade --py39-plus --keep-runtime-typing
101
58
types :
102
59
- python
103
- - repo : https://github.com/gitleaks/gitleaks
104
- rev : v8.18.2
60
+
61
+ - repo : https://github.com/astral-sh/uv-pre-commit
62
+ rev : 0.6.11
105
63
hooks :
106
- - id : gitleaks
107
- - repo : https://github.com/asottile/yesqa
108
- rev : v1.5.0
64
+ - id : uv-lock
65
+
66
+ - repo : https://github.com/pre-commit/mirrors-mypy
67
+ rev : v1.11.2
109
68
hooks :
110
- - id : yesqa
111
- # TODO: Uncomment after typing the SDK
112
- # - repo: https://github.com/pre-commit/mirrors-mypy
113
- # rev: v1.8.0
114
- # hooks:
115
- # - id: mypy
116
- # language: system
117
- # entry: mypy .
118
- # pass_filenames: false
119
- # # IMPORTANT!
120
- # # Keep args same as tool.mypy section in pyproject.toml
121
- # args:
122
- # [
123
- # --allow-subclassing-any,
124
- # --allow-untyped-decorators,
125
- # --check-untyped-defs,
126
- # --exclude, ".*migrations/.*.py",
127
- # --exclude, "backend/prompt/.*",
128
- # --exclude, "document_display_service/.*",
129
- # --exclude, "pkgs/unstract-connectors/tests/.*",
130
- # --exclude, "pkgs/unstract-core/.*",
131
- # --exclude, "pkgs/unstract-flags/src/unstract/flags/.*",
132
- # --exclude, "sdks/.*",
133
- # --exclude, "unstract-document-service/.*",
134
- # --exclude, "__pypackages__/.*",
135
- # --follow-imports, "silent",
136
- # --ignore-missing-imports,
137
- # --implicit-reexport,
138
- # --pretty,
139
- # --python-version=3.9,
140
- # --show-column-numbers,
141
- # --show-error-codes,
142
- # --strict,
143
- # --warn-redundant-casts,
144
- # --warn-return-any,
145
- # --warn-unreachable,
146
- # --warn-unused-configs,
147
- # --warn-unused-ignores,
148
- # ]
69
+ - id : mypy
70
+ language : system
71
+ entry : uv run mypy .
72
+ pass_filenames : false
73
+ additional_dependencies : []
74
+
149
75
- repo : https://github.com/igorshubovych/markdownlint-cli
150
- rev : v0.39 .0
76
+ rev : v0.42 .0
151
77
hooks :
152
78
- id : markdownlint
153
79
args : [--disable, MD013]
154
80
- id : markdownlint-fix
155
81
args : [--disable, MD013]
156
- - repo : https://github.com/pdm-project/pdm
157
- rev : 2.12.3
82
+
83
+ - repo : https://github.com/gitleaks/gitleaks
84
+ rev : v8.18.2
158
85
hooks :
159
- - id : pdm-lock-check
86
+ - id : gitleaks
0 commit comments