Repository navigation
Fix duplicate warnings for ATC220 and ATC221 - #13
Merged
Merged
Conversation
… warnings with ATC221 - Add exclude_common_namespaces option to ATC220 (default: true) - ATC220 reads ATC221's namespace_prefixes to skip common namespaces - Update tests to cover both default exclusion and explicit opt-out - Update sample apps to reflect new complementary behavior - Update ATC220/ATC221 docs and CLAUDE.md with configuration details
davidkallesen
force-pushed
the
feature/Fix-double-for-ATC220-and-ATC221
branch
from
April 1, 2026 12:21
8034a3f to
788934e
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.
Summary
When both ATC220 and ATC221 are enabled (both default to enabled), a single using directive like using System; produces two warnings — one from each rule. This PR makes the rules complementary by having ATC220 automatically exclude namespaces that ATC221 handles, so each using directive triggers at most one warning.
A new .editorconfig option dotnet_diagnostic.ATC220.exclude_common_namespaces (default: true) controls this behavior. ATC220 reads ATC221's namespace_prefixes to determine which namespaces to skip, keeping the two rules in sync even with custom prefix configurations.
Changes
✨ Features
♻️ Refactoring
📝 Documentation
Notes