feat(analyzers): renumber to 9 domain bands, 2.0.0 break - #174
Conversation
89 ids were sprawled across AL0001..AL0139 with sparse gaps (~64% density, big holes at AL0061-0079, AL0085-0093, AL0096-0100, AL0131-0136). Renumbered to 9 100-wide bands in AL1000..AL1899 — deliberately skipping AL0xxx because sibling packages already occupy that space: ANcpLua.AotReflection AL0097..0100 ANcpLua.ExtensibleEnumMirror AL0200..0202 ANcpLua.DiscriminatedUnion AL0300..0303 Bands (full mapping at eng/analyzer-renumber-plan.md): AL1000..1099 Correctness / language pitfalls (13 rules) AL1100..1199 ASP.NET Core (10) AL1200..1299 Roslyn Utilities (21) AL1300..1399 Async / threading / reliability (15) AL1400..1499 AOT / trim (10) AL1500..1599 Roslyn-author hygiene (6) AL1600..1699 Package / version (7) AL1700..1799 Style (4) AL1800..1899 Agent governance ([LoomTool]) (3) Reserved AL0xxx for sibling-package use; reserved AL1900..1999 for future bands. Each band leaves ~79 free slots — no future re-renumber required. Wave delivered by a parallel agent team: planner (488-line plan with 9-band scheme + 89→89 deterministic mapping + cross-team migration scan), renumber executor (186 git mv + 2,489 substitutions), README author (single-screen ANcpLua.Agents style, 89-row table grouped by band), consumer rewirer (330 substitutions across 4 sibling repos), cleanup (132 reorder ops + 11 stale-id deletions). Side cleanup: 44 orphan AL resx prefix groups deleted (~132 keys + ~117 Designer entries). Those were the OTel-shaped rules that previously migrated to Qyl.OpenTelemetry.SemanticConventions.Analyzers — forensic evidence of the cross-package migration that no consumer depends on. Cross-team migration candidates flagged: zero. Pure ANcpLua-internal renumber. ASP.NET Core rules (AL1105-1108) are resilience/health-check contracts, not OTel semconv; GenAI rules (AL1800-1802) enforce [LoomTool] agent governance, not gen_ai.* semconv. Verified locally: 0/0 build, 757/757 tests pass, dotnet pack src/ANcpLua.Analyzers/ANcpLua.Analyzers.csproj -p:PackageId=ANcpLua.Analyzers -p:Version=2.0.0 produces the canonical nupkg (per nuget-publish.yml). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@coderabbitai autofix |
|
Claude encountered an error after 2s —— View job I'll analyze this and get back to you. |
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Autofix skipped. No unresolved CodeRabbit review comments with fix instructions found. |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 2083 |
| Duplication | 187 |
AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
Pull Request Overview
This PR successfully implements a major renumbering of 89 diagnostic rules into domain-specific bands, aligning with the 2.0.0 version bump. Codacy analysis indicates the project remains up to standards, although the massive refactor has introduced significant structural duplication (187 clones) due to the repetitive nature of analyzer registration boilerplate.
While the primary renumbering logic is sound, there are high-risk areas concerning several complex files that currently lack test coverage, specifically regarding CancellationToken propagation, type hierarchy analysis, and LINQ materialization. Additionally, the breaking nature of this change necessitates a proactive documentation redirect strategy and an update to AI agent instruction sets to prevent the continued generation of legacy AL0xxx IDs.
About this PR
- This release will invalidate every existing .editorconfig suppression and #pragma warning in dependent codebases. Ensure this impact is prominently highlighted in the release notes beyond the current CHANGELOG entry.
- Help-link URLs provided by AlAnalyzer.HelpLink will result in 404 errors until the documentation site is redeployed with the new rule paths. A redirect strategy for the old AL0xxx paths is highly recommended to maintain developer experience.
1 comment outside of the diff
src/ANcpLua.Analyzers/AlAnalyzer.cs
line 19⚪ LOW RISK
Suggestion: This refactor has significantly increased structural duplication (187 clones). The logic forRegisterActionsandSupportedDiagnosticsfollows a rigid template now repeated across 89 classes. Consider evolving theAlAnalyzerbase class to support a more declarative API to reduce maintenance overhead. Suggested prompt for your IDE agent: 'Identify the structural patterns used in RegisterActions and SupportedDiagnostics across the Analyzers folder. Refactor the AlAnalyzer base class to provide a declarative API that automates these registrations based on internal constants.'
Test suggestions
- Verify renumbered Diagnostic IDs (AL1000-AL1899) satisfy the convention test regex '^AL\d{4}$'
- Renamed analyzer class names satisfy the naming convention test '^Al\d{4}.*Analyzer$'
- Orphaned OTel resource keys are removed from both Resources.resx and CodeFixResources.resx
- Resource-based localization interpolation in AlAnalyzer.CreateRule works with the new 4-digit numeric IDs
- Static documentation (README) full rule catalog table matches the renumbered IDs and categories
- Unit test coverage for complex logic in AL1313CancellationTokenPropagationAnalysis.cs
- Unit test coverage for complex logic in AL1202UseTypeHierarchyAnalyzer.cs
- Unit test coverage for complex logic in AL1311UnnecessaryLinqMaterializationAnalyzer.cs
- Unit test coverage for complex logic in AL1500ClosedTypeHierarchySwitchAnalyzer.cs
- Unit test coverage for complex logic in AL1606OutdatedMafPackageVersionAnalyzer.cs
- Unit test coverage for complex logic in AL1100ToAL1104FormBindingAnalyzer.cs
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Unit test coverage for complex logic in AL1313CancellationTokenPropagationAnalysis.cs
2. Unit test coverage for complex logic in AL1202UseTypeHierarchyAnalyzer.cs
3. Unit test coverage for complex logic in AL1311UnnecessaryLinqMaterializationAnalyzer.cs
4. Unit test coverage for complex logic in AL1500ClosedTypeHierarchySwitchAnalyzer.cs
5. Unit test coverage for complex logic in AL1606OutdatedMafPackageVersionAnalyzer.cs
6. Unit test coverage for complex logic in AL1100ToAL1104FormBindingAnalyzer.cs
TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback
|
|
||
| - **Diagnostic ID renumber.** All 89 active diagnostic IDs renumbered into nine 100-wide domain bands (`AL1000..AL1899`) to avoid collisions with sibling analyzer packages (`ANcpLua.AotReflection` AL0097–AL0100, `ANcpLua.ExtensibleEnumMirror` AL0200–AL0202, `ANcpLua.DiscriminatedUnion` AL0300–AL0303). Old `AL0xxx` IDs no longer fire from this assembly. Full old→new mapping in `eng/analyzer-renumber-plan.md` §2. Consumers must rewrite any `.editorconfig` / `.globalconfig` / `#pragma warning disable` / `<NoWarn>` references to the new IDs. | ||
| - Resource keys in `Resources.resx` and `CodeFixResources.resx` renamed in lockstep (`AL{old}AnalyzerTitle` → `AL{new}AnalyzerTitle`, etc.). | ||
| - Help-link URLs follow the new IDs (`https://ancplua.mintlify.app/analyzers/rules/AL1000` etc.). |
There was a problem hiding this comment.
⚪ LOW RISK
Nitpick: Since the AlAnalyzer.HelpLink format is changing, ensure that the documentation site implements a redirect strategy from the old AL0xxx URL paths to the new AL1xxx domain band paths. This will prevent 404 errors for users with legacy .editorconfig settings.
| Analyzers/AL0XXX*.cs # one analyzer, or one grouped analyzer, per file | ||
| Analyzers/AsyncContextHelper.cs | ||
| src/ANcpLua.Analyzers.CodeFixes/ | ||
| CodeFixes/AL0XXX*.cs # One file per code fix | ||
| Refactorings/AR0XXX*.cs # Code refactorings | ||
| tests/ANcpLua.Analyzers.Tests/ # Tests both analyzers and code fixes (xunit.v3.mtp-v2) | ||
| CodeFixes/AL0XXX*.cs | ||
| Refactorings/AR0XXX*.cs | ||
| tests/ANcpLua.Analyzers.Tests/ | ||
| AL0XXX*Tests.cs | ||
| ``` | ||
|
|
||
| ## Analyzer Template | ||
| ## Analyzer Shape | ||
|
|
||
| Single-rule analyzer: | ||
|
|
||
| ```csharp | ||
| namespace ANcpLua.Analyzers.Analyzers; | ||
|
|
||
| [DiagnosticAnalyzer(LanguageNames.CSharp)] | ||
| public sealed partial class Al00xxDescriptiveNameAnalyzer : AlAnalyzer { | ||
| private const string DiagnosticId = "AL00XX"; | ||
|
|
||
| private static readonly DiagnosticDescriptor Rule = CreateRule( | ||
| DiagnosticId, DiagnosticCategories.Category, DiagnosticSeverity.Warning); | ||
| DiagnosticId, | ||
| DiagnosticCategories.Usage, | ||
| DiagnosticSeverity.Warning); | ||
|
|
||
| public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => [Rule]; | ||
|
|
||
| protected override void RegisterActions(AnalysisContext context) => | ||
| context.RegisterSyntaxNodeAction(Analyze, SyntaxKind.Whatever); | ||
| context.RegisterSyntaxNodeAction(Analyze, SyntaxKind.InvocationExpression); | ||
|
|
||
| private static void Analyze(SyntaxNodeAnalysisContext context) { | ||
| context.ReportDiagnostic(Rule, location, arg0); | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| - Each analyzer owns its own `DiagnosticId` as `const string` — NO shared DiagnosticIds class | ||
| - **Visibility rule:** `public` only if a `CodeFixProvider` references it, otherwise `private` (matches the official Roslyn SDK template) | ||
| - Use `CreateRule()` for single-rule analyzers, manual `new DiagnosticDescriptor(...)` for grouped | ||
| - `HelpLink(id)` appends the ID to the Mintlify docs base URL | ||
| Naming contract: | ||
|
|
||
| | Element | Rule | | ||
| | --- | --- | | ||
| | File | `Analyzers/AL00XXDescriptiveNameAnalyzer.cs` | | ||
| | Class | `Al00xxDescriptiveNameAnalyzer`; use `Al`, not `AL` | | ||
| | Modifier | `sealed partial class` | | ||
| | Base | `AlAnalyzer` | | ||
| | Namespace | `ANcpLua.Analyzers.Analyzers` | | ||
| | Diagnostic ID | Per-analyzer `const string`; no central `DiagnosticIds` class | | ||
|
|
||
| Diagnostic ID visibility: | ||
|
|
||
| ## TypeCache Pattern (preferred for 2+ type resolutions) | ||
| - `private` by default. | ||
| - `public` only when a sibling code fix references it via `FixableDiagnosticIds => [Al00xxAnalyzer.DiagnosticId]`. | ||
| - Do not make IDs public preemptively. | ||
|
|
||
| Descriptor construction: | ||
|
|
||
| - Single-rule analyzers use `CreateRule(id, category, severity)`. | ||
| - Grouped analyzers with multiple IDs in one class may manually create `DiagnosticDescriptor` instances with `LocalizableResourceString`. | ||
| - Do not manually construct single-rule descriptors. | ||
|
|
||
| Grouped analyzer skeleton: | ||
|
|
||
| ```csharp | ||
| private enum KnownType { Task, TaskOfT, ValueTask, ValueTaskOfT } | ||
| private static readonly string[] KnownTypeNames = [ | ||
| "System.Threading.Tasks.Task", "System.Threading.Tasks.Task`1", | ||
| "System.Threading.Tasks.ValueTask", "System.Threading.Tasks.ValueTask`1" ]; | ||
| [DiagnosticAnalyzer(LanguageNames.CSharp)] | ||
| public sealed partial class Al1003ToAl1004SpanComparisonAnalyzer : AlAnalyzer { | ||
| public const string DiagnosticIdAl1003 = "AL1003"; | ||
| public const string DiagnosticIdAl1004 = "AL1004"; | ||
|
|
||
| private static readonly DiagnosticDescriptor RuleAl1003 = new( | ||
| DiagnosticIdAl1003, | ||
| new LocalizableResourceString(nameof(Resources.AL1003AnalyzerTitle), Resources.ResourceManager, typeof(Resources)), | ||
| new LocalizableResourceString(nameof(Resources.AL1003AnalyzerMessageFormat), Resources.ResourceManager, typeof(Resources)), | ||
| DiagnosticCategories.Usage, | ||
| DiagnosticSeverity.Warning, | ||
| true, | ||
| new LocalizableResourceString(nameof(Resources.AL1003AnalyzerDescription), Resources.ResourceManager, typeof(Resources)), | ||
| HelpLinkBase); | ||
|
|
||
| public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => [RuleAl1003, RuleAl1004]; | ||
| } | ||
| ``` | ||
|
|
||
| var cache = new TypeCache<KnownType>( | ||
| type => context.Compilation.GetTypeByMetadataName(KnownTypeNames[(int)type])); | ||
| ## Resources And Releases | ||
|
|
||
| Each new diagnostic needs three `Resources.resx` keys: | ||
|
|
||
| ```text | ||
| AL00XXAnalyzerTitle | ||
| AL00XXAnalyzerMessageFormat | ||
| AL00XXAnalyzerDescription | ||
| ``` | ||
|
|
||
| Adopted in: AL0020, AL0024, AL0026, AL0030, AL0105, AL0106. (Re-grep `new TypeCache<` under `src/ANcpLua.Analyzers/Analyzers/` if this list looks suspect — analyzers come and go faster than this prose.) | ||
| `AnalyzerReleases.Unshipped.md` gets one row per diagnostic under `### New Rules`: | ||
|
|
||
| ```text | ||
| Rule ID | Category | Severity | Notes | ||
| --------|----------|----------|------- | ||
| AL00XX | Usage | Warning | Al00xxDescriptiveNameAnalyzer |
There was a problem hiding this comment.
⚪ LOW RISK
Nitpick: Update diagnostic ID wildcards, class names, and template strings in AGENTS.md (e.g., lines 38, 55, 78, 124, 245) from the legacy AL0XXX/Al00xx range to the new AL1XXX/Al1XXX range to ensure consistency with the 2.0.0 renumbering scheme.
Triage Bot report
Threads marked |
1 similar comment
Triage Bot report
Threads marked |
Summary by CodeRabbitRelease Notes
WalkthroughGlobal renumbering: analyzers, code fixes, resources, docs, tests, and configs migrated from AL0xxx to AL1xxx bands; README/AGENTS rewritten; .editorconfig severities updated; docs generator retargeted; package/version props bumped; changelog added for 2.0.0. ChangesAnalyzer ID Renumbering to AL1xxx bands
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Possibly related PRs
|
There was a problem hiding this comment.
Actionable comments posted: 46
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
docs/analyzer-confidence-audit-2026-05-23.md (1)
1-73:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winClarify temporal intent: frozen audit vs living analysis.
This audit was dated 2026-05-23, but now references the post-renumber AL1xxx IDs. If this is a historical snapshot taken before the renumber, the ID updates create a contradiction—the audit would be claiming it analyzed AL1703 in May when that ID didn't exist yet. If it's a living document maintained post-renumber, it needs a header note stating "Updated after 2.0.0 renumber; original audit used AL0xxx IDs—see eng/analyzer-renumber-plan.md for mapping."
Recommendation: Add a header block after line 1 clarifying whether this is a frozen historical record (in which case, revert to AL0xxx IDs and add a footer mapping to AL1xxx) or a living doc (in which case, add a note that it was updated post-renumber).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/analyzer-confidence-audit-2026-05-23.md` around lines 1 - 73, The document titled "Analyzer Confidence Audit - 2026-05-23" currently mixes pre- and post-renumber rule IDs (e.g., AL0140 vs AL1703) without stating whether this is a frozen historical snapshot or a living, updated audit; add a brief header paragraph under the main title that explicitly states which mode this file represents (either "Frozen: original audit using AL0xxx IDs — see eng/analyzer-renumber-plan.md for AL1xxx mappings" and revert displayed IDs to AL0xxx, or "Living: updated after 2.0.0 renumber; IDs are AL1xxx — original AL0xxx IDs mapped in eng/analyzer-renumber-plan.md"), and ensure the header references the document name and the example rules AL0140/AL1703 so readers can immediately see the mapping intent.eng/analyzer-renumber-plan.md (1)
481-489: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winFlag this plan as frozen historical record post-merge.
Once the renumber PR merges, this 488-line plan becomes a historical artifact. Add a header note after line 1 (or in a follow-up commit) stating:
> **Status:** Historical planning artifact. The renumber shipped in v2.0.0 on [date]. For the current AL1xxx rule catalog, see README.md. For the authoritative old→new mapping, see this file's section 2.This prevents future readers from treating the "Files to touch" checklist as current action items.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@eng/analyzer-renumber-plan.md` around lines 481 - 489, Add a clear "Status: Historical planning artifact" header to the top of eng/analyzer-renumber-plan.md indicating the renumber shipped in v2.0.0 (with date placeholder) and directing readers to README.md for the current AL1xxx catalog and to this file's section 2 for the authoritative old→new mapping; update the file header (immediately after the first line) to include that one-line note so future readers don't treat the 488-line checklist as actionable.src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1703UseImplicitTypeWhenApparentCodeFixProvider.cs (1)
24-27:⚠️ Potential issue | 🟠 Major | ⚡ Quick winequivalenceKey must use the analyzer's DiagnosticId for FixAll support.
Line 27 sets
equivalenceKeytoUseImplicitTypeTitle(a const string). Per coding guidelines, the equivalenceKey must be set to the analyzer'sDiagnosticId.Proposed fix
CodeAction.Create( UseImplicitTypeTitle, _ => UseImplicitType(document, root, syntax), - UseImplicitTypeTitle); + Al1703UseImplicitTypeWhenApparentAnalyzer.DiagnosticId);As per coding guidelines:
CreateCodeAction method must set equivalenceKey to the analyzer's DiagnosticId to enable FixAll support🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1703UseImplicitTypeWhenApparentCodeFixProvider.cs` around lines 24 - 27, The CodeAction created in CodeAction.Create currently uses UseImplicitTypeTitle as the equivalenceKey which prevents FixAll from working; change the equivalenceKey to the analyzer's DiagnosticId (use the DiagnosticId constant/field from this analyzer) while keeping the title and callback the same — update the CodeAction.Create call that references UseImplicitTypeTitle to pass the analyzer DiagnosticId as the third argument and ensure any helper CreateCodeAction wrappers follow the same pattern; leave the UseImplicitType(document, root, syntax) invocation and UseImplicitTypeTitle unchanged for UI text.
♻️ Duplicate comments (2)
CHANGELOG.md (1)
11-11: 🧹 Nitpick | 🔵 TrivialHelpLink URL redirect strategy is a docs-site deployment concern, not a CHANGELOG issue.
The past review comment flagging redirect strategy for old
AL0xxxURL paths is valid as operational advice, but implementing redirects is outside the scope of this repo's CHANGELOG. The changelog correctly documents the URL format change; ensure the Mintlify docs site deployment includes a redirect map (e.g.,AL0001→AL1000) before publishing 2.0.0.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@CHANGELOG.md` at line 11, Remove operational redirect guidance from CHANGELOG.md and keep only the factual note that help-link URLs now use the new IDs (e.g., AL1000); relocate the redirect/implementation instruction about mapping old AL0xxx → AL1000 to deployment/ops documentation or the release checklist so the changelog remains a user-facing record and not an operational task.AGENTS.md (1)
38-44: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick winUpdate template placeholders from AL0XXX to AL1XXX range.
Template examples and wildcards still use the legacy
AL0XXX/AL00XXrange (e.g., lines 38, 41, 44, 55–56, 78–79, 88, 124–126, 134, 245, 249, 276–277), but the 2.0.0 renumber reservesAL0xxxfor sibling packages and moves this repo's rules toAL1xxxbands. Update placeholders to use the new range (e.g.,AL1XXX*.cs,Al1xxxDescriptiveNameAnalyzer,"AL1XXX") to avoid confusion.Proposed template updates
- Analyzers/AL0XXX*.cs + Analyzers/AL1XXX*.cs- CodeFixes/AL0XXX*.cs + CodeFixes/AL1XXX*.cs- AL0XXX*Tests.cs + AL1XXX*Tests.cs-public sealed partial class Al00xxDescriptiveNameAnalyzer : AlAnalyzer { - private const string DiagnosticId = "AL00XX"; +public sealed partial class Al1xxxDescriptiveNameAnalyzer : AlAnalyzer { + private const string DiagnosticId = "AL1XXX";-| File | `Analyzers/AL00XXDescriptiveNameAnalyzer.cs` | -| Class | `Al00xxDescriptiveNameAnalyzer`; use `Al`, not `AL` | +| File | `Analyzers/AL1XXXDescriptiveNameAnalyzer.cs` | +| Class | `Al1xxxDescriptiveNameAnalyzer`; use `Al`, not `AL` |-AL00XXAnalyzerTitle -AL00XXAnalyzerMessageFormat -AL00XXAnalyzerDescription +AL1XXXAnalyzerTitle +AL1XXXAnalyzerMessageFormat +AL1XXXAnalyzerDescription-AL00XX | Usage | Warning | Al00xxDescriptiveNameAnalyzer +AL1XXX | Usage | Warning | Al1xxxDescriptiveNameAnalyzer-using AnalyzerTestBase = ANcpLua.Roslyn.Utilities.Testing.AnalyzerTest<ANcpLua.Analyzers.Analyzers.Al00xxDescriptiveNameAnalyzer>; +using AnalyzerTestBase = ANcpLua.Roslyn.Utilities.Testing.AnalyzerTest<ANcpLua.Analyzers.Analyzers.Al1xxxDescriptiveNameAnalyzer>;-public sealed partial class Al00xxDescriptiveNameTests : AnalyzerTestBase { +public sealed partial class Al1xxxDescriptiveNameTests : AnalyzerTestBase {-| File | `tests/ANcpLua.Analyzers.Tests/AL00XXDescriptiveNameTests.cs` | -| Class | `Al00xxDescriptiveNameTests` | +| File | `tests/ANcpLua.Analyzers.Tests/AL1XXXDescriptiveNameTests.cs` | +| Class | `Al1xxxDescriptiveNameTests` |Also applies to: 55-56, 78-79, 88-88, 124-126, 134-134, 245-245, 249-249, 276-277
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@AGENTS.md` around lines 38 - 44, Update every template placeholder and wildcard that currently uses the AL0XXX/AL00XX range to the AL1XXX/AL1xxx range: replace patterns like "AL0XXX*.cs", "AL00XX", analyzer class names such as "Al0xxxDescriptiveNameAnalyzer" and string IDs like "AL0XXX" with their AL1XXX equivalents (e.g., "AL1XXX*.cs", "Al1xxxDescriptiveNameAnalyzer", "AL1XXX"). Apply this change across all mentioned locations (lines referenced in the comment) including files/lists under Analyzers, CodeFixes, Refactorings, tests, and any template examples so the repo uses the AL1xxx numbering consistently. Ensure casing is preserved where appropriate (e.g., class names) and update any quoted IDs in templates/documentation to the AL1XXX form.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.editorconfig:
- Around line 1736-1743: The editorconfig contains a dead scoped suppression
block for Semconv files: locate the section with the header
"[src/ANcpLua.Analyzers/Semconv/*.cs]" and the setting
"dotnet_diagnostic.AL1210.severity = none" and either remove this entire scoped
block and its surrounding comment or change the glob to the actual Semconv
catalog path (or a broader pattern) so the AL1210 suppression applies where the
Semconv .cs files actually live; ensure the change keeps the comment/context
consistent with other .editorconfig entries.
In `@eng/analyzer-renumber-plan.md`:
- Around line 435-448: Update Section 8 of eng/analyzer-renumber-plan.md to
explicitly pick a release strategy and warn about the config-gap: state whether
you will (A) publish ANcpLua.Analyzers 2.0.0, then update
ANcpLua.NET.Sdk/src/Config/Analyzer.ANcpLua.Analyzers.editorconfig and bump the
ANcpLuaAnalyzersVersion in the SDK and publish the SDK (and include an explicit
warning to consumers about the transient broken dotnet_diagnostic.AL####
severities), or (B) perform a coordinated simultaneous release of
ANcpLua.Analyzers and ANcpLua.NET.Sdk with lockstep pins to avoid the gap;
include the chosen path, the exact steps (publish analyzers → update SDK
editorconfig → bump ANcpLuaAnalyzersVersion → publish SDK, or coordinated
publish), and a short consumer-facing warning text about the config-gap window
if option A is chosen.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1001SimplifyNegatedPatternCodeFixProvider.cs`:
- Around line 20-23: In AL1001SimplifyNegatedPatternCodeFixProvider, the
CodeAction.Create call currently uses
nameof(CodeFixResources.AL1001CodeFixTitle) as the equivalenceKey which prevents
stable FixAll grouping; update that third argument to use
Al1001DontRepeatNegatedPatternAnalyzer.DiagnosticId instead so all fixes for
this diagnostic share the same equivalence key (locate the
CodeAction.Create(...) call that returns a CodeAction and the
RemoveRepeatedNegatedPatterns(...) delegate and replace the equivalenceKey
accordingly).
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1003SpanPatternMatchingCodeFixProvider.cs`:
- Around line 16-19: The CodeAction.Create call is using
nameof(CodeFixResources.AL1003CodeFixTitle) as the equivalenceKey; change it to
use the analyzer diagnostic ID instead (e.g., use diagnostic.Id or the
analyzer's DiagnosticId constant such as AL1003Analyzer.DiagnosticId) so FixAll
works correctly; keep the title and the UsePatternMatching(document, syntax,
root) callback the same and only replace the equivalenceKey argument.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1004UseSequenceEqualCodeFixProvider.cs`:
- Around line 16-19: The CodeAction created in
AL1004UseSequenceEqualCodeFixProvider.cs currently uses
nameof(CodeFixResources.AL1004CodeFixTitle) as the equivalenceKey; change that
third parameter in the CodeAction.Create call to use the analyzer's public
diagnostic id Al1003ToAL1004SpanComparisonAnalyzer.DiagnosticIdAl1004 (i.e.
"AL1004") so FixAll groups correctly, referencing the CodeAction.Create
invocation and the Al1003ToAL1004SpanComparisonAnalyzer.DiagnosticIdAl1004
symbol.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1007IXmlSerializableCodeFixProvider.cs`:
- Around line 54-57: The CodeAction in AL1007IXmlSerializableCodeFixProvider is
using nameof(CodeFixResources.AL1007CodeFixTitle) as the equivalenceKey which
breaks FixAll; update the CodeAction.Create call to use the analyzer diagnostic
ID (DiagnosticIdAl1007) as the equivalenceKey instead so FixAll targets only
AL1007, i.e., replace the third argument in the CodeAction.Create invocation
with the DiagnosticIdAl1007 symbol (or the constant defined in the corresponding
analyzer) while keeping the title and the FixAsync(context.Document, target,
root) callback unchanged.
- Line 10: The class currently inherits directly from CodeFixProvider; change
its declaration to inherit from
AlCodeFixProvider<Al1007IXmlSerializableCodeFixProvider> (i.e., replace
"CodeFixProvider" with
"AlCodeFixProvider<Al1007IXmlSerializableCodeFixProvider>") and decorate the
class with [ExportCodeFixProvider(LanguageNames.CSharp)] and [Shared]
attributes; also add any missing using directives for
Microsoft.CodeAnalysis.CodeFixes and System.Composition so the attributes and
base type resolve. Ensure all existing overrides match the AlCodeFixProvider<T>
contract (adjust signatures if the base generic requires them).
In `@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1009LockTypeCodeFixProvider.cs`:
- Around line 44-47: The CodeAction Create call currently sets equivalenceKey to
nameof(CodeFixResources.AL1009CodeFixTitle) which breaks FixAll identity; change
the equivalenceKey argument in the CodeAction.Create invocation that constructs
the fix for ChangeFieldTypeToLockAsync (the CodeAction created with
CodeFixResources.AL1009CodeFixTitle) to use
Al1009LockKeywordAnalyzer.DiagnosticId instead so the fix’s equivalence key
equals the analyzer DiagnosticId.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1010PatternMatchingCodeFixProvider.cs`:
- Around line 18-21: Replace the hardcoded CodeAction title and equivalenceKey
in AL1010PatternMatchingCodeFixProvider with the repo convention: use the
resource-backed title from CodeFixResources (the entry that corresponds to
AL1010) as the first argument to CodeAction.Create, and use the analyzer
DiagnosticId for the equivalenceKey (not
nameof(Al1010PatternMatchingCodeFixProvider)); update the existing
CodeAction.Create call that wraps ConvertToPatternMatching(document, binary,
root) so its title references the appropriate CodeFixResources constant and its
equivalenceKey is the AL1010 analyzer DiagnosticId.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1011NormalizeNullGuardStyleCodeFixProvider.cs`:
- Around line 34-37: The code action currently uses
nameof(Al1011NormalizeNullGuardStyleCodeFixProvider) as the equivalenceKey which
breaks FixAll; change the equivalenceKey passed to CodeAction.Create to the
analyzer's DiagnosticId (e.g., use the DiagnosticId constant or descriptor.Id
for AL1011) instead of the provider type name so the Create call uses the
analyzer DiagnosticId as the equivalence key; update the CodeAction.Create
invocation in AL1011NormalizeNullGuardStyleCodeFixProvider to pass the
DiagnosticId value.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1012CombineDeclarationWithNullCheckCodeFixProvider.cs`:
- Around line 35-38: The CodeAction equivalenceKey is currently set to
nameof(Al1012CombineDeclarationWithNullCheckCodeFixProvider) which prevents
FixAll from working; change the third argument in the CodeAction.Create call to
the analyzer's DiagnosticId (for example use Al1012Analyzer.DiagnosticId or the
constant that holds "AL1012") so the equivalenceKey equals the analyzer ID; keep
the rest of the CodeAction.Create call (title and ct lambda invoking
CombineAsync) unchanged.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1200UseIsEqualToCodeFixProvider.cs`:
- Around line 21-24: The CodeAction.Create call in
Al1200UseIsEqualToCodeFixProvider currently uses
nameof(Al1200UseIsEqualToCodeFixProvider) as the equivalence key which breaks
FixAll grouping; update that CodeAction.Create invocation to pass
Al1200UseIsEqualToAnalyzer.DiagnosticId as the equivalenceKey instead (keep the
title and the callback to ConvertToIsEqualTo(document, invocation, root)
unchanged) so FixAll uses the analyzer's DiagnosticId for grouping.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1201UseHasAttributeCodeFixProvider.cs`:
- Around line 32-35: The CodeAction.Create call currently uses
nameof(Al1201UseHasAttributeCodeFixProvider) as the equivalenceKey which breaks
FixAll; change the equivalenceKey to the analyzer's DiagnosticId (e.g., use the
AL1201 analyzer's DiagnosticId constant/property) when creating the CodeAction
for ConvertToHasAttribute so the equivalence key equals the analyzer
DiagnosticId (AL1201) instead of the codefix type name.
- Around line 14-15: The class Al1201UseHasAttributeCodeFixProvider currently
inherits from CodeFixProvider; change it to inherit from the repo base
AlCodeFixProvider<TNode> with the appropriate syntax node type used by this
analyzer (replace CodeFixProvider with AlCodeFixProvider<TNode> using the
analyzer's node type), and add the required attributes
[ExportCodeFixProvider(LanguageNames.CSharp)] and [Shared] to the class
declaration so it follows the project's code-fix contract.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1202UseTypeHierarchyCodeFixProvider.cs`:
- Around line 15-16: The class Al1202UseTypeHierarchyCodeFixProvider currently
inherits directly from CodeFixProvider; change it to inherit from
AlCodeFixProvider<Al1202UseTypeHierarchyCodeFixProvider> and apply the
[ExportCodeFixProvider(LanguageNames.CSharp)] and [Shared] attributes above the
class declaration so it matches the repository provider shape; ensure you
preserve existing members like FixableDiagnosticIds and any overrides required
by AlCodeFixProvider<T>.
- Around line 35-38: The CodeAction.Create calls (the one creating the
implements action that calls ConvertToImplements and the other corresponding
action on lines 45-48) currently use a provider-suffixed string for equivalence
keys which breaks FixAll; change their equivalenceKey arguments to the analyzer
diagnostic id (AL1202) instead of nameof(Al1202UseTypeHierarchyCodeFixProvider)
+ "_Implements" (and the similar suffix used for the other action). Use the
constant/diagnostic id (e.g., DiagnosticIds.AL1202 or context.Diagnostics[0].Id)
as the equivalenceKey when constructing the CodeAction so FixAll will work,
leaving the title and the delegate (ConvertToImplements / the other conversion
method) unchanged.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1203UseOperationExtensionsCodeFixProvider.cs`:
- Around line 31-34: The CodeAction.Create calls in
Al1203UseOperationExtensionsCodeFixProvider currently use provider-name-derived
equivalence keys (e.g., nameof(Al1203UseOperationExtensionsCodeFixProvider) +
"_IsMethodNamed"); change both CodeAction.Create invocations (the one that calls
ConvertToIsMethodNamed and the other that calls ConvertToIsOperationNamed) to
use Al1203UseOperationExtensionsAnalyzer.DiagnosticId as the equivalenceKey so
FixAll works correctly.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1204UseOrEmptyCodeFixProvider.cs`:
- Around line 28-31: The CodeAction created in
AL1204UseOrEmptyCodeFixProvider.cs currently uses
nameof(Al1204UseOrEmptyCodeFixProvider) as the equivalence key; change the
CodeAction.Create call that wraps ConvertToOrEmpty(document, coalesce, root) so
its equivalenceKey is Al1204UseOrEmptyAnalyzer.DiagnosticId instead (i.e., pass
Al1204UseOrEmptyAnalyzer.DiagnosticId as the third argument) to enable proper
FixAll behavior and keep ConvertToOrEmpty and the surrounding method intact.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1205UseToImmutableArrayOrEmptyCodeFixProvider.cs`:
- Around line 25-28: The CodeAction.Create call in
Al1205UseToImmutableArrayOrEmptyCodeFixProvider is using
nameof(Al1205UseToImmutableArrayOrEmptyCodeFixProvider) as the equivalence key;
change that last argument to
Al1205UseToImmutableArrayOrEmptyAnalyzer.DiagnosticId so the created CodeAction
uses the analyzer's DiagnosticId for equivalence (leave the title and the
delegate to ConvertToExtension(document, coalesce, root) unchanged).
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1206UseWhereNotNullCodeFixProvider.cs`:
- Around line 27-30: The CodeAction created in
Al1206UseWhereNotNullCodeFixProvider currently uses
nameof(Al1206UseWhereNotNullCodeFixProvider) as the equivalenceKey; change that
third argument to Al1206UseWhereNotNullAnalyzer.DiagnosticId so the
CodeAction.Create call (the same call that wraps ConvertToWhereNotNull) uses the
analyzer's DiagnosticId as the equivalenceKey to enable correct FixAll grouping.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1207UseToDisplayStringExtensionsCodeFixProvider.cs`:
- Around line 39-42: The CodeAction.Create call in
AL1207UseToDisplayStringExtensionsCodeFixProvider is using
nameof(Al1207UseToDisplayStringExtensionsCodeFixProvider) as the equivalenceKey;
change it to use the analyzer's DiagnosticId
(Al1207UseToDisplayStringExtensionsAnalyzer.DiagnosticId) so FixAll works
correctly. Locate the CodeAction.Create invocation (the call that passes
CodeFixResources.AL1207CodeFixTitle and the ConvertToExtension lambda) and
replace the equivalenceKey argument with
Al1207UseToDisplayStringExtensionsAnalyzer.DiagnosticId.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1208UseGuardNotNullCodeFixProvider.cs`:
- Around line 27-30: The CodeAction call uses
nameof(Al1208UseGuardNotNullCodeFixProvider) as the equivalenceKey which breaks
FixAll; change the equivalenceKey argument in the CodeAction.Create invocation
(the call that passes CodeFixResources.AL1208CodeFixTitle and _ =>
ConvertToGuardNotNull(document, coalesce, root)) to use
Al1208UseGuardNotNullAnalyzer.DiagnosticId instead of
nameof(Al1208UseGuardNotNullCodeFixProvider) so the action’s equivalenceKey
matches the analyzer diagnostic ID and enables FixAll correctness.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1209UseTryParseExtensionsCodeFixProvider.cs`:
- Around line 27-30: The CodeAction.Create call currently uses
nameof(Al1209UseTryParseExtensionsCodeFixProvider) as the equivalenceKey; change
it to use Al1209UseTryParseExtensionsAnalyzer.DiagnosticId instead so FixAll
works correctly — update the CodeAction.Create invocation that passes
AL1209CodeFixTitle and the ConvertToExtension callback to set the third argument
to Al1209UseTryParseExtensionsAnalyzer.DiagnosticId (leave the title and
callback unchanged).
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1210UseStringComparisonExtensionsCodeFixProvider.cs`:
- Around line 39-42: The CodeAction.Create call currently uses
nameof(Al1210UseStringComparisonExtensionsCodeFixProvider) as the
equivalenceKey; change it to use
Al1210UseStringComparisonExtensionsAnalyzer.DiagnosticId instead so FixAll works
correctly—update the call that constructs the CodeAction (the one passing
CodeFixResources.AL1210CodeFixTitle and the lambda that calls
ConvertToExtensionMethod(document, invocation, root)) to set equivalenceKey to
Al1210UseStringComparisonExtensionsAnalyzer.DiagnosticId rather than the
provider name.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1211UseAttributeExtensionsCodeFixProvider.cs`:
- Around line 33-36: The CodeAction created in
Al1211UseAttributeExtensionsCodeFixProvider currently uses
nameof(Al1211UseAttributeExtensionsCodeFixProvider) as the equivalenceKey;
change it to use Al1211UseAttributeExtensionsAnalyzer.DiagnosticId instead so
FixAll works correctly. Locate the CodeAction.Create call (and related
overloads) around where ConvertToGetConstructorArgument(...) is passed and
replace the equivalenceKey argument with
Al1211UseAttributeExtensionsAnalyzer.DiagnosticId, ensuring the symbol is
referenced/imported if necessary.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1212UseGuardNotNullOrEmptyCodeFixProvider.cs`:
- Around line 33-36: The CodeAction created in the CodeAction.Create call
currently uses nameof(Al1212UseGuardNotNullOrEmptyCodeFixProvider) as the
equivalenceKey; change it to use
Al1212UseGuardNotNullOrEmptyAnalyzer.DiagnosticId instead so FixAll works
correctly — update the CodeAction.Create invocation that supplies
AL1212CodeFixTitle and the ConvertToGuardNotNullOrEmpty(document, ifStatement,
root) delegate to pass Al1212UseGuardNotNullOrEmptyAnalyzer.DiagnosticId as the
equivalenceKey.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1213UseGuardNotNullOrWhiteSpaceCodeFixProvider.cs`:
- Around line 27-30: The CodeAction is created with the provider name as the
equivalenceKey which breaks FixAll; change the equivalenceKey argument in the
CodeAction.Create call (the call that uses AL1213CodeFixTitle and
ConvertToGuardNotNullOrWhiteSpace) from
nameof(Al1213UseGuardNotNullOrWhiteSpaceCodeFixProvider) to
Al1213UseGuardNotNullOrWhiteSpaceAnalyzer.DiagnosticId so the action uses the
analyzer's DiagnosticId for correct FixAll behavior.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1214UseGuardNotZeroCodeFixProvider.cs`:
- Around line 37-39: The FixAll equivalence key is currently set to
nameof(Al1214UseGuardNotZeroCodeFixProvider) which can break FixAll bucketing;
update the RegisterCodeFix call in Al1214UseGuardNotZeroCodeFixProvider to use
Al1214UseGuardNotZeroAnalyzer.DiagnosticId as the equivalenceKey instead of
nameof(Al1214UseGuardNotZeroCodeFixProvider) so FixAll uses the analyzer
diagnostic id for consistent grouping.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1215UseGuardNotNegativeCodeFixProvider.cs`:
- Around line 28-30: The RegisterCodeFix call in
Al1215UseGuardNotNegativeCodeFixProvider currently uses
nameof(Al1215UseGuardNotNegativeCodeFixProvider) as the equivalenceKey; change
that argument to Al1215UseGuardNotNegativeAnalyzer.DiagnosticId so the
equivalenceKey matches the analyzer ID (keep the other args the same, i.e.,
CodeFixResources.AL1215CodeFixTitle and the _ =>
ConvertToGuardNotNegative(document, ifStatement, root) delegate).
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1216UseGuardPositiveCodeFixProvider.cs`:
- Around line 30-32: The FixAll equivalence key is currently set to the provider
name via nameof(Al1216UseGuardPositiveCodeFixProvider); update the third
argument of the RegisterCodeFix call to use the analyzer diagnostic ID by
replacing the equivalenceKey with Al1216UseGuardPositiveAnalyzer.DiagnosticId so
FixAll uses the analyzer's DiagnosticId; locate the RegisterCodeFix invocation
in AL1216UseGuardPositiveCodeFixProvider and change the equivalenceKey
accordingly.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1217UseGuardNotEmptyGuidCodeFixProvider.cs`:
- Around line 34-36: The equivalenceKey passed to RegisterCodeFix is currently
the code fix provider class name; change it to use the analyzer DiagnosticId
instead: replace the nameof(Al1217UseGuardNotEmptyGuidCodeFixProvider)
equivalenceKey with Al1217UseGuardNotEmptyGuidAnalyzer.DiagnosticId so the
FixAll operation keys correctly for the ConvertToGuardNotEmpty code action
registered in Al1217UseGuardNotEmptyGuidCodeFixProvider.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1218UseGuardDefinedEnumCodeFixProvider.cs`:
- Around line 28-30: The equivalenceKey currently uses
nameof(Al1218UseGuardDefinedEnumCodeFixProvider) which breaks FixAll; change the
equivalenceKey to the analyzer diagnostic id by replacing the third argument
from nameof(Al1218UseGuardDefinedEnumCodeFixProvider) to
Al1218UseGuardDefinedEnumAnalyzer.DiagnosticId in the CodeAction.Create call
that invokes ConvertToGuardDefinedEnum(document, ifStatement, root) inside
Al1218UseGuardDefinedEnumCodeFixProvider so FixAll groups diagnostics by the
analyzer ID rather than the provider name.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1220UseGuardForThrowIfCodeFixProvider.cs`:
- Around line 34-36: The FixAll equivalence key is incorrectly set to the
provider name; update the registration call in
AL1220UseGuardForThrowIfCodeFixProvider (the RegisterCodeFix invocation that
currently uses nameof(Al1220UseGuardForThrowIfCodeFixProvider)) to use
Al1220UseGuardForThrowIfAnalyzer.DiagnosticId as the equivalenceKey instead so
the fix is keyed by the analyzer DiagnosticId; keep the title
(CodeFixResources.AL1220CodeFixTitle) and callback (ConvertToGuard) the same.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1313CancellationTokenPropagationCodeFixProvider.cs`:
- Around line 23-25: The CodeAction in
AL1313CancellationTokenPropagationCodeFixProvider is using
CodeFixResources.AL1313CodeFixTitle as the equivalenceKey when creating the fix;
change the equivalenceKey to the analyzer ID by passing
Al1313CancellationTokenPropagationAnalyzer.DiagnosticId instead (update the
CodeAction creation that calls AddCancellationTokenAsync/document
invocation/root to use Al1313CancellationTokenPropagationAnalyzer.DiagnosticId
as the third argument).
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1314UseExplicitMidpointRoundingCodeFixProvider.cs`:
- Around line 30-32: The code action's equivalenceKey is currently set using
nameof(Al1314UseExplicitMidpointRoundingCodeFixProvider); change it to use
Al1314UseExplicitMidpointRoundingAnalyzer.DiagnosticId so the equivalenceKey
aligns with the analyzer ID for FixAll support—update the invocation that
registers the code action (the call passing CodeFixResources.AL1314CodeFixTitle,
_ => AppendMidpointRounding(document, invocation, root), nameof(...)) to replace
the nameof(...) argument with
Al1314UseExplicitMidpointRoundingAnalyzer.DiagnosticId.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1500AddMissingCasesCodeFixProvider.cs`:
- Around line 28-39: The CodeAction.Create calls that build fixes for
SwitchExpressionSyntax and SwitchStatementSyntax currently set equivalenceKey to
nameof(CodeFixResources.AL1500CodeFixTitle); change both equivalenceKey values
to the analyzer's DiagnosticId string so FixAll groups correctly (use the ID
constant your analyzer exposes, e.g., DiagnosticIds.AL1500 or
AL1500Analyzer.DiagnosticId) in the two CodeAction.Create invocations that call
FixSwitchExpression and FixSwitchStatement and keep the rest of the signature
the same.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1503NormalizeWhitespaceCodeFixProvider.cs`:
- Around line 32-38: The CodeAction created in context.RegisterCodeFix uses
nameof(CodeFixResources.AL1503CodeFixTitle) as the equivalenceKey; change the
third argument of CodeAction.Create in the RegisterCodeFix call so the
equivalenceKey is the analyzer diagnostic id (use diagnostic.Id) instead of the
resource name to enable correct FixAll grouping for the AL1503 fix handled by
RemoveNormalizeWhitespaceAsync.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1504DuckDbTableCodeFixProvider.cs`:
- Around line 28-34: The CodeAction equivalenceKey is currently set to
nameof(CodeFixResources.AL1504CodeFixTitle); change it to use the analyzer
diagnostic id so FixAll works: when creating the CodeAction in
context.RegisterCodeFix (the CodeAction.Create call that invokes
MakePartialAsync and uses CodeFixResources.AL1504CodeFixTitle), set the
equivalenceKey to the Diagnostic.Id (e.g., diagnostic.Id or the analyzer's
DiagnosticId constant) instead of the resource name.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1700StaticLambdaCodeFixProvider.cs`:
- Around line 22-27: The CodeAction registered in
AL1700StaticLambdaCodeFixProvider (context.RegisterCodeFix -> CodeAction.Create)
uses CodeFixResources.AL1700CodeFixTitle as the equivalenceKey; change it to the
analyzer diagnostic id so FixAll works: when creating the CodeAction for
MakeStaticAsync, pass the diagnostic's DiagnosticId (e.g., diagnostic.Id) as the
equivalenceKey instead of nameof(CodeFixResources.AL1700CodeFixTitle) so the
action's equivalenceKey matches the analyzer DiagnosticId.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1701DateTimeNowCodeFixProvider.cs`:
- Around line 22-25: The CodeAction.Create call in
AL1701DateTimeNowCodeFixProvider currently sets the equivalenceKey to the
provider class name; change it to use the analyzer's DiagnosticId to enable
FixAll support by replacing the current equivalenceKey
(nameof(Al1701DateTimeNowCodeFixProvider)) with the diagnostic's ID (e.g.,
diagnostic.Id or the analyzer's DiagnosticId constant such as
Al1701Analyzer.DiagnosticId) in the CodeAction.Create invocation that constructs
the fix for ConvertToTimeProvider.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1702UseSystemTextJsonCodeFixProvider.cs`:
- Around line 31-37: The CodeAction equivalenceKey is currently set to the
provider class name (nameof(Al1702UseSystemTextJsonCodeFixProvider)), which
breaks FixAll; change the equivalenceKey passed to CodeAction.Create to the
analyzer's DiagnosticId (use the Diagnostic.Id from the diagnostic parameter or
the analyzer constant) so the CodeAction's equivalenceKey matches the analyzer's
DiagnosticId and enables FixAll support—update the call in the RegisterCodeFix
block where CodeAction.Create is invoked (the invocation that builds the
CodeAction for ConvertToSystemTextJson) to supply diagnostic.Id instead of the
provider class name.
In `@src/ANcpLua.Analyzers/AnalyzerReleases.Unshipped.md`:
- Around line 8-96: The release table adds many AL0xxx ID changes (see
AnalyzerReleases.Unshipped.md and the AL0xxx entries) and downstream consumers
that rely on .editorconfig/NoWarn/test ID assertions will break unless migration
is coordinated; before publishing 2.0.0, gate the rollout: prepare and publish
the SDK-packaged analyzer .editorconfig/update that maps old->new IDs first,
communicate migration steps and timelines to dependent repos, and only then
publish the analyzer package and announce the change so downstream repos can
update NoWarn/test expectations in lockstep.
In `@tests/ANcpLua.Analyzers.Tests/AL1210UseStringComparisonExtensionsTests.cs`:
- Around line 103-104: Rename the test class Al1210CodeFixTests to match the
analyzer name and team convention: Al1210UseStringComparisonExtensionsTests.
Update the class declaration (the class identifier) so the class remains sealed
partial and continues to inherit from
CodeFixTest<Al1210UseStringComparisonExtensionsAnalyzer,
Al1210UseStringComparisonExtensionsCodeFixProvider>, and update any
references/usages of Al1210CodeFixTests in the test project (e.g., test runners
or other test helpers) to the new Al1210UseStringComparisonExtensionsTests
identifier.
In `@tests/ANcpLua.Analyzers.Tests/AL1220UseGuardForThrowIfTests.cs`:
- Line 11: Replace the direct inheritance from
AnalyzerTest<Al1220UseGuardForThrowIfAnalyzer> in the
Al1220UseGuardForThrowIfTests class with the local AnalyzerTestBase alias so the
class declares inheritance as
AnalyzerTestBase<Al1220UseGuardForThrowIfAnalyzer>; locate the class declaration
line containing "class Al1220UseGuardForThrowIfTests" and update the base type
accordingly (ensure the project has the AnalyzerTestBase alias
imported/defined).
In `@tests/ANcpLua.Analyzers.Tests/AL1300ToAL1303ThreadingTests.cs`:
- Line 9: Replace direct inheritance from
AnalyzerTest<Al1300ToAl1303ThreadingAnalyzer> with the standardized
AnalyzerTestBase alias by changing the class declaration to inherit from
AnalyzerTestBase<Al1300ToAl1303ThreadingAnalyzer>, and add a file-level using
alias declaration near the top of the file: define AnalyzerTestBase as an alias
for AnalyzerTest so the tests at symbols Al1300AnalyzerTests (and the other
three test classes at the referenced locations) use AnalyzerTestBase<TAnalyzer>
instead of AnalyzerTest<TAnalyzer>.
In `@Version.props`:
- Line 61: Update the pinned analyzer version variable ANcpLuaAnalyzersVersion
in Version.props from 1.29.4 to 2.0.0 after the new 2.0.0 package is published;
then make matching updates in the other repositories that reference this same
variable (ANcpLua.NET.Sdk, ErrorOrX, ANcpLua.Agents) so they pull the renumbered
diagnostics in lockstep, and add or update CI/scripted steps (or documentation)
to enforce the publish-first then bump sequence to avoid restore failures.
---
Outside diff comments:
In `@docs/analyzer-confidence-audit-2026-05-23.md`:
- Around line 1-73: The document titled "Analyzer Confidence Audit - 2026-05-23"
currently mixes pre- and post-renumber rule IDs (e.g., AL0140 vs AL1703) without
stating whether this is a frozen historical snapshot or a living, updated audit;
add a brief header paragraph under the main title that explicitly states which
mode this file represents (either "Frozen: original audit using AL0xxx IDs — see
eng/analyzer-renumber-plan.md for AL1xxx mappings" and revert displayed IDs to
AL0xxx, or "Living: updated after 2.0.0 renumber; IDs are AL1xxx — original
AL0xxx IDs mapped in eng/analyzer-renumber-plan.md"), and ensure the header
references the document name and the example rules AL0140/AL1703 so readers can
immediately see the mapping intent.
In `@eng/analyzer-renumber-plan.md`:
- Around line 481-489: Add a clear "Status: Historical planning artifact" header
to the top of eng/analyzer-renumber-plan.md indicating the renumber shipped in
v2.0.0 (with date placeholder) and directing readers to README.md for the
current AL1xxx catalog and to this file's section 2 for the authoritative
old→new mapping; update the file header (immediately after the first line) to
include that one-line note so future readers don't treat the 488-line checklist
as actionable.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1703UseImplicitTypeWhenApparentCodeFixProvider.cs`:
- Around line 24-27: The CodeAction created in CodeAction.Create currently uses
UseImplicitTypeTitle as the equivalenceKey which prevents FixAll from working;
change the equivalenceKey to the analyzer's DiagnosticId (use the DiagnosticId
constant/field from this analyzer) while keeping the title and callback the same
— update the CodeAction.Create call that references UseImplicitTypeTitle to pass
the analyzer DiagnosticId as the third argument and ensure any helper
CreateCodeAction wrappers follow the same pattern; leave the
UseImplicitType(document, root, syntax) invocation and UseImplicitTypeTitle
unchanged for UI text.
---
Duplicate comments:
In `@AGENTS.md`:
- Around line 38-44: Update every template placeholder and wildcard that
currently uses the AL0XXX/AL00XX range to the AL1XXX/AL1xxx range: replace
patterns like "AL0XXX*.cs", "AL00XX", analyzer class names such as
"Al0xxxDescriptiveNameAnalyzer" and string IDs like "AL0XXX" with their AL1XXX
equivalents (e.g., "AL1XXX*.cs", "Al1xxxDescriptiveNameAnalyzer", "AL1XXX").
Apply this change across all mentioned locations (lines referenced in the
comment) including files/lists under Analyzers, CodeFixes, Refactorings, tests,
and any template examples so the repo uses the AL1xxx numbering consistently.
Ensure casing is preserved where appropriate (e.g., class names) and update any
quoted IDs in templates/documentation to the AL1XXX form.
In `@CHANGELOG.md`:
- Line 11: Remove operational redirect guidance from CHANGELOG.md and keep only
the factual note that help-link URLs now use the new IDs (e.g., AL1000);
relocate the redirect/implementation instruction about mapping old AL0xxx →
AL1000 to deployment/ops documentation or the release checklist so the changelog
remains a user-facing record and not an operational task.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 7900c6da-3b61-40be-96c6-423395f6c23c
📒 Files selected for processing (215)
.editorconfigAGENTS.mdCHANGELOG.mdDirectory.Build.propsDirectory.Packages.propsREADME.mdVersion.propsdocs/Al1200UseIsEqualTo.mddocs/analyzer-confidence-audit-2026-05-23.mdeng/analyzer-renumber-plan.mdsrc/ANcpLua.Analyzers.AnalyzerDocs/ANcpLua.Analyzers.AnalyzerDocs.csprojsrc/ANcpLua.Analyzers.AnalyzerDocs/Al1200UseIsEqualToDocs.cssrc/ANcpLua.Analyzers.AnalyzerDocs/AlAnalyzerDocsGenerator.cssrc/ANcpLua.Analyzers.AnalyzerDocs/AlAnalyzerDocsVerifier.cssrc/ANcpLua.Analyzers.AnalyzerDocsGenerator/ANcpLua.Analyzers.AnalyzerDocsGenerator.csprojsrc/ANcpLua.Analyzers.CodeFixes/CLAUDE.mdsrc/ANcpLua.Analyzers.CodeFixes/CodeFixResources.Designer.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixResources.resxsrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1001SimplifyNegatedPatternCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1003SpanPatternMatchingCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1004UseSequenceEqualCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1007IXmlSerializableCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1009LockTypeCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1010PatternMatchingCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1011NormalizeNullGuardStyleCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1012CombineDeclarationWithNullCheckCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1200UseIsEqualToCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1201UseHasAttributeCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1202UseTypeHierarchyCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1203UseOperationExtensionsCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1204UseOrEmptyCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1205UseToImmutableArrayOrEmptyCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1206UseWhereNotNullCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1207UseToDisplayStringExtensionsCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1208UseGuardNotNullCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1209UseTryParseExtensionsCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1210UseStringComparisonExtensionsCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1211UseAttributeExtensionsCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1212UseGuardNotNullOrEmptyCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1213UseGuardNotNullOrWhiteSpaceCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1214UseGuardNotZeroCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1215UseGuardNotNegativeCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1216UseGuardPositiveCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1217UseGuardNotEmptyGuidCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1218UseGuardDefinedEnumCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1220UseGuardForThrowIfCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1313CancellationTokenPropagationCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1314UseExplicitMidpointRoundingCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1500AddMissingCasesCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1503NormalizeWhitespaceCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1504DuckDbTableCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1700StaticLambdaCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1701DateTimeNowCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1702UseSystemTextJsonCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1703UseImplicitTypeWhenApparentCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/Refactorings/AR0001SnakeCaseToPascalCaseRefactoring.cssrc/ANcpLua.Analyzers.CodeFixes/Refactorings/AR0002MakeStaticLambdaRefactoring.cssrc/ANcpLua.Analyzers/ANcpLua.Analyzers.csprojsrc/ANcpLua.Analyzers/AlAnalyzer.cssrc/ANcpLua.Analyzers/AnalyzerReleases.Unshipped.mdsrc/ANcpLua.Analyzers/Analyzers/AL1000ProhibitPrimaryConstructorParameterReassignmentAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1001DontRepeatNegatedPatternAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1002DontDivideByConstantZeroAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1003ToAL1004SpanComparisonAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1005FieldNameConflictWithPrimaryConstructorAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1006ToAL1008IXmlSerializableAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1009LockKeywordAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1010PreferPatternMatchingAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1011NormalizeNullGuardStyleAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1012CombineDeclarationWithNullCheckAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1100ToAL1104FormBindingAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1105MissingResilienceConfigurationAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1106MissingHealthChecksAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1107ConsiderConnectionStringAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1108MissingServiceDiscoveryAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1109AvoidTaskRunInAspNetCoreAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1200UseIsEqualToAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1201UseHasAttributeAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1202UseTypeHierarchyAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1203UseOperationExtensionsAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1204UseOrEmptyAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1205UseToImmutableArrayOrEmptyAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1206UseWhereNotNullAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1207UseToDisplayStringExtensionsAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1208UseGuardNotNullAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1209UseTryParseExtensionsAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1210UseStringComparisonExtensionsAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1211UseAttributeExtensionsAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1212UseGuardNotNullOrEmptyAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1213UseGuardNotNullOrWhiteSpaceAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1214UseGuardNotZeroAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1215UseGuardNotNegativeAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1216UseGuardPositiveAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1217UseGuardNotEmptyGuidAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1218UseGuardDefinedEnumAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1219UseStringComparisonAnyExtensionsAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1220UseGuardForThrowIfAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1300ToAL1303ThreadingAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1304PreferAwaitUsingAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1305AvoidBlockingCallsInAsyncAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1306SqlInterpolationInCommandTextAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1307FireAndForgetTaskAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1308PreferTryParseAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1309EmptyCatchBlockAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1310ExceptionLeakedInResponseAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1311UnnecessaryLinqMaterializationAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1312ReadModifyWriteWithoutTransactionAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1313CancellationTokenPropagationAnalysis.cssrc/ANcpLua.Analyzers/Analyzers/AL1313CancellationTokenPropagationAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1314UseExplicitMidpointRoundingAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1400AotTestMustReturnIntAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1401AotTestExitCode100Analyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1402TrimSafeViolationAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1403AotSafeViolationAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1404AotSafeCallsAotUnsafeAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1405UnnecessaryAotUnsafeAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1406AvoidDynamicKeywordAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1407AvoidExpressionCompileAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1408AvoidActivatorCreateInstanceAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1409AvoidTypeGetTypeAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1500ClosedTypeHierarchySwitchAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1501SymbolStoredInModelAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1502UseIncrementalGeneratorAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1503NormalizeWhitespaceAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1504DuckDbTableMustBePartialAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1505DuckDbColumnConflictingOrdinalAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1600HardcodedPackageVersionAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1601VersionPropsNotImportedAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1602UndefinedVersionVariableAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1603ToAL1605DiagnosticsAlignmentAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1606OutdatedMafPackageVersionAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1700PreferStaticLambdaAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1701AvoidDateTimeNowAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1702AvoidNewtonsoftJsonAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1703UseImplicitTypeWhenApparentAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1800DestructiveToolMustRequireApprovalAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1801ToolMustDeclareSideEffectAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1802ToolMustDeclareCapabilityAnalyzer.cssrc/ANcpLua.Analyzers/AotContext.cssrc/ANcpLua.Analyzers/CLAUDE.mdsrc/ANcpLua.Analyzers/CLAUDE.mdsrc/ANcpLua.Analyzers/Resources.Designer.cssrc/ANcpLua.Analyzers/Resources.resxsrc/ANcpLua.Analyzers/build/ANcpLua.Analyzers.propstests/ANcpLua.Analyzers.Tests/AL1000PrimaryConstructorReassignmentTests.cstests/ANcpLua.Analyzers.Tests/AL1001NegatedPatternTests.cstests/ANcpLua.Analyzers.Tests/AL1002DivisionByZeroTests.cstests/ANcpLua.Analyzers.Tests/AL1003ToAL1004SpanComparisonTests.cstests/ANcpLua.Analyzers.Tests/AL1005FieldNameConflictWithPrimaryConstructorTests.cstests/ANcpLua.Analyzers.Tests/AL1006ToAL1008IXmlSerializableTests.cstests/ANcpLua.Analyzers.Tests/AL1009LockKeywordTests.cstests/ANcpLua.Analyzers.Tests/AL1010PatternMatchingTests.cstests/ANcpLua.Analyzers.Tests/AL1011NormalizeNullGuardStyleTests.cstests/ANcpLua.Analyzers.Tests/AL1012CombineDeclarationWithNullCheckTests.cstests/ANcpLua.Analyzers.Tests/AL1100ToAL1104FormBindingTests.cstests/ANcpLua.Analyzers.Tests/AL1105MissingResilienceConfigurationTests.cstests/ANcpLua.Analyzers.Tests/AL1106MissingHealthChecksTests.cstests/ANcpLua.Analyzers.Tests/AL1107ConsiderConnectionStringTests.cstests/ANcpLua.Analyzers.Tests/AL1108MissingServiceDiscoveryTests.cstests/ANcpLua.Analyzers.Tests/AL1109AvoidTaskRunInAspNetCoreTests.cstests/ANcpLua.Analyzers.Tests/AL1200UseIsEqualToTests.cstests/ANcpLua.Analyzers.Tests/AL1201UseHasAttributeCodeFixTests.cstests/ANcpLua.Analyzers.Tests/AL1201UseHasAttributeTests.cstests/ANcpLua.Analyzers.Tests/AL1202UseTypeHierarchyTests.cstests/ANcpLua.Analyzers.Tests/AL1203UseOperationExtensionsTests.cstests/ANcpLua.Analyzers.Tests/AL1204UseOrEmptyTests.cstests/ANcpLua.Analyzers.Tests/AL1206UseWhereNotNullCodeFixTests.cstests/ANcpLua.Analyzers.Tests/AL1206UseWhereNotNullTests.cstests/ANcpLua.Analyzers.Tests/AL1208UseGuardNotNullTests.cstests/ANcpLua.Analyzers.Tests/AL1209UseTryParseExtensionsTests.cstests/ANcpLua.Analyzers.Tests/AL1210UseStringComparisonExtensionsTests.cstests/ANcpLua.Analyzers.Tests/AL1211UseAttributeExtensionsTests.cstests/ANcpLua.Analyzers.Tests/AL1212UseGuardNotNullOrEmptyTests.cstests/ANcpLua.Analyzers.Tests/AL1213UseGuardNotNullOrWhiteSpaceTests.cstests/ANcpLua.Analyzers.Tests/AL1214UseGuardNotZeroTests.cstests/ANcpLua.Analyzers.Tests/AL1215UseGuardNotNegativeTests.cstests/ANcpLua.Analyzers.Tests/AL1216UseGuardPositiveTests.cstests/ANcpLua.Analyzers.Tests/AL1217UseGuardNotEmptyGuidTests.cstests/ANcpLua.Analyzers.Tests/AL1218UseGuardDefinedEnumTests.cstests/ANcpLua.Analyzers.Tests/AL1219UseStringComparisonAnyExtensionsTests.cstests/ANcpLua.Analyzers.Tests/AL1220UseGuardForThrowIfCodeFixTests.cstests/ANcpLua.Analyzers.Tests/AL1220UseGuardForThrowIfTests.cstests/ANcpLua.Analyzers.Tests/AL1300ToAL1303ThreadingTests.cstests/ANcpLua.Analyzers.Tests/AL1304PreferAwaitUsingTests.cstests/ANcpLua.Analyzers.Tests/AL1305AvoidBlockingCallsInAsyncTests.cstests/ANcpLua.Analyzers.Tests/AL1306SqlInterpolationInCommandTextTests.cstests/ANcpLua.Analyzers.Tests/AL1307FireAndForgetTaskTests.cstests/ANcpLua.Analyzers.Tests/AL1308PreferTryParseTests.cstests/ANcpLua.Analyzers.Tests/AL1309EmptyCatchBlockTests.cstests/ANcpLua.Analyzers.Tests/AL1310ExceptionLeakedInResponseTests.cstests/ANcpLua.Analyzers.Tests/AL1311UnnecessaryLinqMaterializationTests.cstests/ANcpLua.Analyzers.Tests/AL1312ReadModifyWriteWithoutTransactionTests.cstests/ANcpLua.Analyzers.Tests/AL1313CancellationTokenPropagationTests.cstests/ANcpLua.Analyzers.Tests/AL1314UseExplicitMidpointRoundingCodeFixTests.cstests/ANcpLua.Analyzers.Tests/AL1314UseExplicitMidpointRoundingTests.cstests/ANcpLua.Analyzers.Tests/AL1401AotTestExitCode100Tests.cstests/ANcpLua.Analyzers.Tests/AL1403AotSafeViolationTests.cstests/ANcpLua.Analyzers.Tests/AL1404AotSafeCallsAotUnsafeTests.cstests/ANcpLua.Analyzers.Tests/AL1405UnnecessaryAotUnsafeTests.cstests/ANcpLua.Analyzers.Tests/AL1406AvoidDynamicKeywordTests.cstests/ANcpLua.Analyzers.Tests/AL1407AvoidExpressionCompileTests.cstests/ANcpLua.Analyzers.Tests/AL1501SymbolStoredInModelTests.cstests/ANcpLua.Analyzers.Tests/AL1502UseIncrementalGeneratorTests.cstests/ANcpLua.Analyzers.Tests/AL1503NormalizeWhitespaceTests.cstests/ANcpLua.Analyzers.Tests/AL1504DuckDbTableMustBePartialTests.cstests/ANcpLua.Analyzers.Tests/AL1505DuckDbColumnConflictingOrdinalTests.cstests/ANcpLua.Analyzers.Tests/AL1601VersionPropsNotImportedTests.cstests/ANcpLua.Analyzers.Tests/AL1602UndefinedVersionVariableTests.cstests/ANcpLua.Analyzers.Tests/AL1606OutdatedMafPackageVersionTests.cstests/ANcpLua.Analyzers.Tests/AL1700PreferStaticLambdaTests.cstests/ANcpLua.Analyzers.Tests/AL1701AvoidDateTimeNowTests.cstests/ANcpLua.Analyzers.Tests/AL1702AvoidNewtonsoftJsonTests.cstests/ANcpLua.Analyzers.Tests/AL1703UseImplicitTypeWhenApparentTests.cstests/ANcpLua.Analyzers.Tests/ANcpLua.Analyzers.Tests.csprojtests/ANcpLua.Analyzers.Tests/CLAUDE.md
| # Semconv catalog files — historical scoped suppression carried over from the | ||
| # pre-2.0 fork era when OTel semantic-convention analyzers (AL0074/AL0010) lived | ||
| # in this assembly. They moved to Qyl.OpenTelemetry.SemanticConventions.Analyzers | ||
| # and were deleted from this repo in 2.0.0. Only AL1210 (StringComparison | ||
| # extension) still needs scoping in case Semconv catalog files are reintroduced. | ||
| # ============================================================================= | ||
| [src/ANcpLua.Analyzers/Semconv/*.cs] | ||
| dotnet_diagnostic.AL0074.severity = none | ||
| dotnet_diagnostic.AL0010.severity = none | ||
| dotnet_diagnostic.AL0039.severity = none | ||
| dotnet_diagnostic.AL1210.severity = none |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Check if Semconv catalog files exist in the analyzer source tree.
# Test: Look for any .cs files under the Semconv directory.
fd -e cs . src/ANcpLua.Analyzers/Semconv/
# If no output, the scoped block is dead and should be deleted.Repository: ANcpLua/ANcpLua.Analyzers
Length of output: 187
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Locate any Semconv-related directories anywhere in the repo (case-insensitive),
# and list any .cs files beneath them.
echo "=== Semconv directories (case-insensitive) ==="
find . -type d -iname '*semconv*' -print | sed 's|^\./||'
echo "=== .cs files under Semconv directories ==="
find . -type f -iname '*semconv*' -iname '*.cs' -print | sed 's|^\./||'Repository: ANcpLua/ANcpLua.Analyzers
Length of output: 160
Editorconfig: scoped Semconv suppression likely dead code
The [src/ANcpLua.Analyzers/Semconv/*.cs] block setting dotnet_diagnostic.AL1210.severity = none is currently inert because there are no Semconv directories or .cs files anywhere in ANcpLua/ANcpLua.Analyzers. Remove the scoped section/comment or update the glob to the real Semconv catalog location. [.editorconfig ~1736-1743]
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.editorconfig around lines 1736 - 1743, The editorconfig contains a dead
scoped suppression block for Semconv files: locate the section with the header
"[src/ANcpLua.Analyzers/Semconv/*.cs]" and the setting
"dotnet_diagnostic.AL1210.severity = none" and either remove this entire scoped
block and its surrounding comment or change the glob to the actual Semconv
catalog path (or a broader pattern) so the AL1210 suppression applies where the
Semconv .cs files actually live; ensure the change keeps the comment/context
consistent with other .editorconfig entries.
| ## 8. Consumer scan (preliminary) | ||
|
|
||
| Repos in `~/RiderProjects/` that reference `AL####` literally and will need rewiring after the 2.0.0 break: | ||
|
|
||
| | Repo | Files referencing AL#### | Surface area | | ||
| |---------------------------------------|--------------------------|----------------------------------------------------------------------------------------------------| | ||
| | `ANcpLua.NET.Sdk` | 3 | `tools/.editorconfig` (1 line: AL0025), `src/Config/Analyzer.ANcpLua.Analyzers.editorconfig` (every AL#### with a per-rule severity block — high-traffic config that consumers inherit transitively via the SDK reference). | | ||
| | `ANcpLua.Roslyn.Utilities` | 6 | **Sibling-package owner of AL0097/0098/0099/0100/0200/0201/0202/0300/0301/0302/0303.** Not a consumer of ANcpLua.Analyzers IDs; it just uses the AL prefix for its own analyzers. No rewiring needed. One stale XML-doc comment in `AnalyzerTest.cs:201` references "AL0018" as an example — needs an AL→AL1602 update or a rewrite to a generic placeholder. | | ||
| | `ErrorOrX` | 1 | `.editorconfig` (4 lines: AL0025, AL0026, AL0027, AL0029) — all `style/usage` rules. | | ||
| | `qyl` | 2 | `.globalconfig` (25+ lines covering AL0001-0025) and `.editorconfig` (similar set). High-impact — this is the largest downstream consumer. | | ||
| | `TourPlanner` | 1 | `.editorconfig` line 18: `dotnet_diagnostic.AL0038.severity = none` — **stale** (AL0038 has never existed in this repo; safe to delete). | | ||
|
|
||
| 5 repos will need rewiring. The largest by surface area: `qyl/.globalconfig` and `ANcpLua.NET.Sdk/src/Config/Analyzer.ANcpLua.Analyzers.editorconfig`. The `qyl` repo's existing OTel-shaped configs (e.g., `qyl/.globalconfig:101 # AL0013 # Missing schema URL`) reference IDs that **no longer exist in ANcpLua.Analyzers** — those are leftover dead config from the original AL-prefixed OTel analyzer; the al-qyl-rewire agent should delete them outright rather than try to map them. | ||
|
|
There was a problem hiding this comment.
Cross-repo publish order creates a config-gap window.
Section 8 identifies that ANcpLua.NET.Sdk/src/Config/Analyzer.ANcpLua.Analyzers.editorconfig packages AL0xxx severity blocks, and consumers inherit this transitively. If you publish ANcpLua.Analyzers 2.0.0 before the SDK updates and republishes its packaged editorconfig, consumers who restore will have a package whose severity config is broken—dotnet_diagnostic.AL0025.severity won't match AL1700, etc.
AGENTS.md states "publish lower layers (e.g., analyzers) before moving SDK truth upward," but here the SDK packages the analyzer editorconfig, creating a circular dependency. You must either:
- Publish analyzers 2.0.0, update SDK editorconfig + bump
ANcpLuaAnalyzersVersionto 2.0.0, publish SDK, then announce consumers should update—accepting a brief window where early adopters get broken config. - Coordinate a simultaneous SDK + analyzers release with lockstep version pins.
Plan should explicitly state which path you're taking and warn consumers about the config-gap window if choosing option 1.
Based on learnings: Cross-repo bootstrap: publish lower layers (e.g., analyzers) before moving SDK truth upward due to transitive analyzer injection.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@eng/analyzer-renumber-plan.md` around lines 435 - 448, Update Section 8 of
eng/analyzer-renumber-plan.md to explicitly pick a release strategy and warn
about the config-gap: state whether you will (A) publish ANcpLua.Analyzers
2.0.0, then update
ANcpLua.NET.Sdk/src/Config/Analyzer.ANcpLua.Analyzers.editorconfig and bump the
ANcpLuaAnalyzersVersion in the SDK and publish the SDK (and include an explicit
warning to consumers about the transient broken dotnet_diagnostic.AL####
severities), or (B) perform a coordinated simultaneous release of
ANcpLua.Analyzers and ANcpLua.NET.Sdk with lockstep pins to avoid the gap;
include the chosen path, the exact steps (publish analyzers → update SDK
editorconfig → bump ANcpLuaAnalyzersVersion → publish SDK, or coordinated
publish), and a short consumer-facing warning text about the config-gap window
if option A is chosen.
| return CodeAction.Create( | ||
| CodeFixResources.AL0002CodeFixTitle, | ||
| CodeFixResources.AL1001CodeFixTitle, | ||
| _ => RemoveRepeatedNegatedPatterns(document, syntax, parent, root), | ||
| nameof(CodeFixResources.AL0002CodeFixTitle)); | ||
| nameof(CodeFixResources.AL1001CodeFixTitle)); |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
rg -n "equivalenceKey|CodeAction\.Create\(" src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1001SimplifyNegatedPatternCodeFixProvider.cs || true
sed -n '1,200p' src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1001SimplifyNegatedPatternCodeFixProvider.cs | cat -n
rg -n "DiagnosticId\s*=\s*\"AL1001\"|FixableDiagnosticIds" src/ANcpLua.Analyzers/Analyzers/AL1001DontRepeatNegatedPatternAnalyzer.cs || true
sed -n '1,200p' src/ANcpLua.Analyzers/Analyzers/AL1001DontRepeatNegatedPatternAnalyzer.cs | cat -nRepository: ANcpLua/ANcpLua.Analyzers
Length of output: 5110
Fix FixAll grouping: use the AL1001 analyzer DiagnosticId as equivalenceKey
Al1001SimplifyNegatedPatternCodeFixProviderusesnameof(CodeFixResources.AL1001CodeFixTitle)as theCodeAction.Create(...)equivalenceKey, which can break stable FixAll grouping; switch it toAl1001DontRepeatNegatedPatternAnalyzer.DiagnosticId.
Suggested fix
return CodeAction.Create(
CodeFixResources.AL1001CodeFixTitle,
_ => RemoveRepeatedNegatedPatterns(document, syntax, parent, root),
- nameof(CodeFixResources.AL1001CodeFixTitle));
+ Al1001DontRepeatNegatedPatternAnalyzer.DiagnosticId);📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| return CodeAction.Create( | |
| CodeFixResources.AL0002CodeFixTitle, | |
| CodeFixResources.AL1001CodeFixTitle, | |
| _ => RemoveRepeatedNegatedPatterns(document, syntax, parent, root), | |
| nameof(CodeFixResources.AL0002CodeFixTitle)); | |
| nameof(CodeFixResources.AL1001CodeFixTitle)); | |
| return CodeAction.Create( | |
| CodeFixResources.AL1001CodeFixTitle, | |
| _ => RemoveRepeatedNegatedPatterns(document, syntax, parent, root), | |
| Al1001DontRepeatNegatedPatternAnalyzer.DiagnosticId); |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1001SimplifyNegatedPatternCodeFixProvider.cs`
around lines 20 - 23, In AL1001SimplifyNegatedPatternCodeFixProvider, the
CodeAction.Create call currently uses
nameof(CodeFixResources.AL1001CodeFixTitle) as the equivalenceKey which prevents
stable FixAll grouping; update that third argument to use
Al1001DontRepeatNegatedPatternAnalyzer.DiagnosticId instead so all fixes for
this diagnostic share the same equivalence key (locate the
CodeAction.Create(...) call that returns a CodeAction and the
RemoveRepeatedNegatedPatterns(...) delegate and replace the equivalenceKey
accordingly).
| CodeAction.Create( | ||
| CodeFixResources.AL0004CodeFixTitle, | ||
| CodeFixResources.AL1003CodeFixTitle, | ||
| _ => UsePatternMatching(document, syntax, root), | ||
| nameof(CodeFixResources.AL0004CodeFixTitle)); | ||
| nameof(CodeFixResources.AL1003CodeFixTitle)); |
There was a problem hiding this comment.
equivalenceKey should be the analyzer ID, not the resource property name.
Use the analyzer diagnostic ID to keep FixAll behavior stable.
Suggested fix
CodeAction.Create(
CodeFixResources.AL1003CodeFixTitle,
_ => UsePatternMatching(document, syntax, root),
- nameof(CodeFixResources.AL1003CodeFixTitle));
+ Al1003ToAl1004SpanComparisonAnalyzer.DiagnosticIdAl1003);As per coding guidelines, "equivalenceKey must be set to the analyzer’s DiagnosticId for FixAll correctness."
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| CodeAction.Create( | |
| CodeFixResources.AL0004CodeFixTitle, | |
| CodeFixResources.AL1003CodeFixTitle, | |
| _ => UsePatternMatching(document, syntax, root), | |
| nameof(CodeFixResources.AL0004CodeFixTitle)); | |
| nameof(CodeFixResources.AL1003CodeFixTitle)); | |
| CodeAction.Create( | |
| CodeFixResources.AL1003CodeFixTitle, | |
| _ => UsePatternMatching(document, syntax, root), | |
| Al1003ToAl1004SpanComparisonAnalyzer.DiagnosticIdAl1003); |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1003SpanPatternMatchingCodeFixProvider.cs`
around lines 16 - 19, The CodeAction.Create call is using
nameof(CodeFixResources.AL1003CodeFixTitle) as the equivalenceKey; change it to
use the analyzer diagnostic ID instead (e.g., use diagnostic.Id or the
analyzer's DiagnosticId constant such as AL1003Analyzer.DiagnosticId) so FixAll
works correctly; keep the title and the UsePatternMatching(document, syntax,
root) callback the same and only replace the equivalenceKey argument.
| CodeAction.Create( | ||
| CodeFixResources.AL0005CodeFixTitle, | ||
| CodeFixResources.AL1004CodeFixTitle, | ||
| _ => UseSequenceEqual(document, syntax, root), | ||
| nameof(CodeFixResources.AL0005CodeFixTitle)); | ||
| nameof(CodeFixResources.AL1004CodeFixTitle)); |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# 1) Show the relevant code in the file under review
FILE="src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1004UseSequenceEqualCodeFixProvider.cs"
echo "---- $FILE (around lines 1-120) ----"
nl -ba "$FILE" | sed -n '1,140p'
# 2) Locate the FixAll/equivalenceKey contract in the repo
echo "---- Searching for CLAUDE.md contract ----"
find src -maxdepth 5 -name "CLAUDE.md" -print
# print the CLAUDE.md relevant section if present
CLAUDE="$(find src -maxdepth 5 -name "CLAUDE.md" -print | head -n 1 || true)"
if [ -n "${CLAUDE:-}" ]; then
echo "---- $CLAUDE (grep for equivalenceKey/FixAll/DiagnosticId) ----"
nl -ba "$CLAUDE" | rg -n "equivalenceKey|FixAll|DiagnosticIdAl1004|DiagnosticId|CodeAction\.Create" || true
fi
# 3) Find the analyzer DiagnosticId for AL1004 in the analyzers code
echo "---- Searching for AL1004 analyzer DiagnosticId definition ----"
rg -n --hidden -S "AL1004" src/ANcpLua.Analyzers | head -n 50
# attempt to find a DiagnosticId constant in the codebase
rg -n --hidden -S "DiagnosticId.*AL1004|AL1004.*DiagnosticId|DiagnosticIdAl1004" src/ANcpLua.Analyzers | head -n 50
# 4) Confirm the code-fix provider’s FixableDiagnosticIds and any declared DiagnosticId constants
echo "---- Searching in AL1004 code-fix provider for FixableDiagnosticIds/DiagnosticId constants ----"
rg -n --hidden -S "FixableDiagnosticIds|DiagnosticId|equivalenceKey" "$FILE" || true
# 5) Locate any other code fixes that show the correct equivalenceKey pattern (for comparison)
echo "---- Searching other AL*.cs code fixes for equivalenceKey usage ----"
rg -n --hidden -S "CodeAction\.Create\\(.*equivalenceKey|equivalenceKey.*DiagnosticId|nameof\\(CodeFixResources\\..*\\)" src/ANcpLua.Analyzers.CodeFixes/CodeFixes | head -n 50 || trueRepository: ANcpLua/ANcpLua.Analyzers
Length of output: 244
🏁 Script executed:
#!/bin/bash
set -euo pipefail
FILE="src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1004UseSequenceEqualCodeFixProvider.cs"
echo "---- $FILE (lines 1-200) ----"
cat -n "$FILE" | sed -n '1,200p'
echo "---- Searching for CLAUDE.md contract ----"
find src -name "CLAUDE.md" -print
CLAUDE_PATH="$(find src -name "CLAUDE.md" -print | head -n 1 || true)"
if [ -n "${CLAUDE_PATH}" ]; then
echo "---- Using $CLAUDE_PATH (relevant markers) ----"
cat -n "$CLAUDE_PATH" | rg -n "equivalenceKey|FixAll|DiagnosticId|CodeAction\.Create" || true
else
echo "---- No CLAUDE.md found under src ----"
fi
echo "---- Searching for AL1004 DiagnosticId definitions in analyzers ----"
rg -n --hidden -S "AL1004" src/ANcpLua.Analyzers | head -n 50 || true
rg -n --hidden -S "DiagnosticId.*AL1004|AL1004.*DiagnosticId|DiagnosticIdAl1004" src/ANcpLua.Analyzers | head -n 50 || true
echo "---- Inspecting AL1004 code-fix provider for FixAll/equivalenceKey and FixableDiagnosticIds ----"
cat -n "$FILE" | rg -n "FixableDiagnosticIds|equivalenceKey|DiagnosticId|FixAll|DiagnosticIds" || true
echo "---- Comparing equivalenceKey usage in other code-fix providers ----"
rg -n --hidden -S "equivalenceKey" src/ANcpLua.Analyzers.CodeFixes/CodeFixes | head -n 80 || true
# Find patterns for equivalenceKey set to DiagnosticId or DiagnosticId constants
rg -n --hidden -S "equivalenceKey.*DiagnosticId|nameof\\(.*DiagnosticId|equivalenceKey.*nameof\\(.*DiagnosticId" src/ANcpLua.Analyzers.CodeFixes/CodeFixes || trueRepository: ANcpLua/ANcpLua.Analyzers
Length of output: 6940
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Show the relevant CLAUDE.md guidance for equivalenceKey/FixAll
echo "---- src/ANcpLua.Analyzers.CodeFixes/CLAUDE.md (lines 1-140) ----"
cat -n src/ANcpLua.Analyzers.CodeFixes/CLAUDE.md | sed -n '1,160p'
echo "---- src/ANcpLua.Analyzers/CLAUDE.md (lines 1-140) ----"
cat -n src/ANcpLua.Analyzers/CLAUDE.md | sed -n '1,160p'
# Show analyzer definition for AL1004 diagnostic id constant
echo "---- AL1003ToAL1004SpanComparisonAnalyzer.cs (lines 1-120) ----"
cat -n src/ANcpLua.Analyzers/Analyzers/AL1003ToAL1004SpanComparisonAnalyzer.cs | sed -n '1,140p'Repository: ANcpLua/ANcpLua.Analyzers
Length of output: 19526
Set FixAll equivalenceKey to the AL1004 analyzer DiagnosticId
In src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1004UseSequenceEqualCodeFixProvider.cs (lines 16-19), equivalenceKey is currently nameof(CodeFixResources.AL1004CodeFixTitle); FixAll requires using the analyzer’s public diagnostic id. Change it to Al1003ToAL1004SpanComparisonAnalyzer.DiagnosticIdAl1004 ("AL1004").
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1004UseSequenceEqualCodeFixProvider.cs`
around lines 16 - 19, The CodeAction created in
AL1004UseSequenceEqualCodeFixProvider.cs currently uses
nameof(CodeFixResources.AL1004CodeFixTitle) as the equivalenceKey; change that
third parameter in the CodeAction.Create call to use the analyzer's public
diagnostic id Al1003ToAL1004SpanComparisonAnalyzer.DiagnosticIdAl1004 (i.e.
"AL1004") so FixAll groups correctly, referencing the CodeAction.Create
invocation and the Al1003ToAL1004SpanComparisonAnalyzer.DiagnosticIdAl1004
symbol.
| context.RegisterCodeFix( | ||
| CodeAction.Create( | ||
| CodeFixResources.AL0122CodeFixTitle, | ||
| CodeFixResources.AL1504CodeFixTitle, | ||
| _ => MakePartialAsync(context.Document, typeDeclaration, root), | ||
| nameof(CodeFixResources.AL0122CodeFixTitle)), | ||
| nameof(CodeFixResources.AL1504CodeFixTitle)), | ||
| diagnostic); | ||
| } |
There was a problem hiding this comment.
equivalenceKey must use the analyzer's DiagnosticId for FixAll support.
Line 32 sets equivalenceKey to nameof(CodeFixResources.AL1504CodeFixTitle). Per coding guidelines, the equivalenceKey must be set to the analyzer's DiagnosticId.
Proposed fix
context.RegisterCodeFix(
CodeAction.Create(
CodeFixResources.AL1504CodeFixTitle,
_ => MakePartialAsync(context.Document, typeDeclaration, root),
- nameof(CodeFixResources.AL1504CodeFixTitle)),
+ Al1504DuckDbTableMustBePartialAnalyzer.DiagnosticId),
diagnostic);As per coding guidelines: CreateCodeAction method must set equivalenceKey to the analyzer's DiagnosticId to enable FixAll support
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| context.RegisterCodeFix( | |
| CodeAction.Create( | |
| CodeFixResources.AL0122CodeFixTitle, | |
| CodeFixResources.AL1504CodeFixTitle, | |
| _ => MakePartialAsync(context.Document, typeDeclaration, root), | |
| nameof(CodeFixResources.AL0122CodeFixTitle)), | |
| nameof(CodeFixResources.AL1504CodeFixTitle)), | |
| diagnostic); | |
| } | |
| context.RegisterCodeFix( | |
| CodeAction.Create( | |
| CodeFixResources.AL1504CodeFixTitle, | |
| _ => MakePartialAsync(context.Document, typeDeclaration, root), | |
| Al1504DuckDbTableMustBePartialAnalyzer.DiagnosticId), | |
| diagnostic); | |
| } |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1504DuckDbTableCodeFixProvider.cs`
around lines 28 - 34, The CodeAction equivalenceKey is currently set to
nameof(CodeFixResources.AL1504CodeFixTitle); change it to use the analyzer
diagnostic id so FixAll works: when creating the CodeAction in
context.RegisterCodeFix (the CodeAction.Create call that invokes
MakePartialAsync and uses CodeFixResources.AL1504CodeFixTitle), set the
equivalenceKey to the Diagnostic.Id (e.g., diagnostic.Id or the analyzer's
DiagnosticId constant) instead of the resource name.
| context.RegisterCodeFix( | ||
| CodeAction.Create( | ||
| CodeFixResources.AL0025CodeFixTitle, | ||
| CodeFixResources.AL1700CodeFixTitle, | ||
| ct => MakeStaticAsync(context.Document, span, ct), | ||
| nameof(CodeFixResources.AL0025CodeFixTitle)), | ||
| nameof(CodeFixResources.AL1700CodeFixTitle)), | ||
| diagnostic); |
There was a problem hiding this comment.
equivalenceKey must use the analyzer's DiagnosticId for FixAll support.
Line 26 sets equivalenceKey to nameof(CodeFixResources.AL1700CodeFixTitle). Even with a custom FixAllProvider, the single-diagnostic code action registration must use the analyzer's DiagnosticId as the equivalenceKey per coding guidelines.
Proposed fix
context.RegisterCodeFix(
CodeAction.Create(
CodeFixResources.AL1700CodeFixTitle,
ct => MakeStaticAsync(context.Document, span, ct),
- nameof(CodeFixResources.AL1700CodeFixTitle)),
+ Al1700PreferStaticLambdaAnalyzer.DiagnosticId),
diagnostic);As per coding guidelines: CreateCodeAction method must set equivalenceKey to the analyzer's DiagnosticId to enable FixAll support
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| context.RegisterCodeFix( | |
| CodeAction.Create( | |
| CodeFixResources.AL0025CodeFixTitle, | |
| CodeFixResources.AL1700CodeFixTitle, | |
| ct => MakeStaticAsync(context.Document, span, ct), | |
| nameof(CodeFixResources.AL0025CodeFixTitle)), | |
| nameof(CodeFixResources.AL1700CodeFixTitle)), | |
| diagnostic); | |
| context.RegisterCodeFix( | |
| CodeAction.Create( | |
| CodeFixResources.AL1700CodeFixTitle, | |
| ct => MakeStaticAsync(context.Document, span, ct), | |
| Al1700PreferStaticLambdaAnalyzer.DiagnosticId), | |
| diagnostic); |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1700StaticLambdaCodeFixProvider.cs`
around lines 22 - 27, The CodeAction registered in
AL1700StaticLambdaCodeFixProvider (context.RegisterCodeFix -> CodeAction.Create)
uses CodeFixResources.AL1700CodeFixTitle as the equivalenceKey; change it to the
analyzer diagnostic id so FixAll works: when creating the CodeAction for
MakeStaticAsync, pass the diagnostic's DiagnosticId (e.g., diagnostic.Id) as the
equivalenceKey instead of nameof(CodeFixResources.AL1700CodeFixTitle) so the
action's equivalenceKey matches the analyzer DiagnosticId.
| CodeAction.Create( | ||
| CodeFixResources.AL0026CodeFixTitle, | ||
| CodeFixResources.AL1701CodeFixTitle, | ||
| _ => ConvertToTimeProvider(document, memberAccess, root, diagnostic), | ||
| nameof(Al0026DateTimeNowCodeFixProvider)); | ||
| nameof(Al1701DateTimeNowCodeFixProvider)); |
There was a problem hiding this comment.
equivalenceKey must use the analyzer's DiagnosticId for FixAll support.
Line 25 sets equivalenceKey to nameof(Al1701DateTimeNowCodeFixProvider) (the provider class name). Per coding guidelines, the equivalenceKey must be set to the analyzer's DiagnosticId.
Proposed fix
CodeAction.Create(
CodeFixResources.AL1701CodeFixTitle,
_ => ConvertToTimeProvider(document, memberAccess, root, diagnostic),
- nameof(Al1701DateTimeNowCodeFixProvider));
+ Al1701AvoidDateTimeNowAnalyzer.DiagnosticId);As per coding guidelines: CreateCodeAction method must set equivalenceKey to the analyzer's DiagnosticId to enable FixAll support
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| CodeAction.Create( | |
| CodeFixResources.AL0026CodeFixTitle, | |
| CodeFixResources.AL1701CodeFixTitle, | |
| _ => ConvertToTimeProvider(document, memberAccess, root, diagnostic), | |
| nameof(Al0026DateTimeNowCodeFixProvider)); | |
| nameof(Al1701DateTimeNowCodeFixProvider)); | |
| CodeAction.Create( | |
| CodeFixResources.AL1701CodeFixTitle, | |
| _ => ConvertToTimeProvider(document, memberAccess, root, diagnostic), | |
| Al1701AvoidDateTimeNowAnalyzer.DiagnosticId); |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1701DateTimeNowCodeFixProvider.cs`
around lines 22 - 25, The CodeAction.Create call in
AL1701DateTimeNowCodeFixProvider currently sets the equivalenceKey to the
provider class name; change it to use the analyzer's DiagnosticId to enable
FixAll support by replacing the current equivalenceKey
(nameof(Al1701DateTimeNowCodeFixProvider)) with the diagnostic's ID (e.g.,
diagnostic.Id or the analyzer's DiagnosticId constant such as
Al1701Analyzer.DiagnosticId) in the CodeAction.Create invocation that constructs
the fix for ConvertToTimeProvider.
| context.RegisterCodeFix( | ||
| CodeAction.Create( | ||
| CodeFixResources.AL0027CodeFixTitle, | ||
| CodeFixResources.AL1702CodeFixTitle, | ||
| _ => ConvertToSystemTextJson(context.Document, root, invocation, methodName, typeArgs), | ||
| nameof(Al0027UseSystemTextJsonCodeFixProvider)), | ||
| nameof(Al1702UseSystemTextJsonCodeFixProvider)), | ||
| diagnostic); | ||
| } |
There was a problem hiding this comment.
equivalenceKey must use the analyzer's DiagnosticId for FixAll support.
Line 35 sets equivalenceKey to nameof(Al1702UseSystemTextJsonCodeFixProvider) (the provider class name). Per coding guidelines, the equivalenceKey must be set to the analyzer's DiagnosticId.
Proposed fix
context.RegisterCodeFix(
CodeAction.Create(
CodeFixResources.AL1702CodeFixTitle,
_ => ConvertToSystemTextJson(context.Document, root, invocation, methodName, typeArgs),
- nameof(Al1702UseSystemTextJsonCodeFixProvider)),
+ Al1702AvoidNewtonsoftJsonAnalyzer.DiagnosticId),
diagnostic);As per coding guidelines: CreateCodeAction method must set equivalenceKey to the analyzer's DiagnosticId to enable FixAll support
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| context.RegisterCodeFix( | |
| CodeAction.Create( | |
| CodeFixResources.AL0027CodeFixTitle, | |
| CodeFixResources.AL1702CodeFixTitle, | |
| _ => ConvertToSystemTextJson(context.Document, root, invocation, methodName, typeArgs), | |
| nameof(Al0027UseSystemTextJsonCodeFixProvider)), | |
| nameof(Al1702UseSystemTextJsonCodeFixProvider)), | |
| diagnostic); | |
| } | |
| context.RegisterCodeFix( | |
| CodeAction.Create( | |
| CodeFixResources.AL1702CodeFixTitle, | |
| _ => ConvertToSystemTextJson(context.Document, root, invocation, methodName, typeArgs), | |
| Al1702AvoidNewtonsoftJsonAnalyzer.DiagnosticId), | |
| diagnostic); | |
| } |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1702UseSystemTextJsonCodeFixProvider.cs`
around lines 31 - 37, The CodeAction equivalenceKey is currently set to the
provider class name (nameof(Al1702UseSystemTextJsonCodeFixProvider)), which
breaks FixAll; change the equivalenceKey passed to CodeAction.Create to the
analyzer's DiagnosticId (use the Diagnostic.Id from the diagnostic parameter or
the analyzer constant) so the CodeAction's equivalenceKey matches the analyzer's
DiagnosticId and enables FixAll support—update the call in the RegisterCodeFix
block where CodeAction.Create is invoked (the invocation that builds the
CodeAction for ConvertToSystemTextJson) to supply diagnostic.Id instead of the
provider class name.
| ═══════════════════════════════════════════════════════════════════════ --> | ||
| <PropertyGroup Label="Analyzers"> | ||
| <ANcpLuaAnalyzersVersion>1.29.1</ANcpLuaAnalyzersVersion> | ||
| <ANcpLuaAnalyzersVersion>1.29.4</ANcpLuaAnalyzersVersion> |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial | 🏗️ Heavy lift
Coordinate Version.props update and cross-repo version bumps post-publish.
ANcpLuaAnalyzersVersion=1.29.4 reflects the last published version (correct for restore-time). After this PR merges and 2.0.0 is published to NuGet, a follow-up PR (or CI auto-commit) must update this line to 2.0.0. Linked repos (ANcpLua.NET.Sdk, ErrorOrX, ANcpLua.Agents) also pin this variable and must be updated in lockstep to pull the renumbered diagnostics. Verify the publish-then-update sequencing is scripted or documented to avoid restore failures.
Based on learnings, cross-repo bootstrap requires publishing lower layers before moving SDK truth upward.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@Version.props` at line 61, Update the pinned analyzer version variable
ANcpLuaAnalyzersVersion in Version.props from 1.29.4 to 2.0.0 after the new
2.0.0 package is published; then make matching updates in the other repositories
that reference this same variable (ANcpLua.NET.Sdk, ErrorOrX, ANcpLua.Agents) so
they pull the renumbered diagnostics in lockstep, and add or update CI/scripted
steps (or documentation) to enforce the publish-first then bump sequence to
avoid restore failures.
Triage Bot report
Threads marked |
1 similar comment
Triage Bot report
Threads marked |
|
Tip For best results, initiate chat on the files or code changes.
Codacy threads (requires your action):
These are low-risk and can only be resolved by you directly in those threads (reply to dismiss or address the nitpick). My threads (~40):
Options:
Which path do you prefer? |
|
Tip For best results, initiate chat on the files or code changes.
Below is a precise fix plan you can apply in this PR, followed by a post‑merge checklist for consumers. Immediate PR fixes A. Normalize CodeAction equivalenceKey usage
Pattern to apply
B. Sweep all CodeFixProviders in src/ANcpLua.Analyzers.CodeFixes
Concrete code snippet (example) // after Multi-action example (AL1203) context.RegisterCodeFix( FixAll example (AL1700)
C. HelpLink and diagnostic ID wildcard updates (Codacy nits)
D. Title non-null contract for CodeAction
Post‑merge consumer sweep (tracked separately; not blocking this PR if documented)
How to resolve the blocking threads
If you want, I can generate a scoped patch plan touching only the affected providers to add the correct equivalenceKey values and point you at specific lines to edit. |
…ix-first Root cause for PR #174's CodeRabbit getting stuck (3+ hours in "Review in progress" / "Failed to post review comments" loop): auto_apply_labels: true + 17 labeling_instructions → CR labeled the PR 9× → 8 "Review skipped" dedup'd + 1 leaked through → review-comments POST exceeded GitHub's batch size on the 215-file diff → "Failed to post review comments" → auto-retry forever Fixes in this rewrite: 1. auto_apply_labels: true → false (PR labels never trigger event re-fires) 2. labeling_instructions: 17 → 5 (high-signal labels only) 3. disable_cache: true → false (5-30× CR speedup) 4. path_instructions: 17 → 7 (dedup'd via multi-glob arrays; same coverage) 5. linked_repositories: 17 → 7 (only truly-related repos) 6. path_filters: +9 entries (Designer.cs, Snapshots, AnalyzerReleases.md, etc. excluded at filter level instead of instruction level) 7. finishing_touches.custom: 5 recipes (rewritten review-prose → autofix-first actions) 8. pre_merge_checks.custom_checks: 12 → 18 (added 3 analyzer-discipline checks the renumber wave proved necessary) Net delta: 695 → ~520 lines, prompt size massively smaller, autofix posture stronger. Should let CR actually complete on big PRs without hitting GitHub's review-comment batch limit. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@coderabbitai autofix |
|
Claude encountered an error after 2s —— View job I'll analyze this and get back to you. |
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Fixes Applied SuccessfullyFixed 35 file(s) based on 40 unresolved review comments. Files modified:
Commit: The changes have been pushed to the Time taken: |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 2083 |
| Duplication | 192 |
AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.
TIP This summary will be updated as you push new changes.
Fixed 35 file(s) based on 40 unresolved review comments. Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
…g, autofix-first" This reverts commit e5fdd5b.
Fixed 5 file(s) based on 40 unresolved review comments. Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2fe348d832
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| ═══════════════════════════════════════════════════════════════════════ --> | ||
| <PropertyGroup Label="Analyzers"> | ||
| <ANcpLuaAnalyzersVersion>1.29.1</ANcpLuaAnalyzersVersion> | ||
| <ANcpLuaAnalyzersVersion>2.0.0</ANcpLuaAnalyzersVersion> |
There was a problem hiding this comment.
Keep self-referenced analyzer version on last published release
ANcpLuaAnalyzersVersion is consumed by restore-time package references (as documented in Directory.Build.props), so pinning it to 2.0.0 before that package is actually available on NuGet will make clean restores fail with NU1102 in this repo and downstream SDK consumers. The commit message itself schedules the push as a post-merge step, which means this value should remain on the last published version until publication is complete.
Useful? React with 👍 / 👎.
| Diagnostic diagnostic) => | ||
| CodeAction.Create( | ||
| "Use pattern matching", | ||
| CodeFixResources.AL1010CodeFixTitle, |
There was a problem hiding this comment.
Add missing AL1010 code-fix resource symbol
This provider now references CodeFixResources.AL1010CodeFixTitle, but that symbol is not defined in CodeFixResources.Designer.cs (and there is no AL1010CodeFixTitle entry in CodeFixResources.resx), so the code-fix project cannot compile once this file is built. The previous version used a literal title string, so this unresolved resource reference is introduced by this commit.
Useful? React with 👍 / 👎.
Triage Bot report
Threads marked |
1 similar comment
Triage Bot report
Threads marked |
Summary
PR / Commit
Testing
|
Summary
Testing
|
|
Tip For best results, initiate chat on the files or code changes.
What’s already fixed in this PR
What still needs explicit confirmation/actions
How to close the blocking threads
Optional but recommended follow-up (post-merge)
If you want me to open a single tracking issue per-repo for the consumer sweep and release order, say “open issues,” and I’ll file them with links back to this PR. |
|
Tip For best results, initiate chat on the files or code changes.
If you want me to drive the equivalenceKey sweep in this PR, say “go” and I’ll enumerate the exact edits per file and variants needed, then you can apply/push and I’ll resolve all my threads. If you’d prefer to defer, I can open a tracking issue and mark these threads as follow-up. |
There was a problem hiding this comment.
Actionable comments posted: 13
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1703UseImplicitTypeWhenApparentCodeFixProvider.cs (1)
24-27:⚠️ Potential issue | 🟠 Major | ⚡ Quick winUse
DiagnosticIdasequivalenceKeyfor FixAll support.Line 27 passes
UseImplicitTypeTitleas the equivalenceKey. As per coding guidelines, the equivalenceKey must be the analyzer's diagnostic ID to enable correct FixAll scoping. Replace line 27 withAl1703UseImplicitTypeWhenApparentAnalyzer.DiagnosticId.🔧 Proposed fix
CodeAction.Create( UseImplicitTypeTitle, _ => UseImplicitType(document, root, syntax), - UseImplicitTypeTitle); + Al1703UseImplicitTypeWhenApparentAnalyzer.DiagnosticId);As per coding guidelines, "Reference the analyzer's public DiagnosticId directly in CodeFixProvider implementations" and "CodeFixProvider implementations must include an equivalenceKey parameter in CodeAction.Create() calls — required for FixAll support."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1703UseImplicitTypeWhenApparentCodeFixProvider.cs` around lines 24 - 27, Replace the hard-coded equivalence key being passed to CodeAction.Create with the analyzer's DiagnosticId to enable FixAll scoping: in the CodeAction.Create call that currently uses UseImplicitTypeTitle as the third argument, pass Al1703UseImplicitTypeWhenApparentAnalyzer.DiagnosticId instead; locate the CodeAction.Create invocation (alongside UseImplicitType and UseImplicitTypeTitle) and update the equivalenceKey argument accordingly.tests/ANcpLua.Analyzers.Tests/AL1106MissingHealthChecksTests.cs (1)
11-50: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick winSwitch this test class to the repository analyzer-test base abstraction.
Al1106MissingHealthChecksTestsis still using a localCSharpAnalyzerTest<...>harness; this path requires the shared analyzer test base pattern for consistency and maintenance.As per coding guidelines, "tests/ANcpLua.Analyzers.Tests/**/Tests.cs: Use AnalyzerTest base class for analyzer-only tests in xunit.v3" and "tests/ANcpLua.Analyzers.Tests/ALTests.cs: Analyzer tests must inherit from AnalyzerTestBase alias (typed to the specific analyzer)."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/ANcpLua.Analyzers.Tests/AL1106MissingHealthChecksTests.cs` around lines 11 - 50, Replace the local CSharpAnalyzerTest harness in Al1106MissingHealthChecksTests with the repository's analyzer-test base by converting the class to inherit the AnalyzerTestBase (or AnalyzerTest<Al1106MissingHealthChecksAnalyzer>) pattern and remove the manual CSharpAnalyzerTest<Al1106MissingHealthChecksAnalyzer, DefaultVerifier> creation inside VerifyAsync; instead use the base test helper(s) to set TestCode (combine Stubs + source), ReferenceAssemblies, MarkupOptions, and additional references (replace test.TestState.AdditionalReferences.AddRange(Net100.References.All) with the equivalent base-class setup), then call the base-run helper (e.g., RunAsync) to execute the test; update or remove VerifyAsync to delegate to the new base implementation and keep references to unique symbols such as Al1106MissingHealthChecksTests, VerifyAsync, Stubs, TestCode, ReferenceAssemblies, MarkupOptions, and Net100.References.All when making the change.
♻️ Duplicate comments (2)
src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1007IXmlSerializableCodeFixProvider.cs (1)
10-10:⚠️ Potential issue | 🟠 Major | ⚡ Quick winChange base class to
AlCodeFixProvider<T>.Line 10 still derives from
CodeFixProviderdirectly. As per coding guidelines, code fix providers must inherit fromAlCodeFixProvider<T>(in this case,AlCodeFixProvider<CSharpSyntaxNode>or appropriate syntax node type). Update the class declaration and ensure[ExportCodeFixProvider]and[Shared]attributes are present.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1007IXmlSerializableCodeFixProvider.cs` at line 10, The class Al1007IXmlSerializableCodeFixProvider currently inherits directly from CodeFixProvider; change its base to the generic helper AlCodeFixProvider<T> (e.g., AlCodeFixProvider<CSharpSyntaxNode> or the appropriate Roslyn syntax node type used across the project) and update the class declaration accordingly; also ensure the class is decorated with [ExportCodeFixProvider] and [Shared] attributes so it follows the project conventions for code fix providers.src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1202UseTypeHierarchyCodeFixProvider.cs (1)
15-16: 🛠️ Refactor suggestion | 🟠 Major | 🏗️ Heavy liftMigrate this AL code fix to
AlCodeFixProvider<TNode>base.Line 15 still inherits
CodeFixProvider, which violates the required provider contract for AL code fixes in this repository.As per coding guidelines,
src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL*.cs:CodeFixProvider implementations must use the AlCodeFixProvider base class with a generic node type parameter.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1202UseTypeHierarchyCodeFixProvider.cs` around lines 15 - 16, The class Al1202UseTypeHierarchyCodeFixProvider currently inherits CodeFixProvider; change its base to the repository-standard generic AlCodeFixProvider<TNode> (replace CodeFixProvider with AlCodeFixProvider<TNode> using the appropriate node type used by this analyzer), update the class declaration accordingly and remove or adapt the FixableDiagnosticIds override to match the AlCodeFixProvider pattern, and adjust any constructor or member usage that assumed CodeFixProvider methods so the provider conforms to the AlCodeFixProvider<TNode> contract (keep the DiagnosticId reference to Al1202UseTypeHierarchyAnalyzer.DiagnosticId).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@eng/analyzer-renumber-plan.md`:
- Line 157: The markdown uses bare triple-backtick fences at the examples in
analyzer-renumber-plan.md (notably the fenced blocks currently at lines
referenced in the review) which triggers MD040; update each of those fenced code
blocks (the blocks containing lists like "AL0010 AL0012...",
"AL0010CodeFixTitle...", and the mapping block "AL{old}AnalyzerTitle ->
AL{new}AnalyzerTitle") to include a language identifier (e.g., text) immediately
after the opening ``` so they become ```text, ensuring all three problematic
blocks are consistently annotated to satisfy the linter.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1500AddMissingCasesCodeFixProvider.cs`:
- Line 31: The code actions in AL1500AddMissingCasesCodeFixProvider are using
the resource name string as the equivalenceKey; change both CodeAction.Create
calls to use Al1500ClosedTypeHierarchySwitchAnalyzer.DiagnosticId as the
equivalenceKey so FixAll groups by the analyzer diagnostic ID. Locate the
CodeAction.Create invocations in class AL1500AddMissingCasesCodeFixProvider and
replace the current nameof(CodeFixResources.AL1500CodeFixTitle) equivalenceKey
argument with Al1500ClosedTypeHierarchySwitchAnalyzer.DiagnosticId for both code
actions so they share the stable identifier.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1503NormalizeWhitespaceCodeFixProvider.cs`:
- Line 10: The class Al1503NormalizeWhitespaceCodeFixProvider currently inherits
from CodeFixProvider; change its base to the AL-specific generic base by making
it inherit from AlCodeFixProvider<TNode> (replace CodeFixProvider with
AlCodeFixProvider<TNode> and pick the appropriate AL SyntaxNode type used by
this fix), update any constructors/overrides to match the AlCodeFixProvider API
(e.g., constructor signature, RegisterCodeFixesAsync/FixAllProvider overrides if
their signatures differ), and add the necessary using/import for the
AlCodeFixProvider type so the class compiles while preserving the existing class
name Al1503NormalizeWhitespaceCodeFixProvider and its existing members.
- Around line 33-36: AL1503NormalizeWhitespaceCodeFixProvider currently inherits
CodeFixProvider directly; change its base to AlCodeFixProvider<TNode> (using the
appropriate syntax and TNode type that matches the analyzed node used by
RemoveNormalizeWhitespaceAsync) so it follows the AL code-fix pattern. Update
the class declaration for AL1503NormalizeWhitespaceCodeFixProvider to inherit
from AlCodeFixProvider<TNode>, ensure constructor and any overrides match the
generic base (adjust method signatures if the base requires an overridden
RegisterCodeFixesAsync or similar), and keep the existing CodeAction.Create call
and RemoveNormalizeWhitespaceAsync method intact but adapted to the generic node
type.
In `@src/ANcpLua.Analyzers.CodeFixes/CodeFixResources.resx`:
- Around line 157-159: Update the resource string AL1217CodeFixTitle so the
displayed title matches the analyzer intent: change the value text from "Use
Guard.NotEmpty" to "Use Guard.NotEmptyGuid" to correctly reference GUID
validation (AL0050); locate the AL1217CodeFixTitle resource entry in
CodeFixResources.resx and replace the value accordingly.
In `@src/ANcpLua.Analyzers/Analyzers/AL1600HardcodedPackageVersionAnalyzer.cs`:
- Line 13: The class Al1600HardcodedPackageVersionAnalyzer currently derives
from DiagnosticAnalyzer but must inherit from the project-specific base
AlAnalyzer to comply with the analyzer contract; change its declaration so the
sealed partial class Al1600HardcodedPackageVersionAnalyzer : DiagnosticAnalyzer
becomes sealed partial class Al1600HardcodedPackageVersionAnalyzer : AlAnalyzer,
and ensure any required constructor or overrides expected by AlAnalyzer are
implemented or forwarded (update base constructor calls and override signatures
as needed to match AlAnalyzer’s API).
In `@src/ANcpLua.Analyzers/Analyzers/AL1606OutdatedMafPackageVersionAnalyzer.cs`:
- Line 14: The analyzer class Al1606OutdatedMafPackageVersionAnalyzer currently
inherits from DiagnosticAnalyzer; change its declaration to inherit from
AlAnalyzer (keep the sealed partial class modifiers), add any required using for
the AlAnalyzer type, and update/remove any members or overrides that must
conform to AlAnalyzer’s API (e.g., constructor signature or overridden
properties/methods) so the class compiles and follows the shared analyzer base
contract.
In `@tests/ANcpLua.Analyzers.Tests/AL1010PatternMatchingTests.cs`:
- Line 10: The test class Al1010PatternMatchingTests currently inherits directly
from AnalyzerTest<Al1010PreferPatternMatchingAnalyzer>; change its base to the
file-local alias AnalyzerTestBase typed to the same analyzer (i.e., make the
class inherit from AnalyzerTestBase<Al1010PreferPatternMatchingAnalyzer>) so it
follows the project test convention while keeping the sealed partial class
modifiers and the existing class name.
In `@tests/ANcpLua.Analyzers.Tests/AL1011NormalizeNullGuardStyleTests.cs`:
- Around line 57-58: The generic type argument list in the class declaration
Al1011PortableFormCodeFixTests splits the comma onto the next line before the
second type argument; update the declaration so the comma follows the first type
argument on the same line (e.g., "Al1011NormalizeNullGuardStyleAnalyzer,
Al1011NormalizeNullGuardStyleCodeFixProvider") to satisfy SA1113/SA1115; apply
the same fix to the other occurrences mentioned (the other class/generic
declarations around the noted lines).
In `@tests/ANcpLua.Analyzers.Tests/AL1214UseGuardNotZeroTests.cs`:
- Around line 7-9: The test class Al1214UseGuardNotZeroTests currently inherits
from AnalyzerTest<Al1214UseGuardNotZeroAnalyzer>; change its base to the
repository's AnalyzerTestBase alias typed to the analyzer (i.e.
AnalyzerTestBase<Al1214UseGuardNotZeroAnalyzer>) while keeping the sealed
partial class modifiers so the class signature reads as a sealed partial class
using the AnalyzerTestBase alias.
In `@tests/ANcpLua.Analyzers.Tests/AL1404AotSafeCallsAotUnsafeTests.cs`:
- Line 9: The test class Al1404AotSafeCallsAotUnsafeTests currently inherits
directly from AnalyzerTest<Al1404AotSafeCallsAotUnsafeAnalyzer>; change it to
use the file-local typed alias AnalyzerTestBase (typed to
Al1404AotSafeCallsAotUnsafeAnalyzer) so the class becomes sealed partial class
Al1404AotSafeCallsAotUnsafeTests : AnalyzerTestBase; locate the class
declaration and replace the generic base type with the alias while keeping the
sealed partial modifiers.
In `@tests/ANcpLua.Analyzers.Tests/AL1703UseImplicitTypeWhenApparentTests.cs`:
- Around line 10-11: The test class Al1703UseImplicitTypeWhenApparentTests
currently inherits AnalyzerTest<Al1703UseImplicitTypeWhenApparentAnalyzer>;
update the inheritance to use the required typed alias AnalyzerTestBase by
changing the base to AnalyzerTestBase<Al1703UseImplicitTypeWhenApparentAnalyzer>
so the sealed partial class follows the analyzer test pattern.
In `@tests/ANcpLua.Analyzers.Tests/CLAUDE.md`:
- Line 75: The table row breaks Markdown parsing because the diagnostic marker
`{|AL1000:code|}` contains unescaped pipe characters; fix by escaping the pipes
inside that cell (e.g., replace `{|AL1000:code|}` with
`{&`#124`;AL1000:code&`#124`;}` or `{\\|AL1000:code\\|}`) so the row remains two
columns and MD056 is resolved.
---
Outside diff comments:
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1703UseImplicitTypeWhenApparentCodeFixProvider.cs`:
- Around line 24-27: Replace the hard-coded equivalence key being passed to
CodeAction.Create with the analyzer's DiagnosticId to enable FixAll scoping: in
the CodeAction.Create call that currently uses UseImplicitTypeTitle as the third
argument, pass Al1703UseImplicitTypeWhenApparentAnalyzer.DiagnosticId instead;
locate the CodeAction.Create invocation (alongside UseImplicitType and
UseImplicitTypeTitle) and update the equivalenceKey argument accordingly.
In `@tests/ANcpLua.Analyzers.Tests/AL1106MissingHealthChecksTests.cs`:
- Around line 11-50: Replace the local CSharpAnalyzerTest harness in
Al1106MissingHealthChecksTests with the repository's analyzer-test base by
converting the class to inherit the AnalyzerTestBase (or
AnalyzerTest<Al1106MissingHealthChecksAnalyzer>) pattern and remove the manual
CSharpAnalyzerTest<Al1106MissingHealthChecksAnalyzer, DefaultVerifier> creation
inside VerifyAsync; instead use the base test helper(s) to set TestCode (combine
Stubs + source), ReferenceAssemblies, MarkupOptions, and additional references
(replace test.TestState.AdditionalReferences.AddRange(Net100.References.All)
with the equivalent base-class setup), then call the base-run helper (e.g.,
RunAsync) to execute the test; update or remove VerifyAsync to delegate to the
new base implementation and keep references to unique symbols such as
Al1106MissingHealthChecksTests, VerifyAsync, Stubs, TestCode,
ReferenceAssemblies, MarkupOptions, and Net100.References.All when making the
change.
---
Duplicate comments:
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1007IXmlSerializableCodeFixProvider.cs`:
- Line 10: The class Al1007IXmlSerializableCodeFixProvider currently inherits
directly from CodeFixProvider; change its base to the generic helper
AlCodeFixProvider<T> (e.g., AlCodeFixProvider<CSharpSyntaxNode> or the
appropriate Roslyn syntax node type used across the project) and update the
class declaration accordingly; also ensure the class is decorated with
[ExportCodeFixProvider] and [Shared] attributes so it follows the project
conventions for code fix providers.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1202UseTypeHierarchyCodeFixProvider.cs`:
- Around line 15-16: The class Al1202UseTypeHierarchyCodeFixProvider currently
inherits CodeFixProvider; change its base to the repository-standard generic
AlCodeFixProvider<TNode> (replace CodeFixProvider with AlCodeFixProvider<TNode>
using the appropriate node type used by this analyzer), update the class
declaration accordingly and remove or adapt the FixableDiagnosticIds override to
match the AlCodeFixProvider pattern, and adjust any constructor or member usage
that assumed CodeFixProvider methods so the provider conforms to the
AlCodeFixProvider<TNode> contract (keep the DiagnosticId reference to
Al1202UseTypeHierarchyAnalyzer.DiagnosticId).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 566e0d30-7e0e-43e0-bbf5-cf47a439d4c1
⛔ Files ignored due to path filters (9)
.coderabbit.yamlis excluded by none and included by none.editorconfigis excluded by none and included by noneAGENTS.mdis excluded by none and included by noneCHANGELOG.mdis excluded by none and included by noneREADME.mdis excluded by none and included by nonedocs/Al1200UseIsEqualTo.mdis excluded by none and included by nonedocs/analyzer-confidence-audit-2026-05-23.mdis excluded by none and included by nonesrc/ANcpLua.Analyzers.CodeFixes/CodeFixResources.Designer.csis excluded by!**/*.Designer.csand included bysrc/**src/ANcpLua.Analyzers/Resources.Designer.csis excluded by!**/*.Designer.csand included bysrc/**
📒 Files selected for processing (207)
Directory.Build.propsDirectory.Packages.propsVersion.propseng/analyzer-renumber-plan.mdsrc/ANcpLua.Analyzers.AnalyzerDocs/ANcpLua.Analyzers.AnalyzerDocs.csprojsrc/ANcpLua.Analyzers.AnalyzerDocs/Al1200UseIsEqualToDocs.cssrc/ANcpLua.Analyzers.AnalyzerDocs/AlAnalyzerDocsGenerator.cssrc/ANcpLua.Analyzers.AnalyzerDocs/AlAnalyzerDocsVerifier.cssrc/ANcpLua.Analyzers.AnalyzerDocsGenerator/ANcpLua.Analyzers.AnalyzerDocsGenerator.csprojsrc/ANcpLua.Analyzers.CodeFixes/CLAUDE.mdsrc/ANcpLua.Analyzers.CodeFixes/CodeFixResources.resxsrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1001SimplifyNegatedPatternCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1003SpanPatternMatchingCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1004UseSequenceEqualCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1007IXmlSerializableCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1009LockTypeCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1010PatternMatchingCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1011NormalizeNullGuardStyleCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1012CombineDeclarationWithNullCheckCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1200UseIsEqualToCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1201UseHasAttributeCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1202UseTypeHierarchyCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1203UseOperationExtensionsCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1204UseOrEmptyCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1205UseToImmutableArrayOrEmptyCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1206UseWhereNotNullCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1207UseToDisplayStringExtensionsCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1208UseGuardNotNullCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1209UseTryParseExtensionsCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1210UseStringComparisonExtensionsCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1211UseAttributeExtensionsCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1212UseGuardNotNullOrEmptyCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1213UseGuardNotNullOrWhiteSpaceCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1214UseGuardNotZeroCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1215UseGuardNotNegativeCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1216UseGuardPositiveCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1217UseGuardNotEmptyGuidCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1218UseGuardDefinedEnumCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1220UseGuardForThrowIfCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1313CancellationTokenPropagationCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1314UseExplicitMidpointRoundingCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1500AddMissingCasesCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1503NormalizeWhitespaceCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1504DuckDbTableCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1700StaticLambdaCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1701DateTimeNowCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1702UseSystemTextJsonCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1703UseImplicitTypeWhenApparentCodeFixProvider.cssrc/ANcpLua.Analyzers.CodeFixes/Refactorings/AR0001SnakeCaseToPascalCaseRefactoring.cssrc/ANcpLua.Analyzers.CodeFixes/Refactorings/AR0002MakeStaticLambdaRefactoring.cssrc/ANcpLua.Analyzers/ANcpLua.Analyzers.csprojsrc/ANcpLua.Analyzers/AlAnalyzer.cssrc/ANcpLua.Analyzers/AnalyzerReleases.Unshipped.mdsrc/ANcpLua.Analyzers/Analyzers/AL1000ProhibitPrimaryConstructorParameterReassignmentAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1001DontRepeatNegatedPatternAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1002DontDivideByConstantZeroAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1003ToAL1004SpanComparisonAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1005FieldNameConflictWithPrimaryConstructorAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1006ToAL1008IXmlSerializableAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1009LockKeywordAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1010PreferPatternMatchingAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1011NormalizeNullGuardStyleAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1012CombineDeclarationWithNullCheckAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1100ToAL1104FormBindingAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1105MissingResilienceConfigurationAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1106MissingHealthChecksAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1107ConsiderConnectionStringAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1108MissingServiceDiscoveryAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1109AvoidTaskRunInAspNetCoreAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1200UseIsEqualToAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1201UseHasAttributeAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1202UseTypeHierarchyAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1203UseOperationExtensionsAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1204UseOrEmptyAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1205UseToImmutableArrayOrEmptyAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1206UseWhereNotNullAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1207UseToDisplayStringExtensionsAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1208UseGuardNotNullAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1209UseTryParseExtensionsAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1210UseStringComparisonExtensionsAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1211UseAttributeExtensionsAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1212UseGuardNotNullOrEmptyAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1213UseGuardNotNullOrWhiteSpaceAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1214UseGuardNotZeroAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1215UseGuardNotNegativeAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1216UseGuardPositiveAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1217UseGuardNotEmptyGuidAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1218UseGuardDefinedEnumAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1219UseStringComparisonAnyExtensionsAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1220UseGuardForThrowIfAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1300ToAL1303ThreadingAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1304PreferAwaitUsingAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1305AvoidBlockingCallsInAsyncAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1306SqlInterpolationInCommandTextAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1307FireAndForgetTaskAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1308PreferTryParseAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1309EmptyCatchBlockAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1310ExceptionLeakedInResponseAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1311UnnecessaryLinqMaterializationAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1312ReadModifyWriteWithoutTransactionAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1313CancellationTokenPropagationAnalysis.cssrc/ANcpLua.Analyzers/Analyzers/AL1313CancellationTokenPropagationAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1314UseExplicitMidpointRoundingAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1400AotTestMustReturnIntAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1401AotTestExitCode100Analyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1402TrimSafeViolationAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1403AotSafeViolationAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1404AotSafeCallsAotUnsafeAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1405UnnecessaryAotUnsafeAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1406AvoidDynamicKeywordAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1407AvoidExpressionCompileAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1408AvoidActivatorCreateInstanceAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1409AvoidTypeGetTypeAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1500ClosedTypeHierarchySwitchAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1501SymbolStoredInModelAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1502UseIncrementalGeneratorAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1503NormalizeWhitespaceAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1504DuckDbTableMustBePartialAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1505DuckDbColumnConflictingOrdinalAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1600HardcodedPackageVersionAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1601VersionPropsNotImportedAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1602UndefinedVersionVariableAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1603ToAL1605DiagnosticsAlignmentAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1606OutdatedMafPackageVersionAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1700PreferStaticLambdaAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1701AvoidDateTimeNowAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1702AvoidNewtonsoftJsonAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1703UseImplicitTypeWhenApparentAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1800DestructiveToolMustRequireApprovalAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1801ToolMustDeclareSideEffectAnalyzer.cssrc/ANcpLua.Analyzers/Analyzers/AL1802ToolMustDeclareCapabilityAnalyzer.cssrc/ANcpLua.Analyzers/AotContext.cssrc/ANcpLua.Analyzers/CLAUDE.mdsrc/ANcpLua.Analyzers/CLAUDE.mdsrc/ANcpLua.Analyzers/Resources.resxsrc/ANcpLua.Analyzers/build/ANcpLua.Analyzers.propstests/ANcpLua.Analyzers.Tests/AL1000PrimaryConstructorReassignmentTests.cstests/ANcpLua.Analyzers.Tests/AL1001NegatedPatternTests.cstests/ANcpLua.Analyzers.Tests/AL1002DivisionByZeroTests.cstests/ANcpLua.Analyzers.Tests/AL1003ToAL1004SpanComparisonTests.cstests/ANcpLua.Analyzers.Tests/AL1005FieldNameConflictWithPrimaryConstructorTests.cstests/ANcpLua.Analyzers.Tests/AL1006ToAL1008IXmlSerializableTests.cstests/ANcpLua.Analyzers.Tests/AL1009LockKeywordTests.cstests/ANcpLua.Analyzers.Tests/AL1010PatternMatchingTests.cstests/ANcpLua.Analyzers.Tests/AL1011NormalizeNullGuardStyleTests.cstests/ANcpLua.Analyzers.Tests/AL1012CombineDeclarationWithNullCheckTests.cstests/ANcpLua.Analyzers.Tests/AL1100ToAL1104FormBindingTests.cstests/ANcpLua.Analyzers.Tests/AL1105MissingResilienceConfigurationTests.cstests/ANcpLua.Analyzers.Tests/AL1106MissingHealthChecksTests.cstests/ANcpLua.Analyzers.Tests/AL1107ConsiderConnectionStringTests.cstests/ANcpLua.Analyzers.Tests/AL1108MissingServiceDiscoveryTests.cstests/ANcpLua.Analyzers.Tests/AL1109AvoidTaskRunInAspNetCoreTests.cstests/ANcpLua.Analyzers.Tests/AL1200UseIsEqualToTests.cstests/ANcpLua.Analyzers.Tests/AL1201UseHasAttributeCodeFixTests.cstests/ANcpLua.Analyzers.Tests/AL1201UseHasAttributeTests.cstests/ANcpLua.Analyzers.Tests/AL1202UseTypeHierarchyTests.cstests/ANcpLua.Analyzers.Tests/AL1203UseOperationExtensionsTests.cstests/ANcpLua.Analyzers.Tests/AL1204UseOrEmptyTests.cstests/ANcpLua.Analyzers.Tests/AL1206UseWhereNotNullCodeFixTests.cstests/ANcpLua.Analyzers.Tests/AL1206UseWhereNotNullTests.cstests/ANcpLua.Analyzers.Tests/AL1208UseGuardNotNullTests.cstests/ANcpLua.Analyzers.Tests/AL1209UseTryParseExtensionsTests.cstests/ANcpLua.Analyzers.Tests/AL1210UseStringComparisonExtensionsTests.cstests/ANcpLua.Analyzers.Tests/AL1211UseAttributeExtensionsTests.cstests/ANcpLua.Analyzers.Tests/AL1212UseGuardNotNullOrEmptyTests.cstests/ANcpLua.Analyzers.Tests/AL1213UseGuardNotNullOrWhiteSpaceTests.cstests/ANcpLua.Analyzers.Tests/AL1214UseGuardNotZeroTests.cstests/ANcpLua.Analyzers.Tests/AL1215UseGuardNotNegativeTests.cstests/ANcpLua.Analyzers.Tests/AL1216UseGuardPositiveTests.cstests/ANcpLua.Analyzers.Tests/AL1217UseGuardNotEmptyGuidTests.cstests/ANcpLua.Analyzers.Tests/AL1218UseGuardDefinedEnumTests.cstests/ANcpLua.Analyzers.Tests/AL1219UseStringComparisonAnyExtensionsTests.cstests/ANcpLua.Analyzers.Tests/AL1220UseGuardForThrowIfCodeFixTests.cstests/ANcpLua.Analyzers.Tests/AL1220UseGuardForThrowIfTests.cstests/ANcpLua.Analyzers.Tests/AL1300ToAL1303ThreadingTests.cstests/ANcpLua.Analyzers.Tests/AL1304PreferAwaitUsingTests.cstests/ANcpLua.Analyzers.Tests/AL1305AvoidBlockingCallsInAsyncTests.cstests/ANcpLua.Analyzers.Tests/AL1306SqlInterpolationInCommandTextTests.cstests/ANcpLua.Analyzers.Tests/AL1307FireAndForgetTaskTests.cstests/ANcpLua.Analyzers.Tests/AL1308PreferTryParseTests.cstests/ANcpLua.Analyzers.Tests/AL1309EmptyCatchBlockTests.cstests/ANcpLua.Analyzers.Tests/AL1310ExceptionLeakedInResponseTests.cstests/ANcpLua.Analyzers.Tests/AL1311UnnecessaryLinqMaterializationTests.cstests/ANcpLua.Analyzers.Tests/AL1312ReadModifyWriteWithoutTransactionTests.cstests/ANcpLua.Analyzers.Tests/AL1313CancellationTokenPropagationTests.cstests/ANcpLua.Analyzers.Tests/AL1314UseExplicitMidpointRoundingCodeFixTests.cstests/ANcpLua.Analyzers.Tests/AL1314UseExplicitMidpointRoundingTests.cstests/ANcpLua.Analyzers.Tests/AL1401AotTestExitCode100Tests.cstests/ANcpLua.Analyzers.Tests/AL1403AotSafeViolationTests.cstests/ANcpLua.Analyzers.Tests/AL1404AotSafeCallsAotUnsafeTests.cstests/ANcpLua.Analyzers.Tests/AL1405UnnecessaryAotUnsafeTests.cstests/ANcpLua.Analyzers.Tests/AL1406AvoidDynamicKeywordTests.cstests/ANcpLua.Analyzers.Tests/AL1407AvoidExpressionCompileTests.cstests/ANcpLua.Analyzers.Tests/AL1501SymbolStoredInModelTests.cstests/ANcpLua.Analyzers.Tests/AL1502UseIncrementalGeneratorTests.cstests/ANcpLua.Analyzers.Tests/AL1503NormalizeWhitespaceTests.cstests/ANcpLua.Analyzers.Tests/AL1504DuckDbTableMustBePartialTests.cstests/ANcpLua.Analyzers.Tests/AL1505DuckDbColumnConflictingOrdinalTests.cstests/ANcpLua.Analyzers.Tests/AL1601VersionPropsNotImportedTests.cstests/ANcpLua.Analyzers.Tests/AL1602UndefinedVersionVariableTests.cstests/ANcpLua.Analyzers.Tests/AL1606OutdatedMafPackageVersionTests.cstests/ANcpLua.Analyzers.Tests/AL1700PreferStaticLambdaTests.cstests/ANcpLua.Analyzers.Tests/AL1701AvoidDateTimeNowTests.cstests/ANcpLua.Analyzers.Tests/AL1702AvoidNewtonsoftJsonTests.cstests/ANcpLua.Analyzers.Tests/AL1703UseImplicitTypeWhenApparentTests.cstests/ANcpLua.Analyzers.Tests/ANcpLua.Analyzers.Tests.csprojtests/ANcpLua.Analyzers.Tests/CLAUDE.md
|
|
||
| `src/ANcpLua.Analyzers/Resources.resx` contains 390 `<data name="AL####...">` entries spanning numeric IDs `AL0001..AL0136`. Cross-referencing against the active analyzer literals reveals **44 numeric IDs that have no live analyzer in this repo**: | ||
|
|
||
| ``` |
There was a problem hiding this comment.
Add fenced-code language identifiers to clear markdown lint failures.
Line 157, Line 174, and Line 221 use bare triple-backtick fences, which triggers MD040.
Suggested patch
-```
+```text
AL0010 AL0012 AL0013
AL0061 AL0062 AL0063 AL0064 AL0065 AL0066 AL0067 AL0068 AL0069 AL0070
...
AL0131 AL0132 AL0133 AL0134 AL0135 AL0136- +text
AL0010CodeFixTitle
AL0012CodeFixTitle
...
AL0135CodeFixTitle
-```
+```text
AL{old}AnalyzerTitle -> AL{new}AnalyzerTitle
AL{old}AnalyzerMessageFormat -> AL{new}AnalyzerMessageFormat
AL{old}AnalyzerDescription -> AL{new}AnalyzerDescription
AL{old}CodeFixTitle -> AL{new}CodeFixTitle
AL{old}{Variant}CodeFixTitle -> AL{new}{Variant}CodeFixTitle
</details>
Also applies to: 174-174, 221-221
<details>
<summary>🧰 Tools</summary>
<details>
<summary>🪛 markdownlint-cli2 (0.22.1)</summary>
[warning] 157-157: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
</details>
</details>
<details>
<summary>🤖 Prompt for AI Agents</summary>
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @eng/analyzer-renumber-plan.md at line 157, The markdown uses bare
triple-backtick fences at the examples in analyzer-renumber-plan.md (notably the
fenced blocks currently at lines referenced in the review) which triggers MD040;
update each of those fenced code blocks (the blocks containing lists like
"AL0010 AL0012...", "AL0010CodeFixTitle...", and the mapping block
"AL{old}AnalyzerTitle -> AL{new}AnalyzerTitle") to include a language identifier
(e.g., text) immediately after the opening so they becometext, ensuring
all three problematic blocks are consistently annotated to satisfy the linter.
</details>
<!-- fingerprinting:phantom:poseidon:hawk -->
<!-- This is an auto-generated comment by CodeRabbit -->
| CodeFixResources.AL1500CodeFixTitle, | ||
| _ => FixSwitchExpression(document, root, switchExpr, raw), | ||
| nameof(CodeFixResources.AL0103CodeFixTitle)), | ||
| nameof(CodeFixResources.AL1500CodeFixTitle)), |
There was a problem hiding this comment.
Use the analyzer DiagnosticId as the equivalenceKey for both code actions.
Line 31 and Line 36 key by resource-name string; key by Al1500ClosedTypeHierarchySwitchAnalyzer.DiagnosticId to keep FixAll identity tied to the diagnostic.
Suggested patch
SwitchExpressionSyntax switchExpr => CodeAction.Create(
CodeFixResources.AL1500CodeFixTitle,
_ => FixSwitchExpression(document, root, switchExpr, raw),
- nameof(CodeFixResources.AL1500CodeFixTitle)),
+ Al1500ClosedTypeHierarchySwitchAnalyzer.DiagnosticId),
@@
SwitchStatementSyntax switchStmt => CodeAction.Create(
CodeFixResources.AL1500CodeFixTitle,
_ => FixSwitchStatement(document, root, switchStmt, raw),
- nameof(CodeFixResources.AL1500CodeFixTitle)),
+ Al1500ClosedTypeHierarchySwitchAnalyzer.DiagnosticId),As per coding guidelines, src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL*.cs: reference the analyzer’s public DiagnosticId directly in CodeFixProvider implementations, and include a stable equivalenceKey in CodeAction.Create() for FixAll support.
Also applies to: 36-36
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1500AddMissingCasesCodeFixProvider.cs`
at line 31, The code actions in AL1500AddMissingCasesCodeFixProvider are using
the resource name string as the equivalenceKey; change both CodeAction.Create
calls to use Al1500ClosedTypeHierarchySwitchAnalyzer.DiagnosticId as the
equivalenceKey so FixAll groups by the analyzer diagnostic ID. Locate the
CodeAction.Create invocations in class AL1500AddMissingCasesCodeFixProvider and
replace the current nameof(CodeFixResources.AL1500CodeFixTitle) equivalenceKey
argument with Al1500ClosedTypeHierarchySwitchAnalyzer.DiagnosticId for both code
actions so they share the stable identifier.
| [ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(Al1503NormalizeWhitespaceCodeFixProvider))] | ||
| [Shared] | ||
| public sealed partial class Al0121NormalizeWhitespaceCodeFixProvider : CodeFixProvider { | ||
| public sealed partial class Al1503NormalizeWhitespaceCodeFixProvider : CodeFixProvider { |
There was a problem hiding this comment.
🛠️ Refactor suggestion | 🟠 Major | 🏗️ Heavy lift
Adopt AlCodeFixProvider<TNode> for AL code-fix implementations.
This provider still derives from CodeFixProvider; AL code-fix files in this folder are required to use the AlCodeFixProvider base type.
As per coding guidelines, "src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL*.cs: CodeFixProvider implementations must use the AlCodeFixProvider base class with a generic node type parameter."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1503NormalizeWhitespaceCodeFixProvider.cs`
at line 10, The class Al1503NormalizeWhitespaceCodeFixProvider currently
inherits from CodeFixProvider; change its base to the AL-specific generic base
by making it inherit from AlCodeFixProvider<TNode> (replace CodeFixProvider with
AlCodeFixProvider<TNode> and pick the appropriate AL SyntaxNode type used by
this fix), update any constructors/overrides to match the AlCodeFixProvider API
(e.g., constructor signature, RegisterCodeFixesAsync/FixAllProvider overrides if
their signatures differ), and add the necessary using/import for the
AlCodeFixProvider type so the class compiles while preserving the existing class
name Al1503NormalizeWhitespaceCodeFixProvider and its existing members.
| CodeAction.Create( | ||
| CodeFixResources.AL0121CodeFixTitle, | ||
| CodeFixResources.AL1503CodeFixTitle, | ||
| _ => RemoveNormalizeWhitespaceAsync(context.Document, invocation, root), | ||
| nameof(CodeFixResources.AL0121CodeFixTitle)), | ||
| nameof(CodeFixResources.AL1503CodeFixTitle)), |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify equivalenceKey usage in AL code fix providers.
rg -n --type=cs 'CodeAction\.Create\(' src/ANcpLua.Analyzers.CodeFixes/CodeFixes \
| sed -n '1,200p'
rg -n --type=cs 'nameof\(CodeFixResources\.AL[0-9]{4}CodeFixTitle\)' src/ANcpLua.Analyzers.CodeFixes/CodeFixesRepository: ANcpLua/ANcpLua.Analyzers
Length of output: 5381
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# 1) Inspect the AL1503 code fix provider class declaration and the specific CodeAction.Create call region.
FILE="src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1503NormalizeWhitespaceCodeFixProvider.cs"
echo "=== $FILE (head 120) ==="
wc -l "$FILE"
sed -n '1,120p' "$FILE"
echo
echo "=== $FILE (around CodeAction.Create usage) ==="
# Print around the lines containing CodeAction.Create in this file.
rg -n --type=cs "CodeAction\.Create\(" "$FILE"
LINE=$(rg -n --type=cs "CodeAction\.Create\(" "$FILE" | head -n1 | cut -d: -f1)
START=$((LINE-15))
END=$((LINE+25))
sed -n "${START},${END}p" "$FILE"
# 2) Find how other AL code fix providers build equivalenceKey: look for CodeAction.Create third argument usage.
echo
echo "=== Files using nameof(CodeFixResources.ALXXXXCodeFixTitle) as equivalenceKey ==="
rg -n --type=cs "CodeAction\.Create\([^;]*nameof\(CodeFixResources\.AL[0-9]{4}CodeFixTitle\)" src/ANcpLua.Analyzers.CodeFixes/CodeFixes -S
echo
echo "=== Files using DiagnosticId as equivalenceKey (look for DiagnosticId in CodeAction.Create args) ==="
rg -n --type=cs "CodeAction\.Create\([^;]*DiagnosticId" src/ANcpLua.Analyzers.CodeFixes/CodeFixes -S
# 3) Inspect AlCodeFixProvider base class usage in this repo (what do AL code fix providers typically inherit from?)
echo
echo "=== Base class inheritance for AL code fix providers ==="
rg -n --type=cs "class (AL[0-9]{4}[A-Za-z0-9_]*CodeFixProvider|.*CodeFixProvider).*:.*AlCodeFixProvider" src/ANcpLua.Analyzers.CodeFixes/CodeFixes -S || true
rg -n --type=cs "class (AL[0-9]{4}[A-Za-z0-9_]*CodeFixProvider|.*CodeFixProvider).*:.*CodeFixProvider" src/ANcpLua.Analyzers.CodeFixes/CodeFixes -S || true
# 4) Print AlCodeFixProvider definition (to confirm generic node parameter expectation and how equivalenceKey is meant to be set).
BASE_FILE=$(fd -a "AlCodeFixProvider" src/ANcpLua.Analyzers.CodeFixes | head -n 20 || true)
echo
echo "AlCodeFixProvider file candidates:"
echo "$BASE_FILE"
for f in $BASE_FILE; do
echo "=== $f (head 200) ==="
sed -n '1,200p' "$f"
doneRepository: ANcpLua/ANcpLua.Analyzers
Length of output: 5662
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# 1) Inspect the AL1503 code fix provider class declaration and the specific CodeAction.Create call region.
FILE="src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1503NormalizeWhitespaceCodeFixProvider.cs"
echo "=== $FILE (head 120) ==="
wc -l "$FILE"
sed -n '1,120p' "$FILE"
echo
echo "=== $FILE (around CodeAction.Create usage) ==="
# Print around the lines containing CodeAction.Create in this file.
rg -n --type=cs "CodeAction\.Create\(" "$FILE"
LINE=$(rg -n --type=cs "CodeAction\.Create\(" "$FILE" | head -n1 | cut -d: -f1)
START=$((LINE-15))
END=$((LINE+25))
sed -n "${START},${END}p" "$FILE"
# 2) Find how other AL code fix providers build equivalenceKey: look for CodeAction.Create third argument usage.
echo
echo "=== Files using nameof(CodeFixResources.ALXXXXCodeFixTitle) as equivalenceKey ==="
rg -n --type=cs "CodeAction\.Create\([^;]*nameof\(CodeFixResources\.AL[0-9]{4}CodeFixTitle\)" src/ANcpLua.Analyzers.CodeFixes/CodeFixes -S
echo
echo "=== Files using DiagnosticId as equivalenceKey (look for DiagnosticId in CodeAction.Create args) ==="
rg -n --type=cs "CodeAction\.Create\([^;]*DiagnosticId" src/ANcpLua.Analyzers.CodeFixes/CodeFixes -S
# 3) Inspect AlCodeFixProvider base class usage in this repo (what do AL code fix providers typically inherit from?)
echo
echo "=== Base class inheritance for AL code fix providers ==="
rg -n --type=cs "class .*:.*AlCodeFixProvider" src/ANcpLua.Analyzers.CodeFixes/CodeFixes -S || true
rg -n --type=cs "class .*:.*CodeFixProvider" src/ANcpLua.Analyzers.CodeFixes/CodeFixes -S || true
# 4) Print AlCodeFixProvider definition (to confirm generic node parameter expectation and how equivalenceKey is meant to be set).
BASE_FILE=$(fd -a "AlCodeFixProvider" src/ANcpLua.Analyzers.CodeFixes | head -n 20 || true)
echo
echo "AlCodeFixProvider file candidates:"
echo "$BASE_FILE"
for f in $BASE_FILE; do
echo "=== $f (head 200) ==="
sed -n '1,200p' "$f"
doneRepository: ANcpLua/ANcpLua.Analyzers
Length of output: 5662
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# 1) Inspect the AL1503 code fix provider class declaration and the specific CodeAction.Create call region.
FILE="src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1503NormalizeWhitespaceCodeFixProvider.cs"
echo "=== $FILE (head 120) ==="
wc -l "$FILE"
sed -n '1,120p' "$FILE"
echo
echo "=== $FILE (around CodeAction.Create usage) ==="
# Print around the lines containing CodeAction.Create in this file.
rg -n --type=cs "CodeAction\.Create\(" "$FILE"
LINE=$(rg -n --type=cs "CodeAction\.Create\(" "$FILE" | head -n1 | cut -d: -f1)
START=$((LINE-15))
END=$((LINE+25))
sed -n "${START},${END}p" "$FILE"
# 2) Find how other AL code fix providers build equivalenceKey: look for CodeAction.Create third argument usage.
echo
echo "=== Files using nameof(CodeFixResources.ALXXXXCodeFixTitle) as equivalenceKey ==="
rg -n --type=cs "CodeAction\.Create\([^;]*nameof\(CodeFixResources\.AL[0-9]{4}CodeFixTitle\)" src/ANcpLua.Analyzers.CodeFixes/CodeFixes -S
echo
echo "=== Files using DiagnosticId as equivalenceKey (look for DiagnosticId in CodeAction.Create args) ==="
rg -n --type=cs "CodeAction\.Create\([^;]*DiagnosticId" src/ANcpLua.Analyzers.CodeFixes/CodeFixes -S
# 3) Inspect AlCodeFixProvider base class usage in this repo (what do AL code fix providers typically inherit from?)
echo
echo "=== Base class inheritance for AL code fix providers ==="
rg -n --type=cs "class .*:.*AlCodeFixProvider" src/ANcpLua.Analyzers.CodeFixes/CodeFixes -S || true
rg -n --type=cs "class .*:.*CodeFixProvider" src/ANcpLua.Analyzers.CodeFixes/CodeFixes -S || true
# 4) Print AlCodeFixProvider definition (to confirm generic node parameter expectation and how equivalenceKey is meant to be set).
BASE_FILE=$(fd -a "AlCodeFixProvider" src/ANcpLua.Analyzers.CodeFixes | head -n 20 || true)
echo
echo "AlCodeFixProvider file candidates:"
echo "$BASE_FILE"
for f in $BASE_FILE; do
echo "=== $f (head 200) ==="
sed -n '1,200p' "$f"
doneRepository: ANcpLua/ANcpLua.Analyzers
Length of output: 5662
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# 1) Inspect the AL1503 code fix provider class declaration and the specific CodeAction.Create call region.
FILE="src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1503NormalizeWhitespaceCodeFixProvider.cs"
echo "=== $FILE (head 120) ==="
wc -l "$FILE"
sed -n '1,120p' "$FILE"
echo
echo "=== $FILE (around CodeAction.Create usage) ==="
rg -n --type=cs "CodeAction\.Create\(" "$FILE"
LINE=$(rg -n --type=cs "CodeAction\.Create\(" "$FILE" | head -n1 | cut -d: -f1)
START=$((LINE-15))
END=$((LINE+25))
sed -n "${START},${END}p" "$FILE"
# 2) Find how other AL code fix providers build equivalenceKey: look for CodeAction.Create third argument usage.
echo
echo "=== Files using nameof(CodeFixResources.ALXXXXCodeFixTitle) as equivalenceKey ==="
rg -n --type=cs "CodeAction\.Create\([^;]*nameof\(CodeFixResources\.AL[0-9]{4}CodeFixTitle\)" src/ANcpLua.Analyzers.CodeFixes/CodeFixes -S
echo
echo "=== Files using DiagnosticId as equivalenceKey (look for DiagnosticId in CodeAction.Create args) ==="
rg -n --type=cs "CodeAction\.Create\([^;]*DiagnosticId" src/ANcpLua.Analyzers.CodeFixes/CodeFixes -S
# 3) Inspect AlCodeFixProvider base class usage in this repo (what do AL code fix providers typically inherit from?)
echo
echo "=== Base class inheritance for AL code fix providers ==="
rg -n --type=cs "class .*:.*AlCodeFixProvider" src/ANcpLua.Analyzers.CodeFixes/CodeFixes -S || true
rg -n --type=cs "class .*:.*CodeFixProvider" src/ANcpLua.Analyzers.CodeFixes/CodeFixes -S || true
# 4) Print AlCodeFixProvider definition (to confirm generic node parameter expectation and how equivalenceKey is meant to be set).
BASE_FILE=$(fd -a "AlCodeFixProvider" src/ANcpLua.Analyzers.CodeFixes | head -n 20 || true)
echo
echo "AlCodeFixProvider file candidates:"
echo "$BASE_FILE"
for f in $BASE_FILE; do
echo "=== $f (head 200) ==="
sed -n '1,200p' "$f"
doneRepository: ANcpLua/ANcpLua.Analyzers
Length of output: 5662
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Locate AlCodeFixProvider definition in the repo (no failure if not found)
fd -a "AlCodeFixProvider" src | head -n 50 || true
# Check whether any AL code fix providers inherit from AlCodeFixProvider<TNode>
rg -n --type=cs ":\s*AlCodeFixProvider<" src/ANcpLua.Analyzers.CodeFixes || true
# List class declarations of CodeFixProvider/AlCodeFixProvider usage in AL code-fix files
rg -n --type=cs "class\s+.*CodeFixProvider\s*:\s*(CodeFixProvider|AlCodeFixProvider)" src/ANcpLua.Analyzers.CodeFixes/CodeFixes || true
# Show a couple representative AL code fix provider files near the inheritance pattern
for f in \
$(fd -a "AL*CodeFixProvider.cs" src/ANcpLua.Analyzers.CodeFixes/CodeFixes | head -n 10); do
echo "==== $f ===="
sed -n '1,80p' "$f"
doneRepository: ANcpLua/ANcpLua.Analyzers
Length of output: 9292
Use AlCodeFixProvider<TNode> in AL1503NormalizeWhitespaceCodeFixProvider
AL1503NormalizeWhitespaceCodeFixProvider inherits CodeFixProvider directly, but src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL*.cs requires all AL code fix providers to use AlCodeFixProvider<TNode> as the base class.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@src/ANcpLua.Analyzers.CodeFixes/CodeFixes/AL1503NormalizeWhitespaceCodeFixProvider.cs`
around lines 33 - 36, AL1503NormalizeWhitespaceCodeFixProvider currently
inherits CodeFixProvider directly; change its base to AlCodeFixProvider<TNode>
(using the appropriate syntax and TNode type that matches the analyzed node used
by RemoveNormalizeWhitespaceAsync) so it follows the AL code-fix pattern. Update
the class declaration for AL1503NormalizeWhitespaceCodeFixProvider to inherit
from AlCodeFixProvider<TNode>, ensure constructor and any overrides match the
generic base (adjust method signatures if the base requires an overridden
RegisterCodeFixesAsync or similar), and keep the existing CodeAction.Create call
and RemoveNormalizeWhitespaceAsync method intact but adapted to the generic node
type.
| <data name="AL1217CodeFixTitle" xml:space="preserve"> | ||
| <value>Use Guard.NotEmpty</value> | ||
| </data> |
There was a problem hiding this comment.
Correct AL1217 code-fix title to reference GUID validation.
Line 158 currently says Use Guard.NotEmpty, but this rule targets non-empty GUID validation; the title should be Use Guard.NotEmptyGuid to match analyzer intent and avoid misleading users.
As per coding guidelines, Use Guard.NotEmptyGuid for non-empty GUID validation (AL0050).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/ANcpLua.Analyzers.CodeFixes/CodeFixResources.resx` around lines 157 -
159, Update the resource string AL1217CodeFixTitle so the displayed title
matches the analyzer intent: change the value text from "Use Guard.NotEmpty" to
"Use Guard.NotEmptyGuid" to correctly reference GUID validation (AL0050); locate
the AL1217CodeFixTitle resource entry in CodeFixResources.resx and replace the
value accordingly.
| public sealed partial class Al1011PortableFormCodeFixTests : CodeFixTestWithEditorConfig<Al1011NormalizeNullGuardStyleAnalyzer | ||
| , Al1011NormalizeNullGuardStyleCodeFixProvider> { |
There was a problem hiding this comment.
Fix generic type argument comma placement to satisfy style analyzers.
These declarations place , on the next line before the second type argument, which violates your formatting rules and can fail analyzer checks.
Suggested diff
-public sealed partial class Al1011PortableFormCodeFixTests : CodeFixTestWithEditorConfig<Al1011NormalizeNullGuardStyleAnalyzer
- , Al1011NormalizeNullGuardStyleCodeFixProvider> {
+public sealed partial class Al1011PortableFormCodeFixTests : CodeFixTestWithEditorConfig<Al1011NormalizeNullGuardStyleAnalyzer,
+ Al1011NormalizeNullGuardStyleCodeFixProvider> {
-public sealed partial class Al1011BclFormCodeFixTests : CodeFixTestWithEditorConfig<Al1011NormalizeNullGuardStyleAnalyzer,
- Al1011NormalizeNullGuardStyleCodeFixProvider> {
+public sealed partial class Al1011BclFormCodeFixTests : CodeFixTestWithEditorConfig<Al1011NormalizeNullGuardStyleAnalyzer,
+ Al1011NormalizeNullGuardStyleCodeFixProvider> {
-public sealed partial class Al1011MultiTargetTests : CodeFixTestWithEditorConfig<Al1011NormalizeNullGuardStyleAnalyzer,
- Al1011NormalizeNullGuardStyleCodeFixProvider> {
+public sealed partial class Al1011MultiTargetTests : CodeFixTestWithEditorConfig<Al1011NormalizeNullGuardStyleAnalyzer,
+ Al1011NormalizeNullGuardStyleCodeFixProvider> {
-public sealed partial class Al1011EdgeCasesTests : CodeFixTestWithEditorConfig<Al1011NormalizeNullGuardStyleAnalyzer,
- Al1011NormalizeNullGuardStyleCodeFixProvider> {
+public sealed partial class Al1011EdgeCasesTests : CodeFixTestWithEditorConfig<Al1011NormalizeNullGuardStyleAnalyzer,
+ Al1011NormalizeNullGuardStyleCodeFixProvider> {As per coding guidelines: "Comma should be on the same line as previous parameter (SA1113)" and "Parameter should follow comma (SA1115)".
Also applies to: 301-302, 508-509, 655-656
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@tests/ANcpLua.Analyzers.Tests/AL1011NormalizeNullGuardStyleTests.cs` around
lines 57 - 58, The generic type argument list in the class declaration
Al1011PortableFormCodeFixTests splits the comma onto the next line before the
second type argument; update the declaration so the comma follows the first type
argument on the same line (e.g., "Al1011NormalizeNullGuardStyleAnalyzer,
Al1011NormalizeNullGuardStyleCodeFixProvider") to satisfy SA1113/SA1115; apply
the same fix to the other occurrences mentioned (the other class/generic
declarations around the noted lines).
| /// Tests for AL1214: Use Guard.NotZero instead of if (x == 0) throw ArgumentOutOfRangeException. | ||
| /// </summary> | ||
| public sealed partial class Al0047UseGuardNotZeroTests : AnalyzerTest<Al0047UseGuardNotZeroAnalyzer> { | ||
| public sealed partial class Al1214UseGuardNotZeroTests : AnalyzerTest<Al1214UseGuardNotZeroAnalyzer> { |
There was a problem hiding this comment.
Use the required AnalyzerTestBase alias instead of inheriting AnalyzerTest<T> directly.
This test class is still using AnalyzerTest<Al1214UseGuardNotZeroAnalyzer> directly; switch to the repository’s AnalyzerTestBase alias pattern for AL* tests.
Proposed fix
+using AnalyzerTestBase = ANcpLua.Roslyn.Utilities.Testing.AnalyzerTest<ANcpLua.Analyzers.Analyzers.Al1214UseGuardNotZeroAnalyzer>;
using ANcpLua.Analyzers.Analyzers;
using ANcpLua.Roslyn.Utilities.Testing;
@@
-public sealed partial class Al1214UseGuardNotZeroTests : AnalyzerTest<Al1214UseGuardNotZeroAnalyzer> {
+public sealed partial class Al1214UseGuardNotZeroTests : AnalyzerTestBase {As per coding guidelines tests/ANcpLua.Analyzers.Tests/AL*Tests.cs: “Analyzer tests must inherit from AnalyzerTestBase alias (typed to the specific analyzer) and use sealed partial class modifiers.”
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@tests/ANcpLua.Analyzers.Tests/AL1214UseGuardNotZeroTests.cs` around lines 7 -
9, The test class Al1214UseGuardNotZeroTests currently inherits from
AnalyzerTest<Al1214UseGuardNotZeroAnalyzer>; change its base to the repository's
AnalyzerTestBase alias typed to the analyzer (i.e.
AnalyzerTestBase<Al1214UseGuardNotZeroAnalyzer>) while keeping the sealed
partial class modifiers so the class signature reads as a sealed partial class
using the AnalyzerTestBase alias.
| /// Tests for AL1404: [AotSafe] code must not call [AotUnsafe] code. | ||
| /// </summary> | ||
| public sealed partial class Al0052AotSafeCallsAotUnsafeTests : AnalyzerTest<Al0052AotSafeCallsAotUnsafeAnalyzer> { | ||
| public sealed partial class Al1404AotSafeCallsAotUnsafeTests : AnalyzerTest<Al1404AotSafeCallsAotUnsafeAnalyzer> { |
There was a problem hiding this comment.
🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win
Use the typed AnalyzerTestBase alias instead of direct generic inheritance.
Align this analyzer test with the AL*Tests convention by inheriting from the file-local typed alias.
Suggested patch
using ANcpLua.Analyzers.Analyzers;
using ANcpLua.Roslyn.Utilities.Testing;
+using AnalyzerTestBase = ANcpLua.Roslyn.Utilities.Testing.AnalyzerTest<Al1404AotSafeCallsAotUnsafeAnalyzer>;
@@
-public sealed partial class Al1404AotSafeCallsAotUnsafeTests : AnalyzerTest<Al1404AotSafeCallsAotUnsafeAnalyzer> {
+public sealed partial class Al1404AotSafeCallsAotUnsafeTests : AnalyzerTestBase {As per coding guidelines, tests/ANcpLua.Analyzers.Tests/AL*Tests.cs: Analyzer tests must inherit from AnalyzerTestBase alias (typed to the specific analyzer) and use sealed partial class modifiers.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@tests/ANcpLua.Analyzers.Tests/AL1404AotSafeCallsAotUnsafeTests.cs` at line 9,
The test class Al1404AotSafeCallsAotUnsafeTests currently inherits directly from
AnalyzerTest<Al1404AotSafeCallsAotUnsafeAnalyzer>; change it to use the
file-local typed alias AnalyzerTestBase (typed to
Al1404AotSafeCallsAotUnsafeAnalyzer) so the class becomes sealed partial class
Al1404AotSafeCallsAotUnsafeTests : AnalyzerTestBase; locate the class
declaration and replace the generic base type with the alias while keeping the
sealed partial modifiers.
| public sealed partial class Al1703UseImplicitTypeWhenApparentTests | ||
| : AnalyzerTest<Al1703UseImplicitTypeWhenApparentAnalyzer> { |
There was a problem hiding this comment.
Use the required AnalyzerTestBase alias for this analyzer test class.
Line 11 inherits AnalyzerTest<...> directly; this test file pattern requires the typed alias.
Suggested patch
+using AnalyzerTestBase = ANcpLua.Roslyn.Utilities.Testing.AnalyzerTest<ANcpLua.Analyzers.Analyzers.Al1703UseImplicitTypeWhenApparentAnalyzer>;
using ANcpLua.Analyzers.Analyzers;
using ANcpLua.Analyzers.CodeFixes.CodeFixes;
using ANcpLua.Roslyn.Utilities.Testing;
@@
public sealed partial class Al1703UseImplicitTypeWhenApparentTests
- : AnalyzerTest<Al1703UseImplicitTypeWhenApparentAnalyzer> {
+ : AnalyzerTestBase {As per coding guidelines, tests/ANcpLua.Analyzers.Tests/AL*Tests.cs: Analyzer tests must inherit from AnalyzerTestBase alias (typed to the specific analyzer) and use sealed partial class modifiers.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@tests/ANcpLua.Analyzers.Tests/AL1703UseImplicitTypeWhenApparentTests.cs`
around lines 10 - 11, The test class Al1703UseImplicitTypeWhenApparentTests
currently inherits AnalyzerTest<Al1703UseImplicitTypeWhenApparentAnalyzer>;
update the inheritance to use the required typed alias AnalyzerTestBase by
changing the base to AnalyzerTestBase<Al1703UseImplicitTypeWhenApparentAnalyzer>
so the sealed partial class follows the analyzer test pattern.
| |---------------------|----------------------------------------| | ||
| | `[|code|]` | Expected diagnostic at this location | | ||
| | `{|AL0001:code|}` | Expected specific diagnostic ID | | ||
| | `{|AL1000:code|}` | Expected specific diagnostic ID | |
There was a problem hiding this comment.
Escape the diagnostic marker pipes in the table cell.
Line 75 currently breaks Markdown table parsing (MD056); escape the | characters or encode them so the row stays two columns.
Proposed fix
-| `{|AL1000:code|}` | Expected specific diagnostic ID |
+| `{&`#124`;AL1000:code&`#124`;}` | Expected specific diagnostic ID |📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| | `{|AL1000:code|}` | Expected specific diagnostic ID | | |
| | `{&`#124`;AL1000:code&`#124`;}` | Expected specific diagnostic ID | |
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)
[warning] 75-75: Table column count
Expected: 2; Actual: 4; Too many cells, extra data will be missing
(MD056, table-column-count)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@tests/ANcpLua.Analyzers.Tests/CLAUDE.md` at line 75, The table row breaks
Markdown parsing because the diagnostic marker `{|AL1000:code|}` contains
unescaped pipe characters; fix by escaping the pipes inside that cell (e.g.,
replace `{|AL1000:code|}` with `{&`#124`;AL1000:code&`#124`;}` or
`{\\|AL1000:code\\|}`) so the row remains two columns and MD056 is resolved.
Triage Bot report
Threads marked |
1 similar comment
Triage Bot report
Threads marked |
Summary
Testing
|
|
Summary
Testing
|
|
Tip For best results, initiate chat on the files or code changes.
Blocking fixes to land now
Diff: --- a/src/ANcpLua.Analyzers/Analyzers/AL1602UndefinedVersionVariableAnalyzer.cs
+++ b/src/ANcpLua.Analyzers/Analyzers/AL1602UndefinedVersionVariableAnalyzer.cs
@@ -52,7 +52,7 @@ public sealed partial class Al1602UndefinedVersionVariableAnalyzer : AlAnalyzer {
private static readonly DiagnosticDescriptor s_rule = new(
DiagnosticId, s_title, s_messageFormat, DiagnosticCategories.VersionManagement,
- DiagnosticSeverity.Warning, true, s_description,
- AlAnalyzer.HelpLinkBase,
+ DiagnosticSeverity.Warning, true, s_description,
+ AlAnalyzer.HelpLink(DiagnosticId),
WellKnownDiagnosticTags.CompilationEnd);
Example snippet to apply where appropriate: EquivalenceKey hygiene (CodeRabbit threads)
Diffs: --- a/src/ANcpLua.Analyzers.CodeFixes/Refactorings/AR0001SnakeCaseToPascalCaseRefactoring.cs
+++ b/src/ANcpLua.Analyzers.CodeFixes/Refactorings/AR0001SnakeCaseToPascalCaseRefactoring.cs
@@ -55,8 +55,9 @@ public sealed partial class Ar0001SnakeCaseToPascalCaseRefactoring : CodeRefacto
- context.RegisterRefactoring(CodeAction.Create(
- CodeFixResources.AR0001RefactoringTitle,
- ct => RenameAsync(document, identifierToken, pascalCase, ct)));
+ context.RegisterRefactoring(CodeAction.Create(
+ CodeFixResources.AR0001RefactoringTitle,
+ ct => RenameAsync(document, identifierToken, pascalCase, ct),
+ equivalenceKey: "AR0001"));--- a/src/ANcpLua.Analyzers.CodeFixes/Refactorings/AR0002MakeStaticLambdaRefactoring.cs
+++ b/src/ANcpLua.Analyzers.CodeFixes/Refactorings/AR0002MakeStaticLambdaRefactoring.cs
@@ -41,9 +41,10 @@ public sealed partial class Ar0002MakeStaticLambdaRefactoring : CodeRefactoringProvider {
- context.RegisterRefactoring(
- CodeAction.Create(
- "Make lambda static",
- ct => MakeStaticAsync(document, span, ct)));
+ context.RegisterRefactoring(
+ CodeAction.Create(
+ "Make lambda static",
+ ct => MakeStaticAsync(document, span, ct),
+ equivalenceKey: "AR0002"));
@@
- context.RegisterRefactoring(
- CodeAction.Create(
- "Make all lambdas static in file",
- ct => MakeAllStaticInFileAsync(document, ct)));
+ context.RegisterRefactoring(
+ CodeAction.Create(
+ "Make all lambdas static in file",
+ ct => MakeAllStaticInFileAsync(document, ct),
+ equivalenceKey: "AR0002:File"));
@@
- context.RegisterRefactoring(
- CodeAction.Create(
- "Make all lambdas static in project",
- ct => MakeAllStaticInProjectAsync(document.Project, ct)));
+ context.RegisterRefactoring(
+ CodeAction.Create(
+ "Make all lambdas static in project",
+ ct => MakeAllStaticInProjectAsync(document.Project, ct),
+ equivalenceKey: "AR0002:Project"));
@@
- context.RegisterRefactoring(
- CodeAction.Create(
- "Make all lambdas static in solution",
- ct => MakeAllStaticInSolutionAsync(document.Project.Solution, ct)));
+ context.RegisterRefactoring(
+ CodeAction.Create(
+ "Make all lambdas static in solution",
+ ct => MakeAllStaticInSolutionAsync(document.Project.Solution, ct),
+ equivalenceKey: "AR0002:Solution"));How to close the blocking threads
Optional one‑shot local verification before replying
Post‑merge (non‑blocking here, but required for consumers)
If you want, I can prep a tiny PR patch with just the AL1602 HelpLink fix (and the optional refactoring equivalence keys). |
|
Tip For best results, initiate chat on the files or code changes.
Blocking items to land this PR
Concrete edits to apply now
Optional follow-ups (post-merge, tracked separately)
If you want, I’ll open tracking issues in the SDK and top consumer repos once this PR merges.
Would you like me to proceed to generate the exact diffs for each file listed above so you can apply and push them? The requested changes have been implemented and a pull request has been created: View PR |
Commit 2fe348d (CR autofix bot, 2026-05-25) bumped Version.props line <ANcpLuaAnalyzersVersion> from 1.29.4 -> 2.0.0. That value drives the SDK's GlobalPackageReference self-injection (the analyzer references itself as an analyzer via the SDK template). Asking for >= 2.0.0 failed NU1102 because ANcpLua.Analyzers 2.0.0 doesn't exist on nuget.org yet (it's the version THIS PR is producing). CR autofix conflated VersionPrefix (the version BUILT by this PR) with ANcpLuaAnalyzersVersion (the version CONSUMED for self-injection from nuget.org) despite the in-file comment on Directory.Build.props warning against exactly that pattern. Restore 1.29.4 (last-published) and add an inline INVARIANT comment so future autofix-style passes can't repeat the mistake. After this PR publishes 2.0.0 to nuget.org, a follow-up PR can bump this value to 2.0.0 — but never before. This incident is what got CR uninstalled across the orgs. See https://github.com/ANcpLua/github-settings-automation/blob/main/qyl-PRD.md Appendix 3 for the full freeze rationale + re-enable runbook. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@coderabbitai autofix |
|
Claude encountered an error after 2s —— View job I'll analyze this and get back to you. |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 2083 |
| Duplication | 187 |
AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.
TIP This summary will be updated as you push new changes.
…AL1010 resx The earlier CR autofix commit 5e81267 made two changes that broke the build after the renumber: 1. AL1201UseHasAttributeCodeFixProvider — switched base class from CodeFixProvider to AlCodeFixProvider<InvocationExpressionSyntax>, but kept the existing GetFixAllProvider / RegisterCodeFixesAsync overrides. The base class has those methods `sealed override`, so the result was CS0239 + CS0534. Revert the inheritance to CodeFixProvider; the actual refactor to the AL base class is a separate non-trivial change (need to implement CreateCodeAction and delete the existing overrides) that doesn't belong in a build-break-fix PR. 2. AL1010PatternMatchingCodeFixProvider — title argument changed from the hardcoded string "Use pattern matching" to CodeFixResources.AL1003CodeFixTitle (an unrelated AL1003 resx key). A later renumber-aware pass rewrote AL1003 -> AL1010, but the AL1010CodeFixTitle resx entry doesn't exist (only AL1009 / AL1011 do). Add the AL1010CodeFixTitle resx entry with the original "Use pattern matching" text + the matching Designer.cs property. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@coderabbitai autofix |
|
Claude encountered an error after 2s —— View job I'll analyze this and get back to you. |
The Shipped manifest was empty while Unshipped held every rule, so the RS2000 split carried no signal — it claimed nothing had ever shipped. Commit #174 introduced the AL1xxx domain-band scheme as the 2.0.0 breaking renumber, and v2.0.1 added zero rules, so the entire current rule set genuinely first shipped in 2.0.0. - Move all 89 rule rows into AnalyzerReleases.Shipped.md under `## Release 2.0.0`; reduce Unshipped to the empty "nothing pending" state. - Point the generated docs-index manifest line at Shipped (the real manifest now) instead of an empty Unshipped file. Verified: Release build (RS2000 + consistency --check) clean, 758/758 tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
Renumbers all 89 active analyzer rules from a sparse
AL0001..AL0139(~64% density, big gaps) into a clean 9-band 100-wide scheme:AL1000..AL1899. The AL0xxx range is reserved for sibling packages (ANcpLua.AotReflection / ExtensibleEnumMirror / DiscriminatedUnion already occupy AL01/02/03xx). Version bump: 1.29.4 → 2.0.0.AL1000..1099AL1100..1199AL1200..1299AL1300..1399AL1400..1499AL1500..1599AL1600..1699AL1700..1799AL1800..1899Each band leaves ~79 free slots. Reserved
AL1900..1999for future bands.Side cleanup
Qyl.OpenTelemetry.SemanticConventions.Analyzers. Forensic evidence of the cross-package migration that no consumer depends on.AL0010/AL0012/AL0013dogfood suppressions, the strayAL0038,AL0074semconv-folder scoped suppressions left only the still-relevantAL1210).Plan
Full mapping + cross-team migration audit at
eng/analyzer-renumber-plan.md. Cross-team candidates flagged: zero (the closest near-misses — AspNetCore at AL1105-1108, agent-governance at AL1800-1802 — were correctly identified as non-semconv).Test plan
dotnet build: 0/0dotnet test: 757/757 passdotnet pack src/ANcpLua.Analyzers/ANcpLua.Analyzers.csproj -p:PackageId=ANcpLua.Analyzers -p:Version=2.0.0(pernuget-publish.yml): cleanAfter merge
dotnet nuget push ANcpLua.Analyzers.2.0.0.nupkg🤖 Generated with Claude Code