Repository navigation
chore(go): remove unused exported declarations and enforce AST check in codequality - #1277
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request cleans up numerous unused types, constants, variables, and files across the codebase, aligning with the monorepo's policy of direct unification without retaining legacy shims. It also introduces a new code quality check tool (unused-exports) to detect unused exported declarations in pkg/ and unregistered task variables in *_impl packages, integrating it into the linting pipeline. A review comment suggests including the internal/ directory in the code quality tool's package scanner to prevent false positives for symbols referenced in internal packages.
kyasbal
force-pushed
the
push-wtxqxzwlokuq
branch
from
November 17, 2026 06:28
2bb6d9b to
f6e9ddc
Compare
Go Quality Report (
|
| Metric | Result |
|---|---|
| Changed Scope | 4 prod file(s), 2 test file(s), 34 unit(s) |
| Patch Coverage | 98.6% (215/218 lines) |
| Mutation Score | 100.0% (86/86 killed, 0 survived) |
| Function Similarity | OK (26 new unit(s), 0 matches across 2533 corpus units) |
Commit: 319ea27ae48d · Cloud Build Logs
kyasbal
force-pushed
the
push-wtxqxzwlokuq
branch
from
November 17, 2026 07:51
f6e9ddc to
acfcb20
Compare
kyasbal
force-pushed
the
push-wtxqxzwlokuq
branch
from
November 18, 2026 01:40
acfcb20 to
319ea27
Compare
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.
Background
Standard Go static analysis tools (
unused,deadcode) only track function call reachability or unexported symbols within a single package. In a monorepo application, exported types, constants, errors,TaskIDdeclarations, and package-level timeline style variables (style.MustRegister*) can remain completely unreferenced across the entire repository without triggering any linter—especially package-level variables initialized by function calls, which remain live ininit()and even inflate generated icon atlases.Approach
Add a
--unused-exportscheck mode toscripts/codequality(scripts/codequality/internal/astcheck/unused_exports.go) usinggolang.org/x/tools/go/packagestype information across the repository, and wire it intomake lint-goand GitHub Actions (backend-tests):unused-exported-decl: Flags exported package-leveltype,var,const, andfuncdeclarations in non-generated production Go packages that have zero references across all production and test packages in the repository.unregistered-impl-task: Flagspkg/task/inspection/**/impltask variables that are omitted fromRegister(registry)and unreferenced elsewhere, catching tasks forgotten during wiring.Remove all existing unreferenced exported declarations and regenerate the embedded icon atlas after dropping unused timeline revision states.