Skip to content

fix(config): align IDE0220 settings with generator#140

Merged
2 commits merged into
mainfrom
fix/codestyle-ide0220-generator
May 11, 2026
Merged

fix(config): align IDE0220 settings with generator#140
2 commits merged into
mainfrom
fix/codestyle-ide0220-generator

Conversation

@ANcpLua
Copy link
Copy Markdown
Owner

@ANcpLua ANcpLua commented May 11, 2026

Aligns IDE0220 (Add explicit cast in foreach loop) config with the repo's ConfigFilesGenerator output.

  • Moves the style option to CodingStyle.editorconfig.
  • Keeps the diagnostic severity override in Global.editorconfig.
  • Removes the stale IDE0220 entry from Compiler.editorconfig.

Local verification:

  • dotnet run --project tools/ConfigFilesGenerator/ConfigFilesGenerator.csproj (now writes 0 files)
  • CI=true NUGET_DIRECTORY=artifacts PACKAGE_VERSION=999.9.9 dotnet test --project tests/ANcpLua.Sdk.Tests/ANcpLua.Sdk.Tests.csproj -- --filter-method ANcpLua.Sdk.Tests.Sdk100DirectoryBuildPropsTests.LocalEditorConfigOverridesSdkGlobalConfigInReleaseBuild

View in Codesmith
Need help on this PR? Tag @codesmith with what you need.

  • Let Codesmith autofix CI failures and bot reviews

Summary by CodeRabbit

  • Chores
    • Updated code style configuration and diagnostic rules to maintain consistent development standards across the codebase.

Copilot AI review requested due to automatic review settings May 11, 2026 17:52
@github-actions
Copy link
Copy Markdown

@coderabbitai autofix

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 11, 2026

📝 Walkthrough

Walkthrough

Three editorconfig files are modified to enforce explicit cast requirements in foreach loops. The Compiler.editorconfig removes the suppression of IDE0220 diagnostic (previously set to silent). Global.editorconfig adds IDE0220 severity as suggestion. CodingStyle.editorconfig adds dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed. These changes consolidate cast-handling rules across configuration layers and transition IDE0220 from suppressed to active suggestion status.


Caution

Pre-merge checks failed

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

  • Ignore

❌ Failed checks (1 error)

Check name Status Explanation Resolution
No Datetime.Now/Utcnow ❌ Error Found 4 instances of DateTime.Now in modified C# test files without inline comments explaining the exception. Check requires explicit reason commented inline for test fixtures. Add inline comments (e.g., // Test fixture: validating DateTime.Now is banned) to lines 50 (BannedApiTests.cs) and 227, 272, 288 (SdkTests.cs) explaining why DateTime.Now is used.
✅ Passed checks (7 passed)
Check name Status Explanation
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 .Result/.Wait() Blocking Async ✅ Passed Scanned 18 modified C# files across the PR. Found zero instances of .Result, .Wait(), or .GetAwaiter().GetResult() blocking async patterns. All files use proper async/await conventions.
No Null-Forgiving Operator Without Justification ✅ Passed No null-forgiving operators (!) found in any of the 18 modified C# files. Comprehensive scan across all changes confirmed zero instances of the null-forgiving operator pattern.
No Suppression Of Fixable Diagnostics ✅ Passed PR modifies only .editorconfig files; no C# source files are added or modified. The check applies only to C# files, making it not applicable here.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Title follows conventional commits format (fix prefix), stays well under 72 chars (50 chars), has no trailing period, and clearly describes the main change: aligning IDE0220 settings with the generator.

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 11, 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 11, 2026

Claude encountered an error —— View job


I'll analyze this and get back to you.

@ghost ghost enabled auto-merge (squash) May 11, 2026 17:53
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

Aligns the repository’s IDE0220 configuration layout with the ConfigFilesGenerator-produced structure by placing the style option in the coding-style config, keeping the diagnostic severity override in the global config, and removing the stale compiler config entry.

Changes:

  • Moved dotnet_style_prefer_foreach_explicit_cast_in_source into CodingStyle.editorconfig.
  • Added/kept the IDE0220 diagnostic severity override in Global.editorconfig.
  • Removed the outdated IDE0220 diagnostic entry from Compiler.editorconfig.

Reviewed changes

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

File Description
src/Config/Global.editorconfig Removes the IDE0220 style option and sets the IDE0220 diagnostic severity at the global level.
src/Config/Compiler.editorconfig Deletes the stale IDE0220 diagnostic configuration block.
src/Config/CodingStyle.editorconfig Adds the IDE0220-related style option alongside other dotnet_style_* settings.

@github-actions
Copy link
Copy Markdown

@coderabbitai autofix

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 11, 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 11, 2026

Claude encountered an error —— View job


I'll analyze this and get back to you.

@ghost ghost merged commit 3af18dd into main May 11, 2026
16 checks passed
@ghost ghost deleted the fix/codestyle-ide0220-generator branch May 11, 2026 18:19
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants