Skip to content

[dead-code] chore: remove dead functions — 10 functions removed - #19643

Merged
pelikhan merged 2 commits into
mainfrom
dead-code/remove-batch-2-6ee043fe9687593d
Mar 5, 2026
Merged

[dead-code] chore: remove dead functions — 10 functions removed#19643
pelikhan merged 2 commits into
mainfrom
dead-code/remove-batch-2-6ee043fe9687593d

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Dead Code Removal

This PR removes unreachable Go functions identified by the deadcode static analyzer.

Functions Removed

FunctionFile
ExtractMCPServerpkg/workflow/metrics.go
SecurityFinding.Stringpkg/workflow/markdown_security_scanner.go
EnhanceErrorpkg/workflow/error_helpers.go
WrapErrorWithContextpkg/workflow/error_helpers.go
extractGroupExpressionpkg/workflow/concurrency_validation.go
isGitToolAllowedpkg/workflow/tools_validation.go
HasSafeJobsEnabledpkg/workflow/safe_jobs.go
GetToolsetsDatapkg/workflow/permissions_validation.go
ParseIntFromConfigpkg/workflow/config_helpers.go
parseParticipantsFromConfigpkg/workflow/config_helpers.go

Tests Removed

Test FunctionFile
TestSecurityFinding_Stringpkg/workflow/markdown_security_scanner_test.go
TestEnhanceErrorpkg/workflow/error_helpers_test.go
TestWrapErrorWithContextpkg/workflow/error_helpers_test.go
TestExtractGroupExpressionpkg/workflow/concurrency_validation_test.go
TestIsGitToolAllowedpkg/workflow/tools_validation_test.go
TestHasSafeJobsEnabledpkg/workflow/safe_jobs_test.go
TestGetToolsetsDatapkg/workflow/permissions_validator_json_test.go
TestParseIntFromConfigpkg/workflow/config_parsing_helpers_test.go
TestParseParticipantsFromConfigpkg/workflow/config_parsing_helpers_test.go
TestParseParticipantsFromConfigConsistencypkg/workflow/config_parsing_helpers_test.go

Verification

  • go build ./... — passes
  • go vet ./... — passes
  • go vet -tags=integration ./... — passes
  • make fmt — applied (reformatted files match standard)
  • go test ./pkg/workflow/... — passes

Dead Function Count

  • Before this batch: ~71 functions (total from deadcode output)
  • Removed in this PR: 10 functions
  • Previously removed: 6 functions (batch 1)
  • Remaining: ~55 functions

Automated by Dead Code Removal workflow — https://github.com/github/gh-aw/actions/runs/22682431931

Generated by Dead Code Removal Agent ·

  • expires on Mar 7, 2026, 6:17 PM UTC

Remove unreachable functions and their exclusive tests:
- ExtractMCPServer (metrics.go)
- SecurityFinding.String (markdown_security_scanner.go)
- EnhanceError (error_helpers.go)
- WrapErrorWithContext (error_helpers.go)
- extractGroupExpression (concurrency_validation.go)
- isGitToolAllowed (tools_validation.go)
- HasSafeJobsEnabled (safe_jobs.go)
- GetToolsetsData (permissions_validation.go)
- ParseIntFromConfig (config_helpers.go)
- parseParticipantsFromConfig (config_helpers.go)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review March 5, 2026 03:04
CopilotAI review requested due to automatic review settings March 5, 2026 03:04
@pelikhan
pelikhan merged commit 2992b11 into mainMar 5, 2026
50 checks passed
@pelikhan
pelikhan deleted the dead-code/remove-batch-2-6ee043fe9687593d branch March 5, 2026 03:04

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR removes 10 dead (unreferenced) Go functions and their associated tests, as identified by the deadcode static analyzer. This is the second batch in an ongoing dead code cleanup effort.

Changes:

  • Removed 10 unreferenced functions across 7 source files (metrics.go, markdown_security_scanner.go, error_helpers.go, concurrency_validation.go, tools_validation.go, safe_jobs.go, permissions_validation.go, config_helpers.go)
  • Removed 10 corresponding test functions across 6 test files
  • Updated file-level documentation comments to remove references to deleted functions

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.

Show a summary per file
FileDescription
pkg/workflow/metrics.goRemoved ExtractMCPServer function
pkg/workflow/markdown_security_scanner.goRemoved SecurityFinding.String method
pkg/workflow/markdown_security_scanner_test.goRemoved TestSecurityFinding_String test
pkg/workflow/error_helpers.goRemoved EnhanceError and WrapErrorWithContext functions
pkg/workflow/error_helpers_test.goRemoved TestEnhanceError and TestWrapErrorWithContext tests
pkg/workflow/concurrency_validation.goRemoved extractGroupExpression function and its doc reference
pkg/workflow/concurrency_validation_test.goRemoved TestExtractGroupExpression test
pkg/workflow/tools_validation.goRemoved isGitToolAllowed function
pkg/workflow/tools_validation_test.goRemoved TestIsGitToolAllowed test
pkg/workflow/safe_jobs.goRemoved HasSafeJobsEnabled function
pkg/workflow/safe_jobs_test.goRemoved TestHasSafeJobsEnabled test
pkg/workflow/permissions_validation.goRemoved GetToolsetsData function
pkg/workflow/permissions_validator_json_test.goRemoved TestGetToolsetsData test
pkg/workflow/config_helpers.goRemoved parseParticipantsFromConfig and ParseIntFromConfig functions, updated doc comment
pkg/workflow/config_parsing_helpers_test.goRemoved TestParseParticipantsFromConfig, TestParseParticipantsFromConfigConsistency, and TestParseIntFromConfig tests

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@pelikhan