krz/nfogen

A scene-style ASCII .nfo generator. ascii cli generator nfo

Commit af9a9d9212

af9a9d92129b53ce2ff86963e79a3f55f39bc2f2

parent: e81a1b8e5e

Verified · cmc

cmc <hello@cleberg.net> · 2026-08-23 01:35 UTC

Check the examples regenerate, and point dependabot at something real

The examples are a golden fixture: each .toml sits beside the .nfo it produces,
so regenerating and diffing catches an unintended change to layout, banner or
encoding in review rather than in a release.

dependabot was configured for the uv ecosystem, but nfogen is a single stdlib
script with no manifest, so it tracked nothing and opened no PRs. Actions are
the only thing here with versions, and now there are actions to track.

Layout: unified · split

.github/workflows/test.yml added +42
@@ -0,0 +1,42 @@
1name: Test
2
3# nfogen ships examples/*.toml next to the .nfo each one produces, which makes
4# them a golden fixture: regenerate and compare. A change to layout, banner or
5# encoding that was not intended shows up as a diff in a committed file rather
6# than in someone's release notes.
7on:
8 pull_request:
9 push:
10 branches: [main]
11
12permissions:
13 contents: read
14
15jobs:
16 examples:
17 runs-on: ubuntu-latest
18 steps:
19 - uses: actions/checkout@v7
20
21 # 3.11+ for tomllib, which nfogen needs to read a .toml config at all.
22 - uses: actions/setup-python@v7
23 with:
24 python-version: '3.13'
25
26 - name: Syntax
27 run: python -m compileall -q nfogen.py
28
29 - name: Examples regenerate byte for byte
30 run: |
31 set -euo pipefail
32 fail=0
33 for toml in examples/*.toml; do
34 base="$(basename "$toml" .toml)"
35 [ -f "examples/$base.nfo" ] || continue
36 python nfogen.py -c "$toml" -o "/tmp/$base.nfo" --no-input
37 if ! diff -u "examples/$base.nfo" "/tmp/$base.nfo"; then
38 echo "::error file=examples/$base.nfo::regenerated output differs from the committed example"
39 fail=1
40 fi
41 done
42 exit "$fail"