Skip to content

Tune ANcpLua analyzer severity overrides#153

Merged
github-actions[bot] merged 3 commits into
mainfrom
dev/tune-analyzer-severities
May 13, 2026
Merged

Tune ANcpLua analyzer severity overrides#153
github-actions[bot] merged 3 commits into
mainfrom
dev/tune-analyzer-severities

Conversation

@ANcpLua
Copy link
Copy Markdown
Owner

@ANcpLua ANcpLua commented May 13, 2026

Summary

  • Demote style/helper analyzer overrides from warning to suggestion after the ANcpLua.Analyzers false-positive fixes landed.
  • Keep correctness, security, package-policy, and data-integrity rules at their existing warning/error levels.
  • Add inline rationale comments for each demotion.
  • Include the generated Analyzer.System.ClientModel.editorconfig and enumerate it in all SDK nuspecs so config generation is reproducible and packaged.
  • Keep generated analyzer metadata comments stable: tools/ConfigFilesGenerator writes analyzer default severity metadata, while the explicit dotnet_diagnostic.*.severity lines 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 written after 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 (235 passed, 0 failed)
  • git diff --check HEAD~3..HEAD

Summary by CodeRabbit

  • Chores
    • Demoted many analyzer diagnostics from warning to suggestion to reduce noise and surface advisory/style guidance.
    • Included an additional analyzer configuration file in packaged builds so analyzer settings travel with releases.
  • Configuration
    • Added a global analyzer configuration that enables several diagnostics, marking two as errors and others as warnings.

Copilot AI review requested due to automatic review settings May 13, 2026 03:47
@github-actions
Copy link
Copy Markdown

@coderabbitai autofix

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 13, 2026

📝 Walkthrough

Walkthrough

Updated analyzer configs: src/Config/Analyzer.ANcpLua.Analyzers.editorconfig lowers severities for multiple diagnostics (AL0014, AL0025, AL0036, AL0037, AL0039, AL0040, AL0045–AL0051, AL0070, AL0081, AL0094–AL0102, AL0114, AL0121, AL0137, AL0138) from warning to suggestion with added explanatory comments. Added src/Config/Analyzer.System.ClientModel.editorconfig (global) setting SCM0001–SCM0006 severities (SCM0001–SCM0002 = error; SCM0003–SCM0006 = warning). NuGet manifest files (src/ANcpLua.NET.Sdk*.nuspec) now include Config/Analyzer.System.ClientModel.editorconfig. No code or public API declarations were changed.


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Title check ❌ Error Title lacks required conventional commit prefix (feat|fix|refactor|chore|docs|test|ci|perf|deps); uses natural language instead of 'fix:' or 'chore:' format. Reformat title to match conventional commits: either 'fix(analyzer): tune severity overrides' or 'chore(config): tune analyzer severity overrides'.
✅ Passed checks (7 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
No Datetime.Now/Utcnow ✅ Passed No C# files (.cs) are added or modified in this PR. The custom check explicitly targets C# files for DateTime.Now/UtcNow usage. With no C# files present, the check is not applicable.
No .Result/.Wait() Blocking Async ✅ Passed PR modifies only .editorconfig and .nuspec (manifest) files. No C# source files added/modified. Blocking async check does not apply.
No Null-Forgiving Operator Without Justification ✅ Passed No C# files modified in this PR. All changes are to .editorconfig and .nuspec configuration/manifest files. Custom check for null-forgiving operators in C# code is not applicable.
No Suppression Of Fixable Diagnostics ✅ Passed No C# files were added or modified in this PR. All changes are configuration-only: 4 .nuspec manifest updates and 2 .editorconfig analyzer config files. Zero suppression pragmas detected.

Comment @coderabbitai help to get the list of available commands and usage tips.

@claude
Copy link
Copy Markdown

claude Bot commented May 13, 2026

Claude encountered an error —— View job


I'll analyze this and get back to you.

@github-actions github-actions Bot enabled auto-merge (squash) May 13, 2026 03:47
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 13, 2026

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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 warning to suggestion.
  • Keeps stricter analyzers at their existing warning/error levels.
  • Adds inline rationale comments explaining why each affected rule was demoted.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between d2e30ee and d0512ef.

📒 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

Comment thread src/Config/Analyzer.ANcpLua.Analyzers.editorconfig
@ANcpLua ANcpLua force-pushed the dev/tune-analyzer-severities branch from d0512ef to 3ea0f2a Compare May 13, 2026 03:53
@claude
Copy link
Copy Markdown

claude Bot commented May 13, 2026

Claude encountered an error —— View job


I'll analyze this and get back to you.

@github-actions
Copy link
Copy Markdown

@coderabbitai autofix

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 13, 2026

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Fixes Applied Successfully

Fixed 1 file(s) based on 1 unresolved review comment.

Files modified:

  • src/Config/Analyzer.ANcpLua.Analyzers.editorconfig

Commit: 12e4f33b7498981362c86ca6354750f6e7f0c0a8

The changes have been pushed to the dev/tune-analyzer-severities branch.

Time taken: 3m 50s

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
src/Config/Analyzer.ANcpLua.Analyzers.editorconfig (1)

73-75: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update per-rule metadata severity comments to match suggestion.

These demoted blocks still keep the metadata line as Severity: warning while the actual diagnostic is now suggestion. 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

📥 Commits

Reviewing files that changed from the base of the PR and between d0512ef and 3ea0f2a.

📒 Files selected for processing (6)
  • src/ANcpLua.NET.Sdk.BitNet.nuspec
  • src/ANcpLua.NET.Sdk.Test.nuspec
  • src/ANcpLua.NET.Sdk.Web.nuspec
  • src/ANcpLua.NET.Sdk.nuspec
  • src/Config/Analyzer.ANcpLua.Analyzers.editorconfig
  • src/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.nuspec
  • src/ANcpLua.NET.Sdk.Web.nuspec
  • src/ANcpLua.NET.Sdk.nuspec
  • src/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.nuspec
  • src/ANcpLua.NET.Sdk.Web.nuspec
  • src/ANcpLua.NET.Sdk.nuspec
  • src/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.editorconfig
  • 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.System.ClientModel.editorconfig
  • src/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!

Copilot AI review requested due to automatic review settings May 13, 2026 03:58
@ANcpLua ANcpLua review requested due to automatic review settings May 13, 2026 03:58
coderabbitai Bot and others added 2 commits May 13, 2026 06:00
Fixed 1 file(s) based on 1 unresolved review comment.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
Copilot AI review requested due to automatic review settings May 13, 2026 04:05
@ANcpLua ANcpLua force-pushed the dev/tune-analyzer-severities branch from 12e4f33 to b2e75b8 Compare May 13, 2026 04:05
@github-actions
Copy link
Copy Markdown

@coderabbitai autofix

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 13, 2026

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
Copy link
Copy Markdown

claude Bot commented May 13, 2026

Claude encountered an error —— View job


I'll analyze this and get back to you.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 12e4f33 and b2e75b8.

📒 Files selected for processing (6)
  • src/ANcpLua.NET.Sdk.BitNet.nuspec
  • src/ANcpLua.NET.Sdk.Test.nuspec
  • src/ANcpLua.NET.Sdk.Web.nuspec
  • src/ANcpLua.NET.Sdk.nuspec
  • src/Config/Analyzer.ANcpLua.Analyzers.editorconfig
  • src/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.nuspec
  • src/ANcpLua.NET.Sdk.nuspec
  • src/ANcpLua.NET.Sdk.Web.nuspec
  • src/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.nuspec
  • src/ANcpLua.NET.Sdk.nuspec
  • src/ANcpLua.NET.Sdk.Web.nuspec
  • src/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.editorconfig
  • 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.System.ClientModel.editorconfig
  • src/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

Comment on lines 73 to +75
# Enabled: True, Severity: warning
dotnet_diagnostic.AL0014.severity = warning
# Demoted: idiomatic pattern-matching preference, not a correctness rule.
dotnet_diagnostic.AL0014.severity = suggestion
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

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 = suggestion

Apply 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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 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.

@github-actions github-actions Bot merged commit cd53e41 into main May 13, 2026
17 checks passed
@ANcpLua ANcpLua deleted the dev/tune-analyzer-severities branch May 16, 2026 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants