Tune ANcpLua analyzer severity overrides#153
Conversation
|
@coderabbitai autofix |
📝 WalkthroughWalkthroughUpdated analyzer configs: Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error)
✅ Passed checks (7 passed)
Comment |
|
Claude encountered an error —— 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. |
There was a problem hiding this comment.
Pull request overview
This PR adjusts the repository’s .editorconfig overrides for ANcpLua analyzer diagnostics to reduce noise from style/migration rules now that prior false positives have been addressed, while keeping correctness/security/data-integrity analyzers strict.
Changes:
- Demotes a set of style/migration-focused analyzer severities (e.g., pattern-matching preference, Guard/TryParse helper migrations) from
warningtosuggestion. - Keeps stricter analyzers at their existing
warning/errorlevels. - Adds inline rationale comments explaining why each affected rule was demoted.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@src/Config/Analyzer.ANcpLua.Analyzers.editorconfig`:
- Around line 74-75: Update the per-rule metadata comment for each demoted rule
so the human-readable "Severity:" line matches the new setting; e.g., for the
block that sets "dotnet_diagnostic.AL0014.severity = suggestion" change the
metadata comment that currently reads "Severity: warning" to "Severity:
suggestion". Apply the same change to every other demoted rule block mentioned
(the blocks around lines referenced in the review such as those controlling
other dotnet_diagnostic.* keys listed in the comment) so the header metadata and
the actual severity values stay in sync.
🪄 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
Run ID: 0728c206-1bfb-43da-842c-07485efeffd9
📒 Files selected for processing (1)
src/Config/Analyzer.ANcpLua.Analyzers.editorconfig
📜 Review details
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Agent
- GitHub Check: create_nuget
- GitHub Check: lint_config
🧰 Additional context used
📓 Path-based instructions (2)
src/Config/**/*.editorconfig
📄 CodeRabbit inference engine (src/CLAUDE.md)
Configuration files in src/Config/ should use flat layout with specific naming conventions: Analyzer..editorconfig for per-analyzer rules, Global.editorconfig as authoritative, and per-variant ANcpLua.NET.Sdk..editorconfig files
Files:
src/Config/Analyzer.ANcpLua.Analyzers.editorconfig
src/Config/Analyzer.*.editorconfig
📄 CodeRabbit inference engine (AGENTS.md)
Analyzer configuration rules should be tuned per-analyzer using analyzer-specific editorconfig files in the Config directory
Files:
src/Config/Analyzer.ANcpLua.Analyzers.editorconfig
🧠 Learnings (1)
📚 Learning: 2026-05-12T11:36:39.749Z
Learnt from: ANcpLua
Repo: ANcpLua/ANcpLua.NET.Sdk PR: 143
File: src/Config/ANcpLua.NET.Sdk.BitNet.editorconfig:5-9
Timestamp: 2026-05-12T11:36:39.749Z
Learning: In this repository’s per-variant editorconfig overlays under `src/Config/`, keep variant settings mirrored between the web-based overlays (e.g., `ANcpLua.NET.Sdk.Web.editorconfig` and `ANcpLua.NET.Sdk.BitNet.editorconfig`). Specifically, for CA1002 (`CA1002` / `dotnet_diagnostic.CA1002.severity`), any policy change must be made first in the Web overlay and then mirrored to the BitNet overlay—do not apply CA1002 changes asymmetrically to only one variant.
Applied to files:
src/Config/Analyzer.ANcpLua.Analyzers.editorconfig
d0512ef to
3ea0f2a
Compare
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
|
@coderabbitai autofix |
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Fixes Applied SuccessfullyFixed 1 file(s) based on 1 unresolved review comment. Files modified:
Commit: The changes have been pushed to the Time taken: |
There was a problem hiding this comment.
♻️ Duplicate comments (1)
src/Config/Analyzer.ANcpLua.Analyzers.editorconfig (1)
73-75:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winUpdate per-rule metadata severity comments to match
suggestion.These demoted blocks still keep the metadata line as
Severity: warningwhile the actual diagnostic is nowsuggestion. Please sync the metadata comments to avoid policy drift and review/CI noise.Also applies to: 187-189, 193-195, 206-208, 233-234, 239-240, 245-246, 251-252, 257-258, 263-264, 269-270, 623-624, 713-714
🤖 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/Config/Analyzer.ANcpLua.Analyzers.editorconfig` around lines 73 - 75, The comment metadata for the AL0014 rule is out of sync: change the comment line "Severity: warning" to "Severity: suggestion" in the block containing dotnet_diagnostic.AL0014.severity = suggestion (and update the same metadata severity for the other demoted blocks you listed: lines/ranges 187-189, 193-195, 206-208, 233-234, 239-240, 245-246, 251-252, 257-258, 263-264, 269-270, 623-624, 713-714) so the human-readable "Severity:" comment matches the actual diagnostic setting.
🤖 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.
Duplicate comments:
In `@src/Config/Analyzer.ANcpLua.Analyzers.editorconfig`:
- Around line 73-75: The comment metadata for the AL0014 rule is out of sync:
change the comment line "Severity: warning" to "Severity: suggestion" in the
block containing dotnet_diagnostic.AL0014.severity = suggestion (and update the
same metadata severity for the other demoted blocks you listed: lines/ranges
187-189, 193-195, 206-208, 233-234, 239-240, 245-246, 251-252, 257-258, 263-264,
269-270, 623-624, 713-714) so the human-readable "Severity:" comment matches the
actual diagnostic setting.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 2474eaa6-0977-4c78-bf0f-e2b82265aaa6
📒 Files selected for processing (6)
src/ANcpLua.NET.Sdk.BitNet.nuspecsrc/ANcpLua.NET.Sdk.Test.nuspecsrc/ANcpLua.NET.Sdk.Web.nuspecsrc/ANcpLua.NET.Sdk.nuspecsrc/Config/Analyzer.ANcpLua.Analyzers.editorconfigsrc/Config/Analyzer.System.ClientModel.editorconfig
📜 Review details
🧰 Additional context used
📓 Path-based instructions (2)
**/*.nuspec
📄 CodeRabbit inference engine (AGENTS.md)
Enumerate file entries in .nuspec instead of using glob patterns to prevent zero-match issues on Windows pack agents
Files:
src/ANcpLua.NET.Sdk.BitNet.nuspecsrc/ANcpLua.NET.Sdk.Web.nuspecsrc/ANcpLua.NET.Sdk.nuspecsrc/ANcpLua.NET.Sdk.Test.nuspec
⚙️ CodeRabbit configuration file
**/*.nuspec: NuGet package manifest. Review for: correct package id, correct
dependency version ranges (no float-to-latest in stable releases),
proper file globs (no .pdb in release packages unless symbol package),
and that contentFiles paths match what's in src/.
Files:
src/ANcpLua.NET.Sdk.BitNet.nuspecsrc/ANcpLua.NET.Sdk.Web.nuspecsrc/ANcpLua.NET.Sdk.nuspecsrc/ANcpLua.NET.Sdk.Test.nuspec
src/Config/**/*.editorconfig
📄 CodeRabbit inference engine (src/CLAUDE.md)
Configuration files in src/Config/ should use flat layout with specific naming conventions: Analyzer..editorconfig for per-analyzer rules, Global.editorconfig as authoritative, and per-variant ANcpLua.NET.Sdk..editorconfig files
Files:
src/Config/Analyzer.System.ClientModel.editorconfigsrc/Config/Analyzer.ANcpLua.Analyzers.editorconfig
🧠 Learnings (1)
📚 Learning: 2026-05-12T11:36:39.749Z
Learnt from: ANcpLua
Repo: ANcpLua/ANcpLua.NET.Sdk PR: 143
File: src/Config/ANcpLua.NET.Sdk.BitNet.editorconfig:5-9
Timestamp: 2026-05-12T11:36:39.749Z
Learning: In this repository’s per-variant editorconfig overlays under `src/Config/`, keep variant settings mirrored between the web-based overlays (e.g., `ANcpLua.NET.Sdk.Web.editorconfig` and `ANcpLua.NET.Sdk.BitNet.editorconfig`). Specifically, for CA1002 (`CA1002` / `dotnet_diagnostic.CA1002.severity`), any policy change must be made first in the Web overlay and then mirrored to the BitNet overlay—do not apply CA1002 changes asymmetrically to only one variant.
Applied to files:
src/Config/Analyzer.System.ClientModel.editorconfigsrc/Config/Analyzer.ANcpLua.Analyzers.editorconfig
🪛 GitHub Actions: Claude Code Review / 0_claude-review.txt
src/Config/Analyzer.ANcpLua.Analyzers.editorconfig
[warning] 73-75: CodeRabbit flagged policy/documentation drift: per-rule metadata comments still say 'Severity: warning' while dotnet_diagnostic.AL0014.severity (and other demoted rules) were changed to 'suggestion'.
🔇 Additional comments (5)
src/Config/Analyzer.System.ClientModel.editorconfig (1)
1-35: LGTM!src/ANcpLua.NET.Sdk.Test.nuspec (1)
40-40: LGTM!src/ANcpLua.NET.Sdk.nuspec (1)
40-40: LGTM!src/ANcpLua.NET.Sdk.BitNet.nuspec (1)
40-40: LGTM!src/ANcpLua.NET.Sdk.Web.nuspec (1)
40-40: LGTM!
Fixed 1 file(s) based on 1 unresolved review comment. Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
12e4f33 to
b2e75b8
Compare
|
@coderabbitai autofix |
|
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. |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@src/Config/Analyzer.ANcpLua.Analyzers.editorconfig`:
- Around line 73-75: The metadata comment blocks for demoted rules are out of
sync with their actual settings; update each comment that reads "Enabled: True,
Severity: warning" to match the corresponding dotnet_diagnostic.*.severity value
(change "Severity: warning" to "Severity: suggestion") for the demoted rule
identifiers (e.g., AL0014 and the other dotnet_diagnostic entries present in the
file). Locate the comment blocks immediately preceding the
dotnet_diagnostic.<RULE>.severity lines (the comment pattern "# Enabled: True,
Severity: warning") and edit them so the severity text matches the configured
value (e.g., "Severity: suggestion") for every demoted rule block mentioned in
the review.
In `@src/Config/Analyzer.System.ClientModel.editorconfig`:
- Line 4: The editorconfig for System.ClientModel contains an outlier setting
"global_level = 2826" which breaks MSBuild/editorconfig precedence; change the
value to 16 (the next available analyzer slot) unless there is an intentional,
documented reason for an extreme override, and if intentional add a comment in
the file explaining why 2826 is required and provide a link to the justification
or ticket.
🪄 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
Run ID: 42ffdca6-a3d2-4725-bec5-3373c45b3831
📒 Files selected for processing (6)
src/ANcpLua.NET.Sdk.BitNet.nuspecsrc/ANcpLua.NET.Sdk.Test.nuspecsrc/ANcpLua.NET.Sdk.Web.nuspecsrc/ANcpLua.NET.Sdk.nuspecsrc/Config/Analyzer.ANcpLua.Analyzers.editorconfigsrc/Config/Analyzer.System.ClientModel.editorconfig
📜 Review details
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Agent
🧰 Additional context used
📓 Path-based instructions (2)
**/*.nuspec
📄 CodeRabbit inference engine (AGENTS.md)
Enumerate file entries in .nuspec instead of using glob patterns to prevent zero-match issues on Windows pack agents
Files:
src/ANcpLua.NET.Sdk.BitNet.nuspecsrc/ANcpLua.NET.Sdk.nuspecsrc/ANcpLua.NET.Sdk.Web.nuspecsrc/ANcpLua.NET.Sdk.Test.nuspec
⚙️ CodeRabbit configuration file
**/*.nuspec: NuGet package manifest. Review for: correct package id, correct
dependency version ranges (no float-to-latest in stable releases),
proper file globs (no .pdb in release packages unless symbol package),
and that contentFiles paths match what's in src/.
Files:
src/ANcpLua.NET.Sdk.BitNet.nuspecsrc/ANcpLua.NET.Sdk.nuspecsrc/ANcpLua.NET.Sdk.Web.nuspecsrc/ANcpLua.NET.Sdk.Test.nuspec
src/Config/**/*.editorconfig
📄 CodeRabbit inference engine (src/CLAUDE.md)
Configuration files in src/Config/ should use flat layout with specific naming conventions: Analyzer..editorconfig for per-analyzer rules, Global.editorconfig as authoritative, and per-variant ANcpLua.NET.Sdk..editorconfig files
Files:
src/Config/Analyzer.System.ClientModel.editorconfigsrc/Config/Analyzer.ANcpLua.Analyzers.editorconfig
🧠 Learnings (1)
📚 Learning: 2026-05-12T11:36:39.749Z
Learnt from: ANcpLua
Repo: ANcpLua/ANcpLua.NET.Sdk PR: 143
File: src/Config/ANcpLua.NET.Sdk.BitNet.editorconfig:5-9
Timestamp: 2026-05-12T11:36:39.749Z
Learning: In this repository’s per-variant editorconfig overlays under `src/Config/`, keep variant settings mirrored between the web-based overlays (e.g., `ANcpLua.NET.Sdk.Web.editorconfig` and `ANcpLua.NET.Sdk.BitNet.editorconfig`). Specifically, for CA1002 (`CA1002` / `dotnet_diagnostic.CA1002.severity`), any policy change must be made first in the Web overlay and then mirrored to the BitNet overlay—do not apply CA1002 changes asymmetrically to only one variant.
Applied to files:
src/Config/Analyzer.System.ClientModel.editorconfigsrc/Config/Analyzer.ANcpLua.Analyzers.editorconfig
🪛 GitHub Actions: Claude Code Review / 0_claude-review.txt
src/Config/Analyzer.ANcpLua.Analyzers.editorconfig
[warning] 73-75: CodeRabbit policy/documentation drift: per-rule metadata comment shows "Severity: warning" while dotnet_diagnostic.AL0014.severity (and other demoted rules in the listed blocks) were changed to "suggestion".
🔇 Additional comments (6)
src/Config/Analyzer.System.ClientModel.editorconfig (1)
6-34: LGTM!src/ANcpLua.NET.Sdk.nuspec (1)
40-40: LGTM!src/ANcpLua.NET.Sdk.BitNet.nuspec (1)
40-40: LGTM!src/ANcpLua.NET.Sdk.Web.nuspec (1)
40-40: LGTM!src/ANcpLua.NET.Sdk.Test.nuspec (1)
40-40: LGTM!src/Config/Analyzer.ANcpLua.Analyzers.editorconfig (1)
74-75: LGTM!Also applies to: 188-189, 194-195, 200-202, 207-208, 233-234, 239-240, 245-246, 251-252, 257-258, 263-264, 269-270, 367-371, 427-430, 496-499, 504-505, 510-511, 516-520, 524-526, 586-588, 623-624, 704-708, 713-714
| # Enabled: True, Severity: warning | ||
| dotnet_diagnostic.AL0014.severity = warning | ||
| # Demoted: idiomatic pattern-matching preference, not a correctness rule. | ||
| dotnet_diagnostic.AL0014.severity = suggestion |
There was a problem hiding this comment.
Metadata comments still show "Severity: warning" for demoted rules.
A previous review flagged this drift and was marked "Addressed in commit 3ea0f2a", but the metadata comments at lines 73, 188, 194, 207, 233, 239, 245, 251, 257, 263, 269, 623, and 713 still read Enabled: True, Severity: warning while the corresponding dotnet_diagnostic settings are suggestion. The pipeline failure confirms this inconsistency remains unfixed.
Update each metadata comment to match the actual severity.
Example fix pattern
-# Enabled: True, Severity: warning
+# Enabled: True, Severity: suggestion
# Demoted: idiomatic pattern-matching preference, not a correctness rule.
dotnet_diagnostic.AL0014.severity = suggestionApply to all demoted rule blocks.
Also applies to: 188-189, 194-195, 207-208, 233-234, 239-240, 245-246, 251-252, 257-258, 263-264, 269-270, 623-624, 713-714
🧰 Tools
🪛 GitHub Actions: Claude Code Review / 0_claude-review.txt
[warning] 73-75: CodeRabbit policy/documentation drift: per-rule metadata comment shows "Severity: warning" while dotnet_diagnostic.AL0014.severity (and other demoted rules in the listed blocks) were changed to "suggestion".
🤖 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/Config/Analyzer.ANcpLua.Analyzers.editorconfig` around lines 73 - 75, The
metadata comment blocks for demoted rules are out of sync with their actual
settings; update each comment that reads "Enabled: True, Severity: warning" to
match the corresponding dotnet_diagnostic.*.severity value (change "Severity:
warning" to "Severity: suggestion") for the demoted rule identifiers (e.g.,
AL0014 and the other dotnet_diagnostic entries present in the file). Locate the
comment blocks immediately preceding the dotnet_diagnostic.<RULE>.severity lines
(the comment pattern "# Enabled: True, Severity: warning") and edit them so the
severity text matches the configured value (e.g., "Severity: suggestion") for
every demoted rule block mentioned in the review.
| # global_level controls precedence across multiple global AnalyzerConfig files. | ||
| # Keep distinct values to avoid equal-level conflicts (which are ignored). | ||
| is_global = true | ||
| global_level = 2826 |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Check for global_level conflicts across all editorconfig files.
rg -n 'global_level\s*=' --type=editorconfig src/Config/Repository: ANcpLua/ANcpLua.NET.Sdk
Length of output: 104
🏁 Script executed:
#!/bin/bash
# Find all .editorconfig files and search for global_level assignments
fd -e editorconfig src/Config/ -exec grep -Hn 'global_level\s*=' {} \;Repository: ANcpLua/ANcpLua.NET.Sdk
Length of output: 298
🏁 Script executed:
#!/bin/bash
# Find all .editorconfig files in src/Config/ and search for global_level assignments
fd -e editorconfig src/Config/ | xargs grep -n 'global_level\s*='Repository: ANcpLua/ANcpLua.NET.Sdk
Length of output: 419
🏁 Script executed:
#!/bin/bash
# Find all .editorconfig files in src/Config/ and search for global_level assignments
fd . src/Config/ -e editorconfig | xargs grep -n 'global_level\s*='Repository: ANcpLua/ANcpLua.NET.Sdk
Length of output: 1058
System.ClientModel analyzer violates editorconfig precedence hierarchy — global_level = 2826 is structurally incorrect.
The value 2826 is unique (no duplicate), but it breaks MSBuild precedence semantics. All other values follow a narrow range (10–61): analyzer configs use 10–15, Global.editorconfig is 50 (authoritative), variants are 60–61. A single outlier at 2826× higher priority than the authoritative Global config is a red flag for misconfiguration. Verify intent: if System.ClientModel truly requires extreme priority override, document it; otherwise, use 16 (next available analyzer slot) to maintain structural consistency.
🤖 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/Config/Analyzer.System.ClientModel.editorconfig` at line 4, The
editorconfig for System.ClientModel contains an outlier setting "global_level =
2826" which breaks MSBuild/editorconfig precedence; change the value to 16 (the
next available analyzer slot) unless there is an intentional, documented reason
for an extreme override, and if intentional add a comment in the file explaining
why 2826 is required and provide a link to the justification or ticket.
Summary
Analyzer.System.ClientModel.editorconfigand enumerate it in all SDK nuspecs so config generation is reproducible and packaged.tools/ConfigFilesGeneratorwrites analyzer default severity metadata, while the explicitdotnet_diagnostic.*.severitylines carry SDK override policy.Demoted
AL0014: pattern-matching idiom preference.AL0036,AL0045-AL0051: Guard helper migration rules.AL0037: TryParse helper migration.AL0040: Roslyn.Utilities attribute extraction helper.AL0121: source-generator performance guidance.AL0138: explicit MidpointRounding guidance with behavior-preserving fix.Kept strict intentionally
AL0007-AL0009,AL0004,AL0027,AL0111,AL0118,AL0127.Validation
dotnet run --project tools/ConfigFilesGenerator/ConfigFilesGenerator.csproj(0 configuration files writtenafter final update)dotnet build ANcpLua.NET.Sdk.slnx -c Release --no-restore(0 Warning(s),0 Error(s))dotnet test --project tests/ANcpLua.Sdk.Tests/ANcpLua.Sdk.Tests.csproj -c Release --no-build(235passed,0failed)git diff --check HEAD~3..HEADSummary by CodeRabbit