0.9.0
Improvements
Update to golangci-lint
version 1.43.0
— #64 ⇄ #65 (⊶ 55945b1)
↠ The currently latest golangci-lint
version 1.43.0 introduced new linters and updated supported ones:
- tagliatelle (v1.40.0) — Handles
struct
tags name casing.
This linter is disabled by default, but will be enabled for this template to improve consistency across tag names. - errorlint (v1.40.0) — This linter has been disabled in #39 due to prevent false-positive errors, but will be enabled again with the newly introduced
errorf
option being disabled to prevent this from happening again while still taking advantage of theassert
andcomparison
checks. - wrapcheck (v1.40.0) — This linter is known to cause false-positive errors for the main module (
go list -m
) of the repository wheregolangic-lint
is being run, but in version2.3.0
theignorePackageGlobs
option was added that allows to ignore packages by pattern. Therefore in each project the main module should be added as wildcard. Also see tomarrell/wrapcheck#2 for details and discussions about this known problem. - golint (v1.40.1) — Remove deprecated linter.
4.1 The recommended drop-in replacement is revive which is disabled by default, but will be enabled for this template. - gofumpt (v1.42.0) — Add the
lang-version
with value set to1.17
to target the (currently) latest Go version. - bidichk (v1.43.0) — Checks for dangerous unicode character sequences.
This linter is disabled by default, but will be enabled for this template to prevent "trojan source" bugs. - nilnil (v1.43.0) — Checks that there is no simultaneous return of
nil
error and an invalid value.
This linter is disabled by default, but will be enabled for this template to prevent ambiguous returns. - tenv (v1.43.0) — Detects using
os.Setenv
instead oft.Setenv
since Go 1.17.
This linter is disabled by default, but will be enabled for this template to prevent errors in tests. - contextcheck (v1.43.0) — Checks if functions whether use a non-inherited context.
This linter is disabled by default, but will be enabled for this template to broken call chains and loss of context information. - lll — Add the
tab-width
option with value set to2
to use two spaces for the width of one tab. - gci — Add the comma-separated list of prefixes for local package imports to be put after 3rd-party packages.
Update Go module to Go 1.17
— #66 ⇄ #67 (⊶ c20ba3b)
↠ Before the Go module used Go version 1.16
so it has been updated to the currently latest minor version 1.17
.
Optimized GitHub action workflows for Go and Node — #68 ⇄ #69 (⊶ c3ff68b)
↠ Before all jobs were summarized in the ci
workflow but not separated by their scope, i.e. Go and Node specific tasks. The workflow was also not optimized to only run when specific files have been changed which resulted in false-positive executions and wasted limited free tier and developer time.
Therefore the ci
workflow has been optimized by splitting it into new ci-go
and ci-node
workflows.
CI Go
The new ci-go
workflow…
- only runs when any
*.go
file has been modified. See the extensive GitHub action documentations abouton.<push|pull_request>.paths
and the filter pattern cheat sheet for more details. - only runs for
ubuntu-latest
instead of a matrix withmacos-latest
andwindows-latest
which should be added for projects with platform specific code.
CI Node
The new ci-node
workflow…
- only runs when any
*.js
,*.json
,*.md
,*.yaml
and*.yml
file has been modified. This matches the lint-staged, Prettier and remark configurations. See the extensive GitHub action documentations abouton.<push|pull_request>.paths
and the filter pattern cheat sheet for more details. - only runs for
ubuntu-latest
instead of a matrix withmacos-latest
andwindows-latest
which should be added for projects with platform specific code. - uses cache
npm
dependencies which is possible as ofactions/setup-node@v2.2.0
.
Silent linting errors for CI/CD environments
When running the configured linting tasks the Prettier CLI prints matches to the standard output with a visual preview of the file content and a marker at the specific element. When files that store secret data, e.g. when encrypted with git-crypt
, are decrypted in the GitHub Actions this could leak this data when Prettier finds errors in these files.
To prevent these case new CI specific linting tasks have been added with a silent
loglevel
. This however comes with the drawback that possible linting errors must be analyzed locally, but the code quality is still ensured by blocking subsequent workflows.
Update to tmpl template repository version 0.10.0
— #70 ⇄ #71 (⊶ 670859e)
↠ Updated to tmpl
version 0.10.0
which comes with…
- an optimized GitHub action workflow scope — this change has also already been resolved in #68, but additionally created the
ci-go
GitHub Action workflow. - the regular Node package dependency & GitHub action version updates
- the migration to the Markdown style guide version
0.4.0
The full changelog is available in the repository
Copyright © 2019-present Sven Greb