Skip to content

[dead-code] chore: remove dead functions — 5 functions removed#47339

Merged
pelikhan merged 2 commits into
mainfrom
chore/dead-code-print-functions-20260722-e3ebed783200394c
Jul 22, 2026
Merged

[dead-code] chore: remove dead functions — 5 functions removed#47339
pelikhan merged 2 commits into
mainfrom
chore/dead-code-print-functions-20260722-e3ebed783200394c

Conversation

@github-actions

@github-actions github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Removes dead Print* wrapper functions from pkg/console/print.go that were no longer called anywhere in the codebase. Each removed function was a thin fmt.Fprint/fmt.Fprintln wrapper around an existing Format* function.

Changes

pkg/console/print.go — 6 functions deleted:

  • PrintError(err CompilerError)
  • PrintTableHeaderStderr(text string)
  • PrintErrorTextStderr(text string)
  • PrintProgressMessage(message string)
  • PrintPromptMessage(message string)
  • PrintVerboseMessage(message string)

pkg/console/print_test.go — corresponding unit tests for all removed functions deleted.

Impact

  • No behaviour change to remaining functions.
  • Reduces public surface area of pkg/console.
  • The underlying Format* functions remain available for callers that need the formatted string without printing.

Generated by PR Description Updater for #47339 · sonnet46 17.8 AIC · ⌖ 7.35 AIC · ⊞ 4.8K ·

Remove 5 unreachable Print* functions from pkg/console/print.go that
had no callers outside of test files, along with their exclusive tests.

Functions removed:
- PrintError
- PrintTableHeaderStderr
- PrintErrorTextStderr
- PrintProgressMessage, PrintPromptMessage, PrintVerboseMessage

Tests removed: TestPrintErrorNewline, TestPrintTableHeaderStderr,
TestPrintErrorTextStderr, TestPrintProgressMessage, TestPrintPromptMessage,
TestPrintVerboseMessage

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pelikhan pelikhan closed this Jul 22, 2026
@pelikhan pelikhan reopened this Jul 22, 2026
@github-actions github-actions Bot added the closed:unknown PR was closed without merging: unknown label Jul 22, 2026
@pelikhan
pelikhan marked this pull request as ready for review July 22, 2026 15:19
Copilot AI review requested due to automatic review settings July 22, 2026 15:19
@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR #47339 does not have the 'implementation' label and has 0 new lines of code in business logic directories (threshold: 100). The 2 changed files are outside of monitored business logic directories (src/, lib/, pkg/, internal/, app/, core/, domain/, services/, api/).

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

Test Quality Sentinel completed test quality analysis.

No test files were added or modified in this PR. Test Quality Sentinel skipped. This PR removes dead code and corresponding dead tests (53 lines deleted from print_test.go).

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

PR Code Quality Reviewer completed the code quality review.

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

Copilot AI 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

Removes unused console printing helpers and their tests.

Changes:

  • Removes six Print* helpers.
  • Removes their associated tests.
  • Leaves a broken README example and removes PrintVerboseMessage contrary to the stated scope.
Show a summary per file
File Description
pkg/console/print.go Removes six stderr printing helpers.
pkg/console/print_test.go Removes corresponding helper tests.

Review details

Tip

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

Comments suppressed due to low confidence (1)

pkg/console/print.go:38

  • This hunk also removes PrintVerboseMessage, making the change six function removals rather than the five stated in the title and description; the description explicitly says this function is retained. Restore it and its test, or update the PR scope and rationale if the sixth removal is intentional.
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Medium

Comment thread pkg/console/print.go
func PrintCommandMessage(command string) {
fmt.Fprintln(stderr, FormatCommandMessageStderr(command))
}

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Skills-Based Review 🧠

Applied /codebase-design — clean dead-code removal with one documentation gap to address.

📋 Key Themes & Highlights

Issues

  • Stale README example: pkg/console/README.md line 408 still references PrintProgressMessage which was removed. This will mislead future package consumers. (Already flagged in an existing review comment — needs follow-up.)
  • PR description inaccuracy: The description states PrintVerboseMessage was retained, but the diff shows it was also removed (test TestPrintVerboseMessage deleted, function gone from print.go). The note should be corrected.

Positive Highlights

  • ✅ All removed functions were genuinely dead — no production callers found
  • ✅ Tests removed alongside their functions (no orphaned tests)
  • ✅ Build, vet, fmt, and package tests verified before submitting
  • ✅ Surgical, minimal diff with no collateral changes

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 25.3 AIC · ⌖ 4.54 AIC · ⊞ 6.7K
Comment /matt to run again

@github-actions github-actions Bot mentioned this pull request Jul 22, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

LGTM — clean dead-code removal.

All 6 deleted Print* functions are confirmed to have zero production callers (verified via grep). Build and tests passed per CI run linked in the PR. The corresponding Format* peers are either still referenced elsewhere or can be cleaned up in a follow-up.

Minor note: the PR description says PrintVerboseMessage was "retained" but the diff removes it and its test — the description is slightly inaccurate, though the code change itself is correct.

🔎 Code quality review by PR Code Quality Reviewer · sonnet46 43.3 AIC · ⌖ 4.49 AIC · ⊞ 5.7K
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Review

The removals are correct — no callers exist for any of the 5 deleted functions. However, pkg/console/README.md (line 408) still contains a usage example calling console.PrintProgressMessage("Downloading release..."), which no longer exists. This stale documentation reference must be updated before merging.

Also: the PR description states PrintVerboseMessage was retained, but it was actually removed along with its test. The removal is correct (no callers), but the description is inaccurate.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · sonnet46 36.8 AIC · ⌖ 4.48 AIC · ⊞ 5K

@pelikhan
pelikhan merged commit d4b7d7f into main Jul 22, 2026
24 checks passed
@pelikhan
pelikhan deleted the chore/dead-code-print-functions-20260722-e3ebed783200394c branch July 22, 2026 15:40
@github-actions

Copy link
Copy Markdown
Contributor Author

🎉 This pull request is included in a new release.

Release: v0.83.0

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

Labels

chore closed:unknown PR was closed without merging: unknown dead-code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants