Remove unused using directives#40
Open
anagnorisis2peripeteia wants to merge 1 commit into
Open
Conversation
Remove 158 unused using directives flagged by the IDE0005 analyzer during a full-reference build. Pure removal, no code changes.
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.
Part of #38 (dead-code audit).
What
Remove 158 unused
usingdirectives across 96 files inDS4WinWPF, flagged by the IDE0005analyzer during a full-reference build. Pure removal — no code changes.
Why the extra care (WPF makes this non-trivial)
Unused-using detection is unreliable on this project via the obvious route:
dotnet format'sIDE0005 pass runs in a Roslyn workspace that doesn't fully resolve the project's package
references (ViGEm / FakerInput / OSC), so it falsely flags live usings as unused (e.g.
Nefarius.ViGEm.Client) and would break the build.So this PR removes only the usings flagged by IDE0005 during a real, full-reference
dotnet build(EnforceCodeStyleInBuild=true), and then verifies every removal bycompiling — no removal is trusted until the compiler proves it unnecessary.
How verified
All four shipping configurations compile with zero errors (a using needed only by an
#if WIN64(x86) or#if DEBUGbranch would fail one of these):The single test failure (
CheckSettingsRead) is a pre-existing en-GB date-locale snapshotmismatch (Expected
05/12vs Actual12/05), identical on untouchedupstream/main— notintroduced here.
Authored with Claude (Opus 4.8).
Review history: https://gist.github.com/81d5826c23e2eb0dfdedaade7421e647