GitHub Actions:
- Fix skipping of test coverage on old Go; GitHub Actions doesn't have true
booleans (https://github.com/actions/runner/issues/1483)
- Update workflow versions.
Cirrus:
- Download Go toolchain from go.dev on all BSD platforms.
Both:
- Bump Go to 1.22 (with one GitHub Actions job still running Go 1.21).
go test -race is not compatible with ASLR, but a current Go bug causes the test
to still appear as successful: https://github.com/golang/go/issues/65425.
This commit should result in a test failure on Cirrus CI's FreeBSD runner,
because there's currently a FreeBSD-specific bug in a test case (#1763).
- evaltest.TestTranscriptsInFS runs transcripts in .elv and .elvts files as
tests.
- Extend the syntax of Elvish transcripts with headings and comments; the former
is used to split a single .elvts file into multiple sessions.
The primary purpose of this change is to fix a broken link to the
readline binding source. A secondary purpose is a baby step to
addressing issue #1719.
Related #1719
The pattern "if err := ...; err != nil" is popular in certain Go projects as it
saves one line of code, but Elvish's codebase only uses the init clause in an if
statement when the init clause is used to calculate something that's only used
in the condition or the if body. In this case addFlag has side effects that's
relevant outside the if block, so shouldn't be put in the init clause.
Remove the `epm` dependency on `rm` with `os:remove-all` so it is slightly
easier to use the `epm` command on Windows.
There aren't any unit tests for this but I verified it worked by running
the following statements on my macOS and Windows systems:
epm:install github.com/doubleagent/rivendell
epm:uninstall github.com/doubleagent/rivendell
Related #1661
Also:
- Clean up the script a bit, adding more comments.
- Report line and column number of offending links.
- Fix the (more minor) issues found by the new checks.
Make it more obvious why a documentation reference link is invalid when
the URL path incorrectly includes a trailing slash. This would have
saved me an hour of debugging when I was working on a change that
included a reference like this one:
[`edit:histlist:start`](../ref/edit.html/#edit:histlist:start)
Fixes#1749
*Exception.Show used to work differently when the traceback contains one frame
vs more frames. Harmonize how they work, and consistent with how parse errors
and compilation errors are shown.
The former is unused, and the latter is only used from pkg/edit/config_api.go.
Subsume the logic into ShowError, and use that from pkg/edit/config_api.go.
- Change Context to export all its fields.
- Include end position in Context, and include it in Show.
- Remove the Type field from Error, and express it using an ErrorTag type
parameter instead.
- Make {Pack Unpack}CognateErrors type-safe with the new ErrorTag mechanism, and
rename them to just {Pack Unpack}Errors.
- Fix the cache key used in check_website.yml. It was blindly copied from ci.yml
and contained matrix parameters that are not present in this workflow.
- Simplify the derivation of OS_TYPE used for tagging coverages to use a ternary
expression.
- Simplify the condition for uploading coverages by introducing a new "old-go"
matrix parameter.
- Use reflection to derive function name.
- Take test cases as variadic arguments, instead of requiring them to be wrapped
in a Table.
- Support naming test cases.
- Run test cases as subtests with t.Run.
The script used to emit double-quoted strings, which is not standard SQL
syntax and support for it in SQLite been disabled by default since 3.41.0
(https://www.sqlite.org/changes.html).