Skip to content

test(sdk): cover local editorconfig override behavior#138

Merged
5 commits merged into
mainfrom
automation/local-editorconfig-override-tests
May 10, 2026
Merged

test(sdk): cover local editorconfig override behavior#138
5 commits merged into
mainfrom
automation/local-editorconfig-override-tests

Conversation

@ANcpLua
Copy link
Copy Markdown
Owner

@ANcpLua ANcpLua commented May 10, 2026

Summary

  • cover that local .editorconfig does not enable IDE code-style diagnostics during Debug builds
  • cover that local .editorconfig can raise IDE0061 to an error during Release builds

Verification

  • dotnet test --project tests/ANcpLua.Sdk.Tests/ANcpLua.Sdk.Tests.csproj --no-restore -- --filter-method 'LocalEditorConfig'

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

  • Tests
    • Improved test coverage for .editorconfig behavior across build configurations.
    • Added tests verifying local config does not enable code-style diagnostics in Debug and can override SDK/global config in Release.
  • Chores
    • Added a testing assertion package to the test project to support the new tests.

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

@coderabbitai autofix

@ghost ghost enabled auto-merge (squash) May 10, 2026 11:33
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 10, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8b750a23-a39a-4c34-8695-4d5c64115d0d

📥 Commits

Reviewing files that changed from the base of the PR and between badce52 and 4c945d3.

📒 Files selected for processing (1)
  • tests/ANcpLua.Sdk.Tests/SdkTests.cs
📜 Recent review details
🧰 Additional context used
📓 Path-based instructions (1)
tests/**/*.cs

⚙️ CodeRabbit configuration file

tests/**/*.cs: xUnit + FluentAssertions. AAA pattern. NSubstitute for mocks.
Flag: blocking-async patterns (Task.Run(() => x.Result)), missing
async Task (sync-void), Thread.Sleep instead of await Task.Delay,
tests asserting on private state via reflection.

Files:

  • tests/ANcpLua.Sdk.Tests/SdkTests.cs
🔇 Additional comments (2)
tests/ANcpLua.Sdk.Tests/SdkTests.cs (2)

399-436: Debug-path test is correctly scoped and guideline-compliant.

The new LocalEditorConfigDoesNotEnableCodeStyleInDebugBuild case is solid: async xUnit shape, clear AAA flow, and FluentAssertions-based IDE0061 checks match the intended contract.


438-471: Release override test cleanly validates IDE0061 escalation.

LocalEditorConfigOverridesSdkGlobalConfigInReleaseBuild is focused and correctly proves the local .editorconfig can elevate IDE0061 to an error in Release.


📝 Walkthrough

Walkthrough

Reworked editorconfig-related tests in tests/ANcpLua.Sdk.Tests/SdkTests.cs: removed the single test asserting SDK global .editorconfig precedence and added two configuration-aware tests — one verifying a local .editorconfig does not enable IDE0061 in Debug builds, and one verifying a local .editorconfig can override the SDK global analyzer configuration to make IDE0061 an error in Release builds. Also added the AwesomeAssertions package to Directory.Packages.props and the test project.

🚥 Pre-merge checks | ✅ 7 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
No Suppression Of Fixable Diagnostics ⚠️ Warning Three [SuppressMessage] attributes added for CA2000 in test factory methods. None match acceptable suppressions in AGENTS.md allowlist. Remove suppressions or add inline comments matching AGENTS.md. If test factory resource-lifetime suppressions are valid, update AGENTS.md allowlist.
✅ Passed checks (7 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Title follows conventional commits format (test prefix), is under 72 chars (53 chars), contains no trailing period, and accurately describes the primary change—new tests for local editorconfig override behavior.
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 Both new test methods (LocalEditorConfigDoesNotEnableCodeStyleInDebugBuild, LocalEditorConfigOverridesSdkGlobalConfigInReleaseBuild) contain no DateTime.Now/UtcNow usage.
No .Result/.Wait() Blocking Async ✅ Passed No blocking async patterns (.Result, .Wait(), .GetAwaiter().GetResult()) found in added/modified C# files. All new test methods properly use async/await.
No Null-Forgiving Operator Without Justification ✅ Passed No null-forgiving operators found in added/modified C# files. All 18 C# files scanned with multiple regex patterns—no ! operator violations detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

@coderabbitai
Copy link
Copy Markdown
Contributor

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

Claude encountered an error —— View job


I'll analyze this and get back to you.

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 `@tests/ANcpLua.Sdk.Tests/SdkTests.cs`:
- Around line 434-435: The current assertions Assert.False(result.HasWarning())
and Assert.False(result.HasError()) are too broad; change them so the test
asserts there are no errors (keep Assert.False(result.HasError())) and that any
warnings present are only IDE0061 by filtering diagnostics for warnings where
diagnostic.Id != "IDE0061" and asserting that filtered collection is empty (use
result.Diagnostics or the available warnings collection and the
result.HasWarning()/HasError() helpers as needed). This narrows the check to
IDE0061-only style emissions while keeping the rest of the test contract stable.
- Around line 434-435: Replace the xUnit Assert.True/Assert.False boolean
assertions with FluentAssertions style on the boolean-returning methods; for
example change Assert.False(result.HasWarning()) and
Assert.False(result.HasError()) to result.HasWarning().Should().BeFalse() and
result.HasError().Should().BeFalse() respectively, and similarly convert the
assertion at the other reported spot (line ~470) to use
.Should().BeTrue()/BeFalse() as appropriate; search for Assert.True/Assert.False
in SdkTests.cs and update those boolean checks to FluentAssertions using the
.Should() extension on the boolean-returning calls (e.g., HasWarning(),
HasError(), or the specific method used at the other assertion).
🪄 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: ef204024-13fd-4e3f-8da2-fec0e61e8bb5

📥 Commits

Reviewing files that changed from the base of the PR and between 077658a and c5a5de6.

📒 Files selected for processing (1)
  • tests/ANcpLua.Sdk.Tests/SdkTests.cs
📜 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). (6)
  • GitHub Check: create_nuget
  • GitHub Check: Agent
  • GitHub Check: lint_config
  • GitHub Check: test (macos-latest)
  • GitHub Check: test (ubuntu-latest)
  • GitHub Check: test (windows-latest)
🧰 Additional context used
📓 Path-based instructions (1)
tests/**/*.cs

⚙️ CodeRabbit configuration file

tests/**/*.cs: xUnit + FluentAssertions. AAA pattern. NSubstitute for mocks.
Flag: blocking-async patterns (Task.Run(() => x.Result)), missing
async Task (sync-void), Thread.Sleep instead of await Task.Delay,
tests asserting on private state via reflection.

Files:

  • tests/ANcpLua.Sdk.Tests/SdkTests.cs

Comment thread tests/ANcpLua.Sdk.Tests/SdkTests.cs Outdated
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

Adds regression coverage around how a consumer project’s local .editorconfig interacts with the SDK’s global analyzer configuration, specifically distinguishing Debug vs Release build behavior.

Changes:

  • Replaces/renames the prior precedence-focused test with a Debug-specific test asserting IDE code-style diagnostics aren’t produced when EnforceCodeStyleInBuild is off.
  • Adds a Release build test asserting a local .editorconfig can elevate IDE0061 to an error.

@github-actions
Copy link
Copy Markdown

@coderabbitai autofix

@claude
Copy link
Copy Markdown

claude Bot commented May 10, 2026

Claude encountered an error —— View job


I'll analyze this and get back to you.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 10, 2026

Note

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

⚠️ Branch updated during autofix.

The branch was updated while autofix was in progress. Please try again.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: badce52009

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/ANcpLua.Sdk.Tests/SdkTests.cs Outdated
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 `@tests/ANcpLua.Sdk.Tests/SdkTests.cs`:
- Around line 435-441: Remove the filter that excludes "IDE0061" from
unexpectedWarnings and instead add an explicit assertion in Debug builds that no
warning with RuleId == "IDE0061" was produced: stop filtering inside the LINQ on
result.GetWarnings(), and add a Debug-only check (e.g. wrap with `#if` DEBUG) that
verifies !result.GetWarnings().Any(d => d.RuleId == "IDE0061") while keeping the
existing unexpectedWarnings.Should().BeEmpty() and
result.HasError().Should().BeFalse() assertions intact; refer to GetWarnings(),
unexpectedWarnings, and result.HasError() to locate where to change the code.
🪄 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: af42771a-7bbb-4d85-9fe9-8eea813737f4

📥 Commits

Reviewing files that changed from the base of the PR and between c5a5de6 and badce52.

📒 Files selected for processing (3)
  • Directory.Packages.props
  • tests/ANcpLua.Sdk.Tests/ANcpLua.Sdk.Tests.csproj
  • tests/ANcpLua.Sdk.Tests/SdkTests.cs
📜 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: test (macos-latest)
  • GitHub Check: test (ubuntu-latest)
  • GitHub Check: test (windows-latest)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.props

⚙️ CodeRabbit configuration file

**/*.props: MSBuild property files. Review for: condition guards on every override
(consumer must be able to opt out), no <RemoveAttributes> on items
that consumers may have set, and that defaults are sensible without
forcing a downstream cascade.

Files:

  • Directory.Packages.props
tests/**/*.cs

⚙️ CodeRabbit configuration file

tests/**/*.cs: xUnit + FluentAssertions. AAA pattern. NSubstitute for mocks.
Flag: blocking-async patterns (Task.Run(() => x.Result)), missing
async Task (sync-void), Thread.Sleep instead of await Task.Delay,
tests asserting on private state via reflection.

Files:

  • tests/ANcpLua.Sdk.Tests/SdkTests.cs
🪛 GitHub Actions: Claude Code Review / 0_claude-review.txt
tests/ANcpLua.Sdk.Tests/SdkTests.cs

[warning] 1-1: CodeRabbit check "No Suppression Of Fixable Diagnostics" reported: One SuppressMessage(CA2000) added without inline comment matching acceptable-suppressions allowlist (MEAI001/OPENAI002/preview/source-gen/DevUI/upstream/AOT/netstandard2.0).

Comment thread tests/ANcpLua.Sdk.Tests/SdkTests.cs Outdated
Copilot AI review requested due to automatic review settings May 10, 2026 14:36
@github-actions
Copy link
Copy Markdown

@coderabbitai autofix

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 10, 2026

Note

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

⚠️ Branch updated during autofix.

The branch was updated while autofix was in progress. Please try again.

@github-actions
Copy link
Copy Markdown

@coderabbitai autofix

@claude
Copy link
Copy Markdown

claude Bot commented May 10, 2026

Claude encountered an error —— View job


I'll analyze this and get back to you.

@coderabbitai
Copy link
Copy Markdown
Contributor

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

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

Comment thread tests/ANcpLua.Sdk.Tests/SdkTests.cs Outdated
@github-actions
Copy link
Copy Markdown

@coderabbitai autofix

@coderabbitai
Copy link
Copy Markdown
Contributor

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

Claude encountered an error —— View job


I'll analyze this and get back to you.

@ghost ghost merged commit f35ca55 into main May 10, 2026
21 checks passed
@ghost ghost deleted the automation/local-editorconfig-override-tests branch May 10, 2026 17:45
This pull request was closed.
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