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).
We now assume that the directory name under pkg/mods match exactly with the
Elvish module name in several places, and this mismatch broke website building.
Go allows dashes in directory names; it just forbids them in the package name
and there's actually no requirement that the directory name and the package name
be the same.
This command used to depend on pkg/mods/doc to access the embedded .elv, which
in turn depends on all the packages that implement builtin modules. The latter
set of packages depends on almost all the Elvish packages transitively. As a
result, almost any change in any Elvish package will trigger a rebuild of this
command and the whole website.
This commit minimizes the dependency on Elvish packages by having it read the
.elv files during runtime instead (enabled by
9112eb1ab2).
Additionally:
- Move HighlightCodeBlock, needed by website/cmd/md2html, from pkg/mods/doc
to pkg/elvdoc. Moving it is necessary to completely remove the dependency of
website/cmd/md2html on pkg/mods/doc.
- Remove the dependency of pkg/edit/highlight on pkg/eval. It only uses
eval.UnpackCompilationErrors; move this work to the supplied Check function.
This removes the transitive dependency of website/cmd/md2html on pkg/eval.
- Augment website/tools/md-deps to recognize @module lines and add dependency on
the corresponding .elv files.
This syntax has been documented to have an implicit destination of
builtin.html#foo, but it never worked correctly outside builtin.html itself.
Also do some minor cleanups of the package, including removing bogus package
godocs that were inherited from the previous version where the components were
separate programs.
Instead of having each individual module embed their .elv files and collect all
of them in pkg/mods/doc, have a single embed.FS at pkg that includes everything,
and use that pkg/mods/doc.
Implement a function that extracts all module elvdocs, and put it in pkg/elvdoc.