Commit Graph

38 Commits

Author SHA1 Message Date
Qi Xiao
775081b8cc Add tools/pre-push, intended to be used as a Git hook. 2022-06-05 12:44:54 +01:00
Qi Xiao
aa6d5a6257 Re-enable staticcheck, and fix issues it found. 2022-05-22 11:57:38 +01:00
Qi Xiao
cfcef9ec51 pkg/buildinfo: Use Go's buildinfo to derive version of development builds.
This allows the build commands in Makefile and tools/buildall.sh to be
simplified.

Official reproducible builds are now handled as a build variant, and the command
in Makefile no longer tries to produce reproducible builds.

Instructions in PACKAGING.md have been completely rewritten.
2022-04-02 18:18:24 +01:00
Qi Xiao
a8c2d165d3 Simplify pkg/edit/complete/node_path.go with generics.
staticcheck@master crashes when checkling code using generics, disable it in CI
for now.
2022-03-20 16:17:19 +00:00
Kurtis Rader
603aae077d Improve searching PATH on Windows for completions
This was extracted from https://github.com/elves/elvish/pull/1326. It
augments that change by honoring $E:PATHEXT and some other
minor improvements.  This matches the behavior of the Go stdlib
os/exec.LookPath() function that is used to decide if what has been typed
(in a non-completion context) represents an external command.
2022-03-12 22:49:52 +00:00
Qi Xiao
9185e04b69 Add a tool to check "forbidden" content.
Also add a Makefile target and CI task for it.
2022-02-20 23:22:33 +00:00
Qi Xiao
7ed71323fd Remove a now superfluous variable in tools/imports-graph.elv. 2021-12-31 18:51:19 +00:00
Qi Xiao
32a2c4c73d Use the flag module in tools/imports-graph.elv. 2021-12-31 18:49:59 +00:00
Qi Xiao
1d36d299b8 Put flags for prettier in .prettierrc.
Also reformat tools/checkstyle-md.sh.
2021-12-28 12:54:30 +00:00
Qi Xiao
51a388b9ec Add imports-graph.elv, a script to visualize package dependencies.
This script focuses on showing the dependencies between source packages in src.elv.sh. It outputs a DOT file.
2021-12-17 00:52:59 +00:00
Qi Xiao
671c76be00 Add a lint Makefile target and CI task.
Both run staticcheck and go vet (but not golint).

Also make some small changes necessary to make the codebase lint-free under
staticcheck.
2021-07-08 00:13:38 +01:00
Qi Xiao
a8626bce1b Fixup for #1339
- Use explict ./ for consistency when invoking the script

- Rename script to "prune-cover.sh"

- Build ignore pattern in temporary file, and use grep -f to read it

- Use grep -F for correctness (path can contain dots)

- Add comment in .codecov.yml
2021-06-20 16:39:36 +01:00
Kurtis Rader
c64e2ebfa9 make cover now ignores same files as Codecov
Running `make cover` includes code in its report that is explicitly
excluded from the https://codecov.io/gh/elves/elvish/ report. This change
causes both reports to include/exclude the same source files.
2021-06-20 16:18:28 +01:00
Qi Xiao
7d2130141b Make gofmt -s part of checkstyle-go.sh and the style target in Makefile.
Also fix the comment in checkstyle-go.sh, it got the behavior of go{imports fmt}
-d the other way around.
2021-06-09 01:06:00 +01:00
Qi Xiao
559f431b8b tools/run-race.sh: Use race detector on all supported platforms. 2021-05-08 01:40:50 +01:00
Qi Xiao
b48515ab8c Remove step to deploy to bintray in Cirrus CI config.
Bintray was turned down on 2021-05-01.
2021-05-06 11:32:24 +01:00
Qi Xiao
b235dc10ff Use a dedicated script to determine whether to use race detector.
This makes the output of "make test" cleaner, and only show the command that
was actually run (instead of a shell if statement).

Also use the race detector on more supported platforms.
2021-05-05 22:43:38 +01:00
Qi Xiao
15163a9459 Build for darwin-amd64 (macOS on M1). 2021-05-05 22:24:49 +01:00
Qi Xiao
64d22ee3ac tools/buildall.sh: Use extended regular expressions in the sed command.
The "\?" currently used is GNU-ism and doesn't work with BSD sed. Switching
to extended regular expressions avoids this problem.
2021-05-05 22:24:49 +01:00
Qi Xiao
75e7b862dc tools/buildall.sh: Avoid the unportable "echo -n". 2021-02-06 22:44:58 +00:00
Qi Xiao
a407366060 Further restrict PIE to platforms that support it without requiring CGo. 2021-01-31 01:09:05 +00:00
Qi Xiao
be158bc0d3 Only build with -buildmode=pie on Linux on Windows.
Other platforms either don't support -buildmode=pie or require CGo.
2021-01-31 00:54:30 +00:00
Qi Xiao
ec68d73668 Require development builds to include the full commit hash. 2021-01-30 18:13:10 +00:00
Qi Xiao
30489ffd28 tools/buildall.sh: Output usage information from its own comment.
When the number of arguments is not 3, the script now uses a complex sed command
to output the doc comment in its own code.
2021-01-29 01:26:06 +00:00
Qi Xiao
29e949832c Add -buildinfo=pie to flags for reproducible builds. 2021-01-28 19:59:29 +00:00
Qi Xiao
e578826ad1 tools/cirrus-deploy.sh: Accomodate changes in buildall.sh. 2021-01-28 15:13:13 +00:00
Qi Xiao
3ab3b908ec tools/cirrus-deploy.sh: Fix the find command; the cirrus builder uses Busybox. 2021-01-28 15:01:13 +00:00
Qi Xiao
91bdaaf629 Change how version information is overriden.
The mechanism is now documented in PACKAGING.md.

Also refactor tools/buildall.sh to make it easy to make reproducible builds, and
fix tools/cirrus-deploy.sh.
2021-01-28 14:41:34 +00:00
Qi Xiao
e620433422 tools/buildall.sh: Allow using different version name in filename and buildinfo. 2021-01-27 22:10:38 +00:00
Qi Xiao
c4c4a74f51 tools/buildall.sh: support running from any directory, and support passing arguments. 2021-01-27 14:09:00 +00:00
Qi Xiao
88c5dade37 Remove tools/build-old-tag.sh as it's no longer used. 2021-01-27 14:08:33 +00:00
Qi Xiao
22e4315eb1 Move the main package to cmd/elvish.
Now that the module path is "src.elv.sh", doing a "go get" will install the
Elvish binary as "src.elv.sh"; this is not what we want, so move the main
package into a package called "elvish".

Also update "go get" and "go build" commands accordingly.
2021-01-27 01:35:01 +00:00
Qi Xiao
196eea21d4 Change module import path to src.elv.sh 2021-01-27 01:30:25 +00:00
Kurtis Rader
0c30310167 Produce actual diffs when running make checkstyle
Resolves #1117
2020-10-22 15:26:51 +01:00
Qi Xiao
cc9d03588c Deploy to bintray from Cirrus CI, and remove Travis config. 2020-04-03 23:23:23 +01:00
Qi Xiao
ee56832f03 tools/buildall.sh: Remove comment about requiring Go >= 1.13. 2020-01-14 09:20:23 -05:00
Qi Xiao
34b0afe32f Fix path of the buildinfo package in build commands. 2019-12-29 23:03:19 +00:00
Qi Xiao
e799b62c8c _tools: Move non-Go tools into a new tools/, and go tool into a new cmd/. 2019-12-23 19:53:10 +00:00