Skip to content

Commit a8767c7

Browse files
authored
feat: replace pre-commit with prek (#18)
1 parent a8b0b7f commit a8767c7

12 files changed

+37
-37
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Built for my own workflow, but you're welcome to use it!
1414
| **[pytest](https://pytest.org/)** | Testing | Industry standard |
1515
| **[hatch](https://hatch.pypa.io/)** | Multi-version testing | Matrix testing with envs |
1616
| **[MkDocs](https://www.mkdocs.org/)** | Documentation | Material theme + mkdocstrings |
17-
| **[pre-commit](https://pre-commit.com/)** | Git hooks | Code quality enforcement |
17+
| **[prek](https://prek.dev/)** | Git hooks | Code quality enforcement |
1818
| **[Typer](https://typer.tiangolo.com/)** | CLI framework | Type-hint based, modern |
1919
| **[git-cliff](https://git-cliff.org/)** | Changelog | Auto-generated from conventional commits |
2020

copier.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ include_docs:
118118
help: "Include MkDocs documentation?"
119119
default: true
120120

121-
include_precommit:
121+
include_prek:
122122
type: bool
123-
help: "Include pre-commit hooks?"
123+
help: "Include prek (pre-commit) hooks for code quality checks?"
124124
default: true
125125

126126
include_codecov:

docs/guide.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ make install
1616
source .venv/bin/activate
1717
```
1818

19-
### 3. Run the pre-commit hooks
19+
### 3. Run the prek hooks
2020

21-
If you enabled pre-commit, install the hooks and run them to resolve any initial formatting issues:
21+
If you enabled prek, install the hooks and run them to resolve any initial formatting issues:
2222

2323
```bash
24-
pre-commit install
25-
uv run pre-commit run -a
24+
prek install
25+
uv run prek run -a
2626
```
2727

2828
### 4. Verify everything works
@@ -105,7 +105,7 @@ my-project/
105105
├── pyproject.toml # Single source of truth
106106
├── mkdocs.yml # If docs enabled
107107
├── cliff.toml # Changelog config
108-
├── .pre-commit-config.yaml # If pre-commit enabled
108+
├── .pre-commit-config.yaml # If prek enabled
109109
├── Dockerfile # If Docker enabled
110110
├── .dockerignore # If Docker enabled
111111
├── README.md

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Built for my own workflow, but you're welcome to use it!
1616
| **[pytest](https://pytest.org/)** | Testing | Industry standard |
1717
| **[hatch](https://hatch.pypa.io/)** | Multi-version testing | Matrix testing with envs |
1818
| **[MkDocs](https://www.mkdocs.org/)** | Documentation | Material theme + mkdocstrings |
19-
| **[pre-commit](https://pre-commit.com/)** | Git hooks | Code quality enforcement |
19+
| **[prek](https://prek.dev/)** | Git hooks | Code quality enforcement |
2020
| **[Typer](https://typer.tiangolo.com/)** | CLI framework | Type-hint based, modern |
2121
| **[git-cliff](https://git-cliff.org/)** | Changelog | Auto-generated from conventional commits |
2222

docs/options.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ When you run `copier copy`, you'll be prompted for the following options.
3636
| `include_github_actions` | bool | `true` | Include GitHub Actions CI/CD |
3737
| `include_docker` | bool | `true` | Include Dockerfile for containerization |
3838
| `include_docs` | bool | `true` | Include MkDocs documentation |
39-
| `include_precommit` | bool | `true` | Include pre-commit hooks |
39+
| `include_prek` | bool | `true` | Include prek hooks |
4040
| `include_codecov` | bool | `true` | Include Codecov integration (requires GitHub Actions) |
4141
| `include_pypi_publish` | bool | `true` | Include automatic PyPI publishing (requires GitHub Actions) |
4242

template/CHANGELOG.md.jinja

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2020
{%- if include_github_actions %}
2121
- GitHub Actions CI/CD pipelines
2222
{%- endif %}
23-
{%- if include_precommit %}
24-
- Pre-commit hooks for code quality
23+
{%- if include_prek %}
24+
- Prek hooks for code quality
2525
{%- endif %}

template/README.md.jinja

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,13 @@ make verify
9494
# Auto-fix lint and format issues
9595
make fix
9696
```
97-
{%- if include_precommit %}
97+
{%- if include_prek %}
9898

99-
### Pre-commit
99+
### Prek
100100

101101
```bash
102-
pre-commit install
103-
pre-commit run --all-files
102+
prek install
103+
prek run --all-files
104104
```
105105
{%- endif %}
106106
{%- if include_docs %}

template/docs/contributing.md.jinja

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ Thank you for your interest in contributing to {{ project_name }}!
1616
```bash
1717
uv sync --group dev
1818
```
19-
{%- if include_precommit %}
19+
{%- if include_prek %}
2020

21-
3. Install pre-commit hooks:
21+
3. Install prek hooks:
2222

2323
```bash
24-
pre-commit install
24+
prek install
2525
```
2626
{%- endif %}
2727

template/docs/index.md.jinja

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,14 @@ uv run ruff format .
7373
# Type check
7474
uv run ty check
7575
```
76-
{%- if include_precommit %}
76+
{%- if include_prek %}
7777

78-
### Pre-commit Hooks
78+
### Prek Hooks
7979

80-
Install pre-commit hooks:
80+
Install prek hooks:
8181

8282
```bash
83-
pre-commit install
83+
prek install
8484
```
8585
{%- endif %}
8686

template/pyproject.toml.jinja

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ dev = [
4747
"ruff>=0.14.14",
4848
"ty>=0.0.14",
4949
"hatch>=1.16.3",
50-
{%- if include_precommit %}
51-
"pre-commit>=4.5.1",
50+
{%- if include_prek %}
51+
"prek>=0.1.0",
5252
{%- endif %}
5353
]
5454
{%- if include_docs %}

0 commit comments

Comments
 (0)