Skip to content

Commit 38eaa4c

Browse files
committed
pre-commit fixes
1 parent 3c4528f commit 38eaa4c

4 files changed

Lines changed: 18 additions & 9 deletions

File tree

.github/workflows/code_quality.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ jobs:
4242

4343
- name: pre-commit (--all-files)
4444
run: |
45-
uvx pre-commit run --show-diff-on-failure --color=always --all-files
45+
uvx --python 3.12 pre-commit run --show-diff-on-failure --color=always --all-files

.pre-commit-config.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@ repos:
2929
rev: v0.6.13
3030
hooks:
3131
- id: cmake-format
32-
# cmakelang is unmaintained and crashes under Python 3.14
33-
# ("Cannot use capturing groups in re.Scanner"). Pin this hook's
34-
# environment to 3.13 so it never picks up a 3.14 interpreter. The
35-
# code_quality CI job provisions Python 3.13 to match, so the hook
36-
# resolves to the running interpreter there.
37-
language_version: python3.12
3832

3933
- repo: https://github.com/pre-commit/mirrors-mypy
4034
rev: v1.18.2

CLAUDE.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,11 @@ uv run ruff format src/ tests/
188188
# Type checking (mypy — strict mode, see [tool.mypy] in pyproject.toml)
189189
uv run mypy
190190

191-
# Pre-commit hooks (configured in .pre-commit-config.yaml)
192-
uvx pre-commit run --all-files
191+
# Pre-commit hooks (configured in .pre-commit-config.yaml). Install pinned to 3.12
192+
# (cmakelang crashes on 3.14; keeps hooks off the build interpreter):
193+
uv tool install --python 3.12 pre-commit
194+
pre-commit install # git hook, runs on commit
195+
pre-commit run --all-files # run across the tree
193196
```
194197

195198
## Debugging

CONTRIBUTING.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@
44

55
See the [instructions on duckdb.org](https://duckdb.org/docs/stable/dev/building/python).
66

7+
### Pre-commit hooks
8+
9+
Formatting and linting run through [pre-commit](https://pre-commit.com). Install it pinned to Python 3.12 (the `cmake-format` hook's `cmakelang` dependency crashes on 3.14) so the hooks stay independent of your build interpreter, which may be 3.13 or 3.14t:
10+
11+
```bash
12+
uv tool install --python 3.12 pre-commit
13+
pre-commit install # git hook, runs on `git commit`
14+
pre-commit run --all-files # run across the tree
15+
```
16+
17+
The same checks run in CI.
18+
719
## General Guidelines
820

921
### **Did you find a bug?**

0 commit comments

Comments
 (0)