refactor(#198): extract FormatFinding and LogFindings helpers#226
Open
fullsend-ai-coder[bot] wants to merge 1 commit into
Open
refactor(#198): extract FormatFinding and LogFindings helpers#226fullsend-ai-coder[bot] wants to merge 1 commit into
fullsend-ai-coder[bot] wants to merge 1 commit into
Conversation
Add shared helper functions to internal/security/ for formatting Finding details, eliminating duplicated formatting loops across scan.go. FormatFinding returns "[severity] name: detail" using the Name field (pattern name/category) consistently, resolving the Scanner vs Name inconsistency where scan.go:125 used f.Scanner while other callers used f.Name. Changes: - Add FormatFinding(f Finding) string to internal/security/scanner.go - Add LogFindings(w io.Writer, findings []Finding) to scanner.go - Update 3 callers in internal/cli/scan.go to use FormatFinding - Add unit tests for both helpers in scanner_test.go The Name field identifies what was found (e.g. "github_pat", "zero_width") which is more actionable for users than Scanner which identifies the scanner that detected it. The choice is documented in FormatFinding godoc. Note: bootstrap_scan.go logs findings at aggregate level only (count and severity) with no per-finding formatting loops, so no changes were needed there. Closes #198
E2E tests did not runE2E tests run automatically for org/repo members and collaborators on pull requests. For other contributors, a maintainer must add the See E2E testing guide for details. |
ReviewFindingsMedium
Low
Previous runReview of PR #226Verdict: Approve This PR extracts What was checked
Observations
All observations are low severity — none block merge. Labels: PR modifies internal/security/ scanner package and internal/cli/ scan commands |
Owner
|
/fs-review |
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.
Add shared helper functions to internal/security/ for formatting Finding details, eliminating duplicated formatting loops across scan.go. FormatFinding returns "[severity] name: detail" using the Name field (pattern name/category) consistently, resolving the Scanner vs Name inconsistency where scan.go:125 used f.Scanner while other callers used f.Name.
Changes:
The Name field identifies what was found (e.g. "github_pat", "zero_width") which is more actionable for users than Scanner which identifies the scanner that detected it. The choice is documented in FormatFinding godoc.
Note: bootstrap_scan.go logs findings at aggregate level only (count and severity) with no per-finding formatting loops, so no changes were needed there.
Closes #198
Post-script verification
agent/198-format-finding-helper)f96750babbed5ada406a9ae04e8068449701d9c7..HEAD)