5 Commits
Author SHA1 Message Date
petrbalvin e3dda5e115 fix: take the release-check version from the recipe argument
Test / test (push) Successful in 1m46s
Release / gates (push) Successful in 1m36s
Release / release (push) Successful in 39s
2026-09-22 21:49:05 +02:00
petrbalvin e35b4bb90d fix: take the release-check version from the recipe argument
Test / test (push) Canceled after 44s
2026-09-22 21:48:00 +02:00
petrbalvin 75ade89f34 chore: prepare release v2.0.0
Test / test (push) Successful in 2m3s
2026-09-22 21:45:25 +02:00
petrbalvin 41786c5bc6 chore: drop the internal reference from the justfile header 2026-09-22 21:45:25 +02:00
petrbalvin 010a7b2a1e ci: pin the actions by version tag and cap the test timeout at 10m 2026-09-22 21:45:25 +02:00
6 changed files with 38 additions and 30 deletions
+2 -2
View File
@@ -22,9 +22,9 @@ jobs:
runs-on: fedora
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/checkout@v7
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
+3 -3
View File
@@ -22,9 +22,9 @@ jobs:
runs-on: fedora
timeout-minutes: 45
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/checkout@v7
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
@@ -34,4 +34,4 @@ jobs:
run: dnf install -y gcc
- name: Race
run: go test -race -count=1 -timeout 30m ./...
run: go test -race -count=1 -timeout 10m ./...
+6 -6
View File
@@ -4,8 +4,8 @@
# carries the CHANGELOG section as its body and nothing else. The gates still run first,
# in their own job and once, minus the race detector: race never runs on a push path or a
# tag, and the local gate raced this tree before the tag was cut. The write permission
# sits on the release job alone, and the version contract these steps implement is in the
# `release` skill.
# sits on the release job alone, and the version the binary reports is the one the
# toolchain records from the tag, with nothing injected.
#
# Every step is one command, so the step that fails is the gate that failed, and no shell
# option has to be trusted for the run to stop. The scripted steps are Perl, not shell and
@@ -31,9 +31,9 @@ jobs:
runs-on: fedora
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/checkout@v7
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6
- uses: actions/setup-go@v6
with:
# The module is the source of truth for the version, so it cannot drift.
go-version-file: go.mod
@@ -77,7 +77,7 @@ jobs:
- name: Tests
# Keep the pattern equal to `packages` in the project's justfile.
run: go test -count=1 -timeout 30m -coverprofile=coverage.out ./...
run: go test -count=1 -timeout 10m -coverprofile=coverage.out ./...
- name: Coverage floor
run: |
@@ -103,7 +103,7 @@ jobs:
contents: read
releases: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/checkout@v7
- name: Install Perl
# The runner images are minimal and Perl is not guaranteed. The install is a
+3 -3
View File
@@ -44,9 +44,9 @@ jobs:
runs-on: fedora
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/checkout@v7
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6
- uses: actions/setup-go@v6
with:
# The module is the source of truth for the version, so it cannot drift.
go-version-file: go.mod
@@ -80,7 +80,7 @@ jobs:
- name: Tests
# Scope the pattern to the packages that hold the logic when a thin cmd/ drags the
# total under the floor, and keep it equal to `packages` in the project's justfile.
run: go test -count=1 -timeout 30m -coverprofile=coverage.out ./...
run: go test -count=1 -timeout 10m -coverprofile=coverage.out ./...
- name: Coverage floor
run: |
+18 -12
View File
@@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
-
## [2.0.0] - 2026-09-22
### Added
- `encoding.TextMarshaler` and `encoding.TextUnmarshaler` are honoured by
default, with no option to switch them off. A type that implements them is
encoded as a TOML string and decoded from one: `net.IP` becomes
@@ -20,7 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `time.Duration` is encoded in its canonical Go form as a TOML string,
`1h30m0s`, because TOML has no duration type; the decoder reads that string
back and still accepts a bare integer as the nanosecond count.
- `interpres-decode -encode`, the adapter's other direction: it reads the
- `interpres-decode --encode`, the adapter's other direction: it reads the
toml-test tagged JSON from stdin and writes the TOML document it describes.
The compliance suite now runs the encoder as well as the decoder, 214
encoder cases against the tagged JSON of the valid corpus.
@@ -47,8 +53,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
the plain type takes an offset date-time as it always did; code that asserts
the tree's type, and `UnmarshalTOML` implementations that expect a
`time.Time`, need the new type.
- `MaxNestingDepth(depth)` and `MaxInputSize(size)` options bound the parse a
`Decode` performs, and every parse carries a nesting limit in any case
- `MaxNestingDepth(depth)` and `MaxInputSize(size)` options bound the parse an
`Unmarshal` performs, and every parse carries a nesting limit in any case
(10000 levels, which no hand-written document approaches): a document that
nests arrays or inline tables deeper used to run the stack out and is now
rejected with a `SyntaxError` naming the limit.
@@ -57,7 +63,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
header as one statement with its node, an `[[array of tables]]` as one
statement per element. A caller that breaks after the statement it wanted
reads no further ones. `examples/statements` shows the walk.
- `ParseAs[T](data)`, the generic one-line decode, and `NewSchema[T]()`,
- `ParseAs[T](data, opts...)`, the generic one-line decode, and `NewSchema[T]()`,
which precompiles the struct schema and the interface flags for a hot path
before the first document arrives.
- `EmitFieldComments(true)` prints the comment a field's `toml` tag
@@ -101,26 +107,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
is an error wrapped with the key path.
- `MarshalAppend(buf, v)` appends the TOML encoding of v to buf and returns
the extended buffer, the shape `json.MarshalAppend` has.
- `interpres-decode -version` prints the binary's version, the module version
- `interpres-decode --version` prints the binary's version, the module version
the toolchain recorded, so a release-built binary names its own tag.
- `interpres-decode -json` prints plain indented JSON instead of the tagged
- `interpres-decode --json` prints plain indented JSON instead of the tagged
form, the shape for people and diffs, with the date-time wrappers in their
TOML form.
- `interpres-decode -validate` walks a named directory for `.toml` files and
- `interpres-decode --validate` walks a named directory for `.toml` files and
closes the sweep with a summary naming how many documents were checked and
how many were invalid; single files stay quiet on success as before.
- `interpres-decode -struct` infers a Go struct definition from a document:
- `interpres-decode --struct` infers a Go struct definition from a document:
one field per key in written order, nested tables as nested struct types,
an array of tables as a slice. The printed type compiles and decodes the
document it came from.
- `interpres-decode -schema TYPE file.go` writes a TOML template for the
- `interpres-decode --schema TYPE file.go` writes a TOML template for the
named struct type of a Go source, the `comment=` tag option printed as a
comment and the `default=` option as the value. It is the inverse of
`-struct`.
`--struct`.
- `ParseFile(path)` reads the file and parses it into a `Document`, with the
file name at the front of every error it returns, read failure and parse
failure alike. `Valid(data)` reports whether a document parses, nil on
success and the parse error on failure, the library call the `-validate`
success and the parse error on failure, the library call the `--validate`
mode of interpres-decode is built on.
- `SyntaxError` carries the byte `Offset` the scan stopped at and the 1-based
`Column` on the line, beside the line it always had, and `SourceLine(src)`
@@ -328,7 +334,7 @@ except where noted above.
comments and trailing commas. The compliance suite runs in TOML 1.1 mode:
214 valid and 467 invalid cases, zero failures. Every TOML 1.0 document
parses exactly as before.
- `interpres-decode -validate [file ...]`: a validate mode beside the
- `interpres-decode --validate [file ...]`: a validate mode beside the
toml-test adapter. It parses each named file, or stdin when none are named,
prints one line per invalid document to stderr, and exits 0 when all are
valid, 1 when one is not, and 2 on a usage or read failure. Install it with
+6 -4
View File
@@ -1,7 +1,7 @@
# interpres.
#
# Everything below the variable block is the standard recipe set from the `justfile`
# skill, identical in every repository; project values live in the variable block only.
# Everything below the variable block is the standard recipe set, identical in
# every repository; project values live in the variable block only.
binary := "interpres-decode"
package := "./cmd/interpres-decode"
@@ -115,10 +115,12 @@ cross:
example:
go run ./examples/basic
# The release pre-flight from the release skill, in one command: the branch, a clean tree, a sync with origin, the gates, and a CHANGELOG section ready to release. Not a gate, it is the checklist before a release may even be discussed.
# The release pre-flight, in one command: the branch, a clean tree, a sync with origin, the gates, and a CHANGELOG section ready to release. Not a gate, it is the checklist before a release may even be discussed.
release-check version:
#!/usr/bin/env perl
my ($version) = @ARGV;
# The version arrives through the recipe interpolation: just does not hand
# positional arguments to a shebang script's @ARGV.
my $version = "{{version}}";
$version =~ m{\Av?\d+\.\d+\.\d+\z} or die qq{usage: just release-check X.Y.Z\n};
my $branch = qx{git rev-parse --abbrev-ref HEAD};
chomp $branch;