Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ megalinter:
npx mega-linter-runner --flavor cupcake --env "MEGALINTER_CONFIG=.github/linters/.megalinter.yml"

[group("qa-extra")]
pre-commit:
prek:
uv run prek run --all-files

[group("build")]
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<kbd>
<a href="https://github.com/daniel-mizsak/python-package-template/actions/workflows/ci.yml" target="_blank"><img src="https://github.com/daniel-mizsak/python-package-template/actions/workflows/ci.yml/badge.svg" alt="build status"></a>
<a href="https://codecov.io/gh/daniel-mizsak/python-package-template" target="_blank"><img src="https://codecov.io/gh/daniel-mizsak/python-package-template/graph/badge.svg?token=SDXG1S8PVM" alt="codecov"></a>
<a href="https://results.pre-commit.ci/latest/github/daniel-mizsak/python-package-template/main" target="_blank"><img src="https://results.pre-commit.ci/badge/github/daniel-mizsak/python-package-template/main.svg" alt="pre-commit.ci status"></a>
<a href="https://pypi.org/project/python-package-template-pypi" target="_blank"><img src="https://img.shields.io/pypi/v/python-package-template-pypi" alt="pypi version"></a>
<a href="https://img.shields.io/github/license/daniel-mizsak/python-package-template" target="_blank"><img src="https://img.shields.io/github/license/daniel-mizsak/python-package-template" alt="license"></a>
</kbd>
Expand Down
3 changes: 2 additions & 1 deletion docs/tools/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ Below is a list of the tools that I use for almost every project. Navigate to th
- [Pytest](./pytest.md) - Modern testing framework.
- [Nox](./nox.md) - Testing automation framework for multiple Python environments.
- [Megalinter](./megalinter.md) - Many-in-one linter solution.
- [Pre-Commit](./pre-commit.md) - Git pre-commit hook manager.
- [Prek](./prek.md) - Git hook manager for pre-commit checks.
- [Renovate](./renovate.md) - Dependency update automation tool.
- [Codecov](./codecov.md) - Platform for tracking code coverage.
- [Zensical](./zensical.md) - Static site generator for documentation.
- [GitHub Pages](./github-pages.md) - Static site hosting service.
Expand Down
25 changes: 0 additions & 25 deletions docs/tools/pre-commit.md

This file was deleted.

27 changes: 27 additions & 0 deletions docs/tools/prek.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Prek

[Prek](https://prek.j178.dev/){target} is a git hook manager for pre-commit checks.

With `prek` a list of pre-commit checks can be defined that will be executed on the code before it is committed. If the checks fail, the commit is aborted. This ensures that the code being committed follows certain standards, but many programmers also find this limiting.

The `prek` related settings are defined in the `.pre-commit-config.yaml` file.

<!-- prettier-ignore-start -->

!!! info
To use `prek`, it has to be installed in the virtual environment and also added to the git hooks by running `prek install`.
<!-- prettier-ignore-end -->

Call `prek` by making a git commit or by running:

```bash
uv run prek run --all-files
```

Or (alternatively) use `just`:

```bash
just prek
```

I used to use [pre-commit](https://pre-commit.com){target} before, but switched to `prek` as it seems to be more actively maintained.
17 changes: 17 additions & 0 deletions docs/tools/renovate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Renovate

[Renovate](https://docs.renovatebot.com/){target} is a dependency update automation tool.

It scans the repository configuration and opens pull requests when supported dependencies can be updated. This keeps the project dependencies current without having to manually track new releases.

The `renovate` related settings are defined in the `.github/renovate.json5` file.

In this template I use `renovate` to update:

- `github-actions` dependencies,
- `pep621` dependencies from `pyproject.toml`,
- `pre-commit` dependencies from `.pre-commit-config.yaml`.

I also prefer grouping updates by manager and waiting at least 7 days before new releases are updated.

`Renovate` is used as a [GitHub App](https://github.com/apps/renovate){target}. Once it is installed for the repository, it will automatically read the configuration and start opening pull requests.
3 changes: 2 additions & 1 deletion zensical.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
{ "Pytest" = "tools/pytest.md" },
{ "Nox" = "tools/nox.md" },
{ "Megalinter" = "tools/megalinter.md" },
{ "Pre-Commit" = "tools/pre-commit.md" },
{ "Prek" = "tools/prek.md" },
{ "Renovate" = "tools/renovate.md" },
{ "Codecov" = "tools/codecov.md" },
{ "Zensical" = "tools/zensical.md" },
{ "GitHub Pages" = "tools/github-pages.md" },
Expand Down