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
61default_language_version :
7- python : python3.9
2+ python : python3.12
83default_stages :
9- - commit
4+ - pre- commit
105repos :
116 - repo : https://github.com/pre-commit/pre-commit-hooks
12- rev : v4.5 .0
7+ rev : v5.0 .0
138 hooks :
149 - id : trailing-whitespace
15- # TODO: Exclude tests/test_data directory
16- exclude : ^tests/test_data/
1710 exclude_types :
1811 - " markdown"
1912 - id : end-of-file-fixer
20- exclude : " tests/test_data/.*"
2113 - id : check-yaml
2214 args : [--unsafe]
2315 - id : check-added-large-files
@@ -37,123 +29,58 @@ repos:
3729 - id : destroyed-symlinks
3830 - id : forbid-new-submodules
3931 - 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
4335 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+
8340 - repo : https://github.com/hadialqattan/pycln
8441 rev : v2.4.0
8542 hooks :
8643 - id : pycln
44+ entry : uv run pycln
8745 args : [--config=pyproject.toml]
46+
8847 - repo : https://github.com/pycqa/docformatter
8948 rev : v1.7.5
9049 hooks :
9150 - 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+
9653 - repo : https://github.com/asottile/pyupgrade
97- rev : v3.15 .0
54+ rev : v3.17 .0
9855 hooks :
9956 - id : pyupgrade
10057 entry : pyupgrade --py39-plus --keep-runtime-typing
10158 types :
10259 - 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
10563 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
10968 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+
14975 - repo : https://github.com/igorshubovych/markdownlint-cli
150- rev : v0.39 .0
76+ rev : v0.42 .0
15177 hooks :
15278 - id : markdownlint
15379 args : [--disable, MD013]
15480 - id : markdownlint-fix
15581 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
15885 hooks :
159- - id : pdm-lock-check
86+ - id : gitleaks
0 commit comments