Commit Graph

6153 Commits

Author SHA1 Message Date
Qi Xiao
980cf009ca Parse comment blocks preceding var and fn declarations as doc comments.
Convert all .elv files (including .d.elv files) to use this new format.
2022-11-22 22:59:31 +00:00
Qi Xiao
c0a9294686 .cirrus.yml: Use image family for OpenBSD.
Also actually fix the image family of NetBSD. The old families are no longer
updated after https://github.com/anarazel/pg-vm-images/commit/8e40e1c542346a4f97b637bc2417fe55
ee8772c1
2022-11-21 12:17:43 +00:00
Qi Xiao
bdbe7f3fd1 .cirrus.yml: Use new OpenBSD image.
Also pin the system version of the NetBSD image.
2022-11-21 11:58:11 +00:00
Qi Xiao
f765423119 pkg/mods/file: Split test functions.
Also remove file_unix_test.go now that the tests against /dev/null and /dev/tty
are only run if they can be opened.
2022-11-21 11:44:08 +00:00
Qi Xiao
1f0f2a3e9d pkg/mods/file: Only test is-tty with /dev/tty if it can be opened.
The file cannot be opened when not running in a terminal.
2022-11-21 11:39:33 +00:00
Qi Xiao
eed2f7dabc pkg/mods/file: file:is-tty interprets numbers as port numbers instead of FDs. 2022-11-21 11:30:14 +00:00
Qi Xiao
a3f4384495 Move all elvdocs into .d.elv files.
The elvdocs still use the old format (#elvdoc:fn or #elvdoc:var) for now, but
will be changed to "fn" and "var" forms soon.

Also remove the accidentally committed cmd/mvelvdoc. It has been used to perform
the conversion automatically but is not supposed to be committed.
2022-11-20 21:59:45 +00:00
Qi Xiao
08b7c91402 Fixup for #1616.
- Allow using &key and &less-than together.

- Simplify the implementation with a custom implementation of sort.Interface.
2022-11-20 21:48:23 +00:00
Qi Xiao
973e8e76e2 pkg/eval/vals: Avoid the .Name hack for allowing using $nil for callable.
Also add a test.
2022-11-20 19:31:07 +00:00
Kurtis Rader
306e2d7b8d
Issue 1570 order key option (#1616)
* Allow $nil for Callable options

Related #1570

* Add a `&key` option to the `order` command.

Resolves #1570

Co-authored-by: Qi Xiao <xiaq@users.noreply.github.com>
2022-11-20 19:10:19 +00:00
Qi Xiao
93e28d846b Fixup for #1618.
- Simplify the matcher for compilation errors.

- Various stylistic fixes.
2022-11-20 16:39:01 +00:00
Kurtis Rader
358e52a7f5 Make testing compilation errors more deterministic
A year ago I submitted a change to replace AnyError with tests for specific
errors (see https://github.com/elves/elvish/commit/87656c99).  This does
something similar for DoesNotCompile. This ensures the test does what
is implied and makes correlating specific unit tests with compilation
errors easier.

This includes a couple of changes to compilation error messages to improve
readability (IMHO) but those are not the primary purpose of this change.

Related #1560
2022-11-20 16:33:29 +00:00
Qi Xiao
a18aec1ac8 Fixup for #1598.
- Let file:is-tty always take one argument.

- Revert change to eval.ByteOutput.

- Make sys.IsATTY take a FD instead, to avoid the need to use os.NewFile. Using
  os.NewFile can cause the Go runtime to start polling the file, which
  interferes with Elvish's terminal reader.
2022-11-20 16:21:10 +00:00
Kurtis Rader
23c83323b6 Implement file:is-tty
Resolves #1263
2022-11-20 16:03:34 +00:00
Qi Xiao
6c6797b4c1 Remove use of "e.g.," and "i.e.,".
Some of the uses are replaced by plain English phrases like "such as", and the
remaining have the trailing commas removed.
2022-11-20 15:44:29 +00:00
Kurtis Rader
abf1fc5bd3 Remove support for shared vars
Proactively remove support for shared vars per the discussions in issue
https://b.elv.sh/1222 and the IM channels. This feature is not used
by Elvish itself and is not believed to be used by any Elvish users.
Removing this (presumptively) unused feature makes it simpler to replace
the existing BoltDB store of interactive command/location history with a
simpler flat file implementation (such as used by Bash and Fish). Also,
eliminating shared var support makes it explicit that solving issue #1222
doesn't need to deal with that feature.

Related #1222
2022-11-20 15:25:11 +00:00
Qi Xiao
1a84c6f71e Merge branch 'integrate-pr' 2022-11-20 15:13:29 +00:00
Qi Xiao
3a0b1242ac Fixup for #1591.
- Keep more metrics than just the minimal duration.

- Change default &min-time to 1s.

- Don't allow unitless value as &min-time.

- Rename &on-run to &on-run-end, and &min-iters to &min-runs.
2022-11-20 15:13:25 +00:00
Qi Xiao
27f6ab2aa1 pkg/eval/errs: Fix misleading message in OutOfRange.Error.
The method returns a message saying that there is no valid value if ValidHigh <
ValidLow. This was useful when these fields were numbers, but since they are now
strings this no longer works.
2022-11-20 15:11:57 +00:00
Qi Xiao
0203a2ad82 website/cmd/elvdoc: Fix a bug handling comment blocks from multiple files. 2022-11-19 21:47:31 +00:00
Kurtis Rader
b88b377c0c Documentation typo to a backslash on Windows
While working on other changes I noticed that
https://elv.sh/ref/path.html#path:separator used a double backslash for
the Windows example while it should have used a single backslash.
2022-11-19 00:07:15 +00:00
dunsany
39c487416c Small mistake in path:is-regular doc
`path:is-dir` was in transcript
2022-11-19 00:06:58 +00:00
dunsany
30485c1f75 Fix path:temp-file documentation
There were incorrect function calls in the examples.
2022-11-19 00:06:43 +00:00
Qi Xiao
633c353442 pkg/md/mdrun: Support -cpuprofile. 2022-11-17 23:25:33 +00:00
Qi Xiao
e829d78748
.codecov.yml: Exclude commands for manual testing. 2022-11-13 01:48:18 +00:00
Qi Xiao
464c555038 Move cmd/examples into pkg/cli. 2022-11-12 22:49:44 +00:00
Qi Xiao
1fba4b325f Replace cmd/elvmd with a simpler pkg/md/mdrun.
The new command is put in pkg/md to make it clear that it is used for debugging
pkg/md and not intended for general use.
2022-11-12 22:15:35 +00:00
Qi Xiao
0af790d133 pkg/md: Add TTYCodec. 2022-11-12 22:15:03 +00:00
Qi Xiao
d811c8dd37 pkg/ui: Fix godoc syntax. 2022-11-12 20:38:48 +00:00
Qi Xiao
975e68c584 pkg/ui: Add NormalizeText. 2022-11-12 20:38:40 +00:00
Qi Xiao
612d9f768f pkg/md: Document why blackfriday isn't considered. 2022-11-12 09:24:24 +00:00
Qi Xiao
64caa7aa13 pkg/md: Clarify some wording in the godoc. 2022-11-12 01:25:18 +00:00
Qi Xiao
8cda7719d2 CONTRIBUTING.md: Update the Markdown variant of elvdocs. 2022-11-11 23:54:41 +00:00
Qi Xiao
7eb7f45b0b pkg/md: Reorder the sections of the package godoc. 2022-11-11 23:51:54 +00:00
Qi Xiao
c886b0f797 pkg/md: Add more links and contexts. 2022-11-11 22:58:09 +00:00
Qi Xiao
810b3486d8 Expand the godoc of pkg/md to include a lot more context.
Also link to it from the godoc of the commands that use it.
2022-11-11 20:25:33 +00:00
Qi Xiao
add0a6833c .cirrus.yml: Add testing on OpenBSD. 2022-11-11 16:42:20 +00:00
Qi Xiao
690480beda pkg/mods/unix: Make test cases in TestUmask more orthogonal.
Also fix a test case that fails on OpenBSD.
2022-11-11 16:38:19 +00:00
Qi Xiao
ff204a19eb pkg/mods/unix: Fix race condition in UmaskVariable.Get. 2022-11-11 16:38:19 +00:00
Qi Xiao
93b2503940 .cirrus.yml: Fix PATH in NetBSD task. 2022-11-10 22:43:03 +00:00
Qi Xiao
50d36e720a .cirrus.yml: Add task to test on NetBSD. 2022-11-10 22:34:42 +00:00
Qi Xiao
d5ea12f28b Update .cirrus.yml.
- Only download checksums in check_binary_checksums_task.

- Don't install git when testing on FreeBSD; it's no longer required.
2022-11-10 10:25:21 +00:00
Qi Xiao
73b6cd3dcb CONTRIBUTING.md: Clarify which checks are done by pre-push 2022-11-10 00:14:45 +00:00
Qi Xiao
4b049651e4 .cirrus.yml: Simplify check_binary_checksums_task.
Cirrus has native support for cancelling a CI task if there is a newer push.
This means that we don't have to worry about the case of a newer push while the
task is running since it can simply be cancelled.
2022-11-10 00:11:32 +00:00
Qi Xiao
c5fcced05d .cirrus.yml: Reproduce the environment of official builds.
- Install Git to make Go include VCS info.

- Ensure that the repo is not dirty.
2022-11-08 23:56:25 +00:00
Qi Xiao
3d7b20d4c0 CI: Fix GitHub API URL for fetching the SHA of latest commit. 2022-11-08 23:40:02 +00:00
Qi Xiao
370f2c133b Update .cirrus.yml
- Don't always exit 0 in wait_website_update_script

- Print SHA values in check_binary_checksums_script
2022-11-08 23:33:20 +00:00
Qi Xiao
73458332a5 Update .cirrus.yml.
- Add task to test on ARM.

- Split go_modules_cache and go_build_cache. The former doesn't need to be
  reuploaded, the latter does.

- Add tasks to check the binary checksums on websites, like the check_website CI
  in GitHub Actions. Adding another independent builder ensures reproducibility
  and integrity of the prebuilt binaries.
2022-11-08 23:08:42 +00:00
Qi Xiao
025a7108bd Update .cirrus.yml.
- Move go_toolchain_cache to the FreeBSD entry.

  Replace fingerprint_key with fingerprint_script.

- Update FreeBSD to 13.1.

- Update gccgo's script (still commented out) to use gccgo-12 and install git.
2022-11-08 20:46:52 +00:00
Qi Xiao
7e15d5a05d Bump Go version in check_website to 1.19.3.
This is to match c67704a8c0.
2022-11-08 18:16:58 +00:00