Skip to content

Commit 59526f7

Browse files
Fix linting issues: gofmt formatting and testifylint violations
- Remove trailing whitespace in cmd/handle_analyze_manifest_test.go and cmd/mcp_server.go - Replace assert.Len(t, ..., 0, ...) with assert.Empty(t, ...) for testifylint compliance - All tests still pass and functionality remains intact Co-authored-by: fproulx-boostsecurity <[email protected]>
1 parent ac6de7b commit 59526f7

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

cmd/handle_analyze_manifest_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ jobs:
340340

341341
// Should have multiple findings including injection
342342
assert.Greater(t, len(insights.Findings), 1, "Should have multiple findings without filter")
343-
343+
344344
// Verify injection rule is present
345345
hasInjection := false
346346
for _, finding := range insights.Findings {
@@ -379,7 +379,7 @@ jobs:
379379
// Should have only injection finding
380380
assert.Len(t, insights.Findings, 1, "Should have only one finding with filter")
381381
assert.Equal(t, "injection", insights.Findings[0].RuleId, "Should only have injection finding")
382-
382+
383383
// Should have only injection rule
384384
assert.Len(t, insights.Rules, 1, "Should have only one rule with filter")
385385
_, hasInjectionRule := insights.Rules["injection"]
@@ -411,8 +411,8 @@ jobs:
411411
require.NoError(t, err)
412412

413413
// Should have no findings
414-
assert.Len(t, insights.Findings, 0, "Should have no findings with non-existent rule filter")
415-
assert.Len(t, insights.Rules, 0, "Should have no rules with non-existent rule filter")
414+
assert.Empty(t, insights.Findings, "Should have no findings with non-existent rule filter")
415+
assert.Empty(t, insights.Rules, "Should have no rules with non-existent rule filter")
416416

417417
t.Logf("Found %d findings with non-existent rule filter", len(insights.Findings))
418418
})

cmd/mcp_server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,12 +513,12 @@ func handleAnalyzeManifest(ctx context.Context, request mcp.CallToolRequest, ana
513513
if len(allowedRulesParam) > 0 {
514514
requestConfig := *config
515515
requestConfig.AllowedRules = allowedRulesParam
516-
516+
517517
requestOpaClient, err := newOpaWithConfig(ctx, &requestConfig)
518518
if err != nil {
519519
return mcp.NewToolResultError(fmt.Sprintf("failed to create OPA client with allowed rules: %v", err)), nil
520520
}
521-
521+
522522
requestAnalyzer = analyze.NewAnalyzer(nil, nil, &noop.Format{}, &requestConfig, requestOpaClient)
523523
} else {
524524
requestAnalyzer = analyzer

0 commit comments

Comments
 (0)