Skip to content

Fix linting errors and re-enable golangci linters#599

Merged
scottisloud merged 8 commits into
mainfrom
scoot/fix/fix-linting-errors-and-re-enable-linting
May 14, 2026
Merged

Fix linting errors and re-enable golangci linters#599
scottisloud merged 8 commits into
mainfrom
scoot/fix/fix-linting-errors-and-re-enable-linting

Conversation

@scottisloud
Copy link
Copy Markdown
Contributor

@scottisloud scottisloud commented May 13, 2026

Overview

Following up on #595, the errcheck, depguard, and staticcheck linters were previously disabled in .golangci.yml because they were producing errors after the linter had been nonfunctional for an extended period of time. This PR resolves all outstanding issues and re-enables them so every configured linter runs in CI.

Closes OS-148

Type of change

  • Created a new plugin
  • Improved an existing plugin
  • Fixed a bug in an existing plugin
  • Improved contributor utilities or experience

Changelog

Changes
depguard (1 fix)

  • sdk/plugintest/example_secrets.go — swapped math/rand for the safer crypto/rand.

errcheck (4 fixes)

  • sdk/plugintest/validation_report.go — checked the return values of the Printf calls on Heading, Success, Warning, and Error formatters.

staticcheck (7 fixes / suppressions)

  • plugins/readme/api_key.go — dropped the redundant string type declaration (ST1023).
  • sdk/plugintest/validation_report.go — removed the unnecessary nil check before len() (S1009).
  • sdk/schema/executable.go — simplified a boolean expression via De Morgan's law (QF1001).
  • plugins/aws/sts_provisioner.go and sdk/rpc/server/server.go — added targeted //nolint exclusions for QF1008 (embedded-field selectors) where the explicit form was preferred for readability.

.golangci.yml

  • Removed the disable: block; errcheck, depguard, and staticcheck are now in the enable: list alongside the existing defaults.

Testing

golangci-lint run now exits cleanly with all three linters active.

Copy link
Copy Markdown

@JillRegan JillRegan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a small comment that I don't have a strong opinion about so approving! 🙌

Comment thread plugins/aws/sts_provisioner.go
@scottisloud scottisloud merged commit 00a6fca into main May 14, 2026
5 checks passed
@scottisloud scottisloud deleted the scoot/fix/fix-linting-errors-and-re-enable-linting branch May 14, 2026 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants