Skip to content

style: enforce IDE0055 for CI builds#139

Merged
1 commit merged into
mainfrom
fix/refix-codestyle-policy-pass-2026-05-11
May 11, 2026
Merged

style: enforce IDE0055 for CI builds#139
1 commit merged into
mainfrom
fix/refix-codestyle-policy-pass-2026-05-11

Conversation

@ANcpLua
Copy link
Copy Markdown
Owner

@ANcpLua ANcpLua commented May 11, 2026

Enforces C# formatting diagnostics (IDE0055) during CI/Release builds for this repo via a repo-local .editorconfig override, matching modern .NET practice of treating formatting as at least warning-level.

Also fixes a few formatting-only sites in tests that become actionable once IDE0055 is enforced.

Local verification:

  • CI=true dotnet build -c Release
  • dotnet test --project tests/ANcpLua.Sdk.Tests/ANcpLua.Sdk.Tests.csproj -c Release --filter-method "*EditorConfigsAreInBinlog*"

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

  • Style
    • Improved test code formatting and readability through refactored code blocks.

Copilot AI review requested due to automatic review settings May 11, 2026 17:49
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 11, 2026

📝 Walkthrough

Walkthrough

Two test files undergo formatting-only changes. SdkTests.cs reformats a foreach loop that writes binlog file paths to test output. TemplatesTests.cs refactors four conditional and loop constructs from single-line to explicit multi-line block form: an if statement checking extraArgs, a foreach argument append loop, a symlink path fast-return branch, and a path rebuild loop. No functional behavior, control flow, method signatures, or assertions are altered. No public API surface changes.


Caution

Pre-merge checks failed

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

  • Ignore

❌ Failed checks (1 error, 1 warning)

Check name Status Explanation Resolution
No Datetime.Now/Utcnow ❌ Error Found 4 instances of DateTime.Now in test fixtures (BannedApiTests.cs:1, SdkTests.cs:3) used as analyzer test inputs. No explicit inline comments present to justify the exception. Add inline comments like '// Test fixture: intentionally uses banned API to verify RS0030 detection' before each DateTime.Now usage in test strings.
No Suppression Of Fixable Diagnostics ⚠️ Warning PR adds [SuppressMessage] in SdkTests.cs without inline comment matching acceptable-suppressions allowlist. CA2000 suppression lacks required documentation. Either remove [SuppressMessage] or add inline comment documenting the CA2000 suppression with allowlist reference.
✅ Passed checks (6 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 Modified test files contain no blocking async patterns (.Result, .Wait(), .GetAwaiter().GetResult()). Proper async/await usage throughout.
No Null-Forgiving Operator Without Justification ✅ Passed No null-forgiving operators detected in added/modified C# files. All '!' occurrences are legitimate negation (prefix) or comparison (!=) operators. Commit is formatting-only.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Title follows Conventional Commits format (style prefix), is under 72 chars (36), has no trailing period, and accurately describes the main change: enforcing IDE0055 formatting diagnostics during CI builds.

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

@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 enabled auto-merge (squash) May 11, 2026 17:50
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 enables build-time enforcement of C# formatting diagnostics (IDE0055) by raising its severity to warning in the repo’s root .editorconfig, aligning with the repo’s existing CI/Release setting of EnforceCodeStyleInBuild=true. It also applies formatting-only updates in test code so the stricter formatting rule is satisfied.

Changes:

  • Set dotnet_diagnostic.IDE0055.severity = warning in the repo’s root .editorconfig for C# files.
  • Reformat several single-line statements into block form in test helpers to comply with enforced formatting.
  • Minor formatting change in the binlog-related test output loop.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
.editorconfig Raises IDE0055 severity to enable build-time formatting diagnostics under EnforceCodeStyleInBuild.
tests/ANcpLua.Sdk.Tests/TemplatesTests.cs Formatting-only updates in template scaffolding/build helpers.
tests/ANcpLua.Sdk.Tests/SdkTests.cs Formatting-only update to the binlog output loop.

Comment thread .editorconfig
Comment on lines +47 to +49
# Repo-local CI strictness: set IDE0055 to warning so it can be enforced by
# `EnforceCodeStyleInBuild` (Microsoft Learn: IDE0055 must be warning/error to
# run during build).
@ghost ghost merged commit 612af9b into main May 11, 2026
20 checks passed
@ghost ghost deleted the fix/refix-codestyle-policy-pass-2026-05-11 branch May 11, 2026 18:03
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