Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions test/mocks/github.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//nolint:gosec // We don't care about XSS in mock data for tests.
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

File-level //nolint:gosec directive is still unused and will fail CI.

The nolintlint linter reports this directive is unused because gosec doesn't flag any issues in this file. The original problem wasn't that gosec was raising false positives—it was that the //nolint:gosec comments had no findings to suppress.

The fix is to simply remove the directive entirely rather than moving it to file level.

Proposed fix
-//nolint:gosec // We don't care about XSS in mock data for tests.
 package mocks
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
//nolint:gosec // We don't care about XSS in mock data for tests.
package mocks
🧰 Tools
🪛 golangci-lint (2.5.0)

[error] 1-1: directive //nolint:gosec // We don't care about XSS in mock data for tests. is unused for linter "gosec"

(nolintlint)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/mocks/github.go` at line 1, Remove the unused file-level directive
"//nolint:gosec" from test/mocks/github.go; do not add or move it
elsewhere—simply delete that comment so nolintlint no longer reports an unused
directive and CI can pass.

package mocks

import (
Expand Down Expand Up @@ -454,9 +455,7 @@ func (mgh MockGitHub) getRepositoryCollaborator(
mgh.repositoryMemberships,
"repository_id",
)
_, _ = w.Write(
mock.MustMarshal(user),
)
_, _ = w.Write(mock.MustMarshal(user))
}

func (mgh MockGitHub) addMembership(
Expand Down
Loading