Run pre-commit hooks without Docker where possible

Match balena-pihole and balena-adguard. actionlint switches to the
golang hook, so pre-commit builds it without Docker. hadolint has no
equivalent hook that needs no local install, so it stays on Docker but
pins the image by tag and digest, since the upstream entry is untagged.

Add check-json, check-merge-conflict, markdownlint and gitleaks, and fix
the existing markdownlint findings. markdownlint skips LICENSE.md so the
license text stays untouched.

Signed-off-by: Kyle Harding <kyle@balena.io>
This commit is contained in:
Kyle Harding committed 2026-12-04 10:31:28 -05:00
1 parent 7ab9c052a9
commit ecfc6513e5
4 files changed
+34 -8

No files matched your search

+3
View File
@@ -0,0 +1,3 @@
# Tables carry long URLs and cannot wrap. Prose keeps the 80 column limit.
MD013:
tables: false
+19 -1
View File
@@ -7,6 +7,8 @@ repos:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
- id: check-merge-conflict
- id: check-added-large-files
- repo: https://github.com/renovatebot/pre-commit-hooks
@@ -17,9 +19,25 @@ repos:
- repo: https://github.com/rhysd/actionlint
rev: v1.7.12
hooks:
- id: actionlint-docker
- id: actionlint
- repo: https://github.com/hadolint/hadolint
rev: v2.15.1
hooks:
- id: hadolint-docker
# The upstream entry is untagged, so `rev` alone pins no image.
entry: ghcr.io/hadolint/hadolint:v2.15.1@sha256:32dac94127fd60b7b7e3fbfc65e1383b9b5e25c9bfd7b8536de7a539fe68a12d hadolint
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.50.0
hooks:
- id: markdownlint
exclude: ^LICENSE\.md$
- repo: https://github.com/gitleaks/gitleaks
rev: v8.30.1
hooks:
# `gitleaks-docker` is not used because its image reference carries no tag.
- id: gitleaks
# The default entry scans staged changes only, so it scans nothing in CI.
entry: gitleaks dir --redact --verbose .
+8 -6
View File
@@ -119,11 +119,12 @@ People _love_ thorough bug reports. I'm not even kidding.
## Packaging new Unbound releases
> **Automated:** The [`Bump Unbound`](.github/workflows/bump-unbound.yml) workflow runs
> weekly (and on demand via **Run workflow**). It detects new upstream releases, updates
> the `ARG` fields below, regenerates the example config, sanity-builds the image, and
> opens a `Bump Unbound to X.Y.Z` PR for review. The manual steps below are the fallback
> for out-of-band bumps or when you want to drive it by hand.
> **Automated:** The [`Bump Unbound`](.github/workflows/bump-unbound.yml)
> workflow runs weekly (and on demand via **Run workflow**). It detects new
> upstream releases, updates the `ARG` fields below, regenerates the example
> config, sanity-builds the image, and opens a `Bump Unbound to X.Y.Z` PR for
> review. The manual steps below are the fallback for out-of-band bumps or when
> you want to drive it by hand.
1. In your working copy, create a new branch if you haven't already, and update
the following fields in the [Dockerfile](Dockerfile) with the new version and
@@ -150,7 +151,8 @@ People _love_ thorough bug reports. I'm not even kidding.
For the current pattern, see recent commits touching the Unbound `ARG` lines:
```bash
git log --oneline -- Dockerfile | grep -iE "bump unbound|update unbound" | head -5
git log --oneline -- Dockerfile |
grep -iE "bump unbound|update unbound" | head -5
```
## Tagging a release (maintainers only)
+4 -1
View File
@@ -39,7 +39,10 @@ docker run --name unbound \
The cache DB module was compiled into daemon, but is disabled by default. To
enable this module, follow this steps:
- You will need a Redis-protocol-compatible backend (e.g. Redis or Valkey) running and reachable from the Unbound container; see [examples/redis](https://github.com/klutchell/unbound-docker/tree/main/examples/redis) for a full docker-compose example;
- You will need a Redis-protocol-compatible backend (e.g. Redis or Valkey)
running and reachable from the Unbound container; see
[examples/redis](https://github.com/klutchell/unbound-docker/tree/main/examples/redis)
for a full docker-compose example;
- Create a `cachedb.conf` under your custom configuration directory `/path/to/config/custom.conf.d`;
- Add a `server` directive with module configuration to enable `cachedb` module;
- Add a `cachedb` directive with Valkey (Redis-compatible) credentials;