You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 92d9aa3
Browse filesBrowse the repository at this point in the historyBrowse files
authored
Avoid false duplicate-code reports for required AOT attributes (#11749)
-**Impact**: Where duplication occurs (critical paths, frequently called code)
122
122
-**Maintainability**: How duplication affects code maintainability
123
123
-**Refactoring Opportunity**: Whether duplication can be easily refactored
124
+
-**Semantic Equivalence**: Verify that a proposed extraction preserves compiler, analyzer, linker, and runtime behavior
125
+
-**Existing Safeguards**: Search tests for guards that already keep intentionally repeated declarations synchronized
124
126
125
127
### 4. Issue Reporting
126
128
127
129
Create separate issues for each distinct duplication pattern found (maximum 3 patterns per run). Each pattern should get its own issue to enable focused remediation.
128
130
129
131
**When to Create Issues**:
130
132
- Only create issues if significant duplication is found (threshold: >10 lines of duplicated code OR 3+ instances of similar patterns)
133
+
- Require at least one concrete, behavior-preserving refactoring approach; use `noop` when language or tooling semantics require the repetition
131
134
-**Create one issue per distinct duplication pattern** - do NOT bundle multiple patterns in a single issue
132
135
- Limit to the top 3 most significant patterns if more are found
133
136
- Use the `create_issue` tool from safe-outputs MCP **once for each pattern**
@@ -158,6 +161,7 @@ Create separate issues for each distinct duplication pattern found (maximum 3 pa
158
161
-**All workflow files** (files under `.github/workflows/*`)
- Declaration-site attributes, annotations, or modifiers that compilers, analyzers, linkers, or runtimes require on every affected member. In particular, do not suggest wrapping built-in trimming or AOT attributes in a custom attribute when that would stop caller diagnostics.
161
165
- Small code snippets (<5 lines) unless highly repetitive
// Trimming and AOT diagnostics require the framework attributes to be applied directly to every public
9
+
// overload. StructuralEquivalenceAssertions_DeclareTrimAndAotRequirements keeps the repeated declarations
10
+
// synchronized.
8
11
#if NET5_0_OR_GREATER
9
12
privateconststringEquivalenceRequiresUnreferencedCodeMessage="Structural comparison uses reflection over runtime types, whose members cannot be statically preserved.";
0 commit comments