fix: resolve macOS test link failure and update lint rules#2428
Closed
SudhanshuMatrix wants to merge 3 commits into
Closed
fix: resolve macOS test link failure and update lint rules#2428SudhanshuMatrix wants to merge 3 commits into
SudhanshuMatrix wants to merge 3 commits into
Conversation
…tions_test Under Go 1.26, `go vet` has tightened its format verb checks, flagging `%q` when used on the integer-based `ShellCompDirective` type: `(*testing.common).Errorf format %q has arg directive of wrong type github.com/spf13/cobra.ShellCompDirective` This fixes the issue by formatting the directive using `%s` alongside its unexported `string()` helper method, keeping the change isolated to the test file. Fixes spf13#2422
Co-authored-by: Christophe Colombier <3875889+ccoVeille@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This Pull Request addresses macOS test linking failures and linter configuration adjustments to ensure clean CI/CD runs and local builds.
As suggested in #2423 (comment), this PR isolates these config and CI updates into a separate branch.
Changes Proposed
macOS Test Link Fix:
GO_TEST_FLAGS: -ldflags=-linkmode=externalenvironment variable for macOS platforms in the GitHub Actionstest-unixjob.Makefile(testandrichtesttargets) to reference$(GO_TEST_FLAGS), keeping target execution platform-independent while resolving macOS-specific link issues.Linter Rule Exclusions & Hygiene (
.golangci.yml):goconston all_test.gofiles to prevent noisy alerts on duplicated test strings.goconstexclusions for common shell inputs (true,bash,zsh,fish,powershell).linters.settings.nolintlint.allow-unused: true(following theversion: "2"config schema) to prevent build failures under newer Go versions (like Go 1.26) where some pre-existing//nolintcomments are no longer triggered.Verification Results
go test ./...).golangci-lintJSON schema for version 2. The configuration modifications resolve allnolintlintwarnings and pass schema validation checks.