Linter Improvements
This is a proposal for a few lint improvements and the integration of https://trunk.io as a meta-linter. The trunk
integration will handle the running of golang-ci
, shellcheck
, and shfmt
so those jobs have been removed from the CI pipeline. There is also support for gosec
and semgrep
, for which I'll integrate the custom configuration and remove those jobs in a subsequent pass.
trunk
provides a couple conveniences:
- Auto-fix for many of the lint errors
- Only checks changes against upstream, so lots of linters don't slow it down too much
- All linters can be ignore with a comment in generic
// trunk-ignore(<linter>/<code>)
format for any language
You can try out the lint changes with:
# install (https://trunk.io)
curl https://get.trunk.io -fsSL | bash
# lint
make lint
Once this is merged I'll create separate merge requests to:
- Run
trunk check --all --upstream origin/develop
and fix all errors - Replace the existing
gosec
andsemgrep
jobs, adding the configuration intrunk
- Enable the additional linters commented in
.golangci.yml
and fix corresponding errors
Related Earmark Fixes
- Updated
lint-handlers
to avoid noisy errors messages for missing_archive.go
files - Renamed
lint-erc20-token-list
->lint-erc20s
for consistency with the script name - Added
make lint
to run all lint targets - Correctly added
lint-pre
target dependency, but disabled contents to avoid the noise from the lint fixes in this PR (since that has not been getting run in CI) - will fix those format errors and re-enable on the subsequent PR mentioned above