- Consolidate all checks into a "all-checks" target in the Makefile, and use it
from tools/pre-push and ci.yml.
- Remove trivial make targets, including "generate" and all the individual check
targets.
- Remove the trivial script tools/lint.sh.
- Rename the "checkstyle" scripts to "check-fmt", which is more specific.
While working on a change to augment `make lint` to be more comprehensive I
noticed that `go generate ./...` produced unexpected errors on my system (see
below). This augments the CI environment checks to verify that the generated
code is up to date. This also augments the pre-push script to perform the
checks by the tools/check-content script run by the CI environment.
FWIW: The errors shown below were because my version of the
`stringer` tool was out of date (fixed by running `go install
golang.org/x/tools/stringer@latest`) Regardless, the point of this change
is that the pre-push script and the CI environment should verify that the
generated code is up to date. This change adds those checks.
> go generate ./...
stringer: internal error: package "fmt" without types was imported from
"src.elv.sh/pkg/getopt"
pkg/getopt/getopt.go:11: running "stringer": exit status 1
stringer: internal error: package "fmt" without types was imported from
"src.elv.sh/pkg/md"
pkg/md/md.go:163: running "stringer": exit status 1
stringer: internal error: package "fmt" without types was imported from
"src.elv.sh/pkg/parse"
pkg/parse/parse.go:11: running "stringer": exit status 1
Exception: go exited with 1
[tty 102], line 1: go generate ./...
Using cancel-in-progress will cause the workflow to fail, which is not
desirable. Instead, use the GitHub API to fetch the SHA of the latest commit,
and suppress the error from check_binary_checksums if it doesn't match the SHA
of the triggering commit.
Putting binaries inside repo will result in vcs.modified=true in the buildinfo,
making the binaries different from those from dl.elv.sh.
Also update the build script to align with https://github.com/elves/up.
Running test and vet with Go 1.17 has uncovered some issues, which breaks CI.
This change will be rolled forward after I have a local Go 1.17 environment and
fix those issues.
This reverts commit 9afb84e4fd.