Skip to content

Commit cd396c8

Browse files
committed
Added pre-commit
1 parent bbac5a5 commit cd396c8

File tree

3 files changed

+25
-15
lines changed

3 files changed

+25
-15
lines changed

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
repos:
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
# Ruff version.
4+
rev: v0.13.0
5+
hooks:
6+
# Run the linter.
7+
- id: ruff-check
8+
# Run the formatter.
9+
- id: ruff-format

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -66,22 +66,22 @@ git fetch --all
6666

6767
### Submodule update hook
6868

69-
If you'll be switching between branches that are have the submodule set to different refs, then make your life
70-
easier and add the git hooks in the .githooks directory to your local config:
69+
If you'll be switching between branches that are have the submodule set to different refs, then make your life
70+
easier and add the git hooks in the .githooks directory to your git hooks:
7171
```shell
72-
git config --local core.hooksPath .githooks/
72+
cp .githooks/post-checkout .git/hooks/
7373
```
7474

7575

7676
### Editable installs (general)
7777

7878
It's good to be aware of the following when performing an editable install:
79-
- `uv sync` or `uv run [tool]` perform an editable install by default. We have
80-
configured the project so that scikit-build-core will use a persistent build-dir, but since the build itself
81-
happens in an isolated, ephemeral environment, cmake's paths will point to non-existing directories. CMake itself
79+
- `uv sync` or `uv run [tool]` perform an editable install by default. We have
80+
configured the project so that scikit-build-core will use a persistent build-dir, but since the build itself
81+
happens in an isolated, ephemeral environment, cmake's paths will point to non-existing directories. CMake itself
8282
will be missing.
83-
- You should install all development dependencies, and then build the project without build isolation, in two separate
84-
steps. After this you can happily keep building and running, as long as you don't forget to pass in the
83+
- You should install all development dependencies, and then build the project without build isolation, in two separate
84+
steps. After this you can happily keep building and running, as long as you don't forget to pass in the
8585
`--no-build-isolation` flag.
8686

8787
```bash
@@ -93,9 +93,9 @@ uv sync --no-build-isolation
9393

9494
### Editable installs (IDEs)
9595

96-
If you're using an IDE then life is a little simpler. You install build dependencies and the project in the two
97-
steps outlined above, and from that point on you can rely on e.g. CLion's cmake capabilities to do incremental
98-
compilation and editable rebuilds. This will skip scikit-build-core's build backend and all of uv's dependency
96+
If you're using an IDE then life is a little simpler. You install build dependencies and the project in the two
97+
steps outlined above, and from that point on you can rely on e.g. CLion's cmake capabilities to do incremental
98+
compilation and editable rebuilds. This will skip scikit-build-core's build backend and all of uv's dependency
9999
management, so for "real" builds you better revert to the CLI. However, this should work fine for coding and debugging.
100100

101101

@@ -139,7 +139,7 @@ uv run --no-build-isolation pytest ./tests --verbose --ignore=./tests/slow
139139
COVERAGE=1 uv run --no-build-isolation coverage run -m pytest ./tests --verbose
140140
```
141141

142-
The `COVERAGE` env var will compile the extension with `--coverage`, allowing us to collect coverage stats of C++
142+
The `COVERAGE` env var will compile the extension with `--coverage`, allowing us to collect coverage stats of C++
143143
code as well as Python code.
144144

145145
Check coverage for Python code:
@@ -148,7 +148,7 @@ uvx coverage html -d htmlcov-python
148148
uvx coverage report --format=markdown
149149
```
150150

151-
Check coverage for C++ code (note: this will clutter your project dir with html files, consider saving them in some
151+
Check coverage for C++ code (note: this will clutter your project dir with html files, consider saving them in some
152152
other place):
153153
```bash
154154
uvx gcovr \
@@ -275,7 +275,7 @@ versioning scheme.
275275
```toml
276276
[tool.scikit-build]
277277
metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"
278-
278+
279279
[tool.setuptools_scm]
280280
version_scheme = "duckdb_packaging._setuptools_scm_version:version_scheme"
281281
```

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,8 @@ build = [
274274
"setuptools_scm>=8.0",
275275
]
276276
dev = [ # tooling like uv will install this automatically when syncing the environment
277-
"ruff>=0.11.13",
277+
"pre-commit",
278+
"ruff>=0.13.0",
278279
{include-group = "stubdeps"},
279280
{include-group = "build"},
280281
{include-group = "test"},

0 commit comments

Comments
 (0)