Skip to content

0.9.0

Compare
Choose a tag to compare
@svengreb svengreb released this 20 Nov 11:11
· 8 commits to main since this release
v0.9.0

Release Date: 2021-11-20 Project Board Milestone

Show all commits

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:

  1. 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.
  2. 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 the assert and comparison checks.
  3. wrapcheck (v1.40.0) — This linter is known to cause false-positive errors for the main module (go list -m) of the repository where golangic-lint is being run, but in version 2.3.0 the ignorePackageGlobs 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.
  4. 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.
  5. gofumpt (v1.42.0) — Add the lang-version with value set to 1.17 to target the (currently) latest Go version.
  6. 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.
  7. 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.
  8. tenv (v1.43.0) — Detects using os.Setenv instead of t.Setenv since Go 1.17.
    This linter is disabled by default, but will be enabled for this template to prevent errors in tests.
  9. 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.
  10. lll — Add the tab-width option with value set to 2 to use two spaces for the width of one tab.
  11. 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…

CI Node

The new ci-node workflow…

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…

  1. an optimized GitHub action workflow scope — this change has also already been resolved in #68, but additionally created the ci-go GitHub Action workflow.
  2. the regular Node package dependency & GitHub action version updates
  3. the migration to the Markdown style guide version 0.4.0

The full changelog is available in the repository

Copyright © 2019-present Sven Greb