Set up dotnet format and CI enforcement#83
Conversation
Add .editorconfig capturing the project's conventions and a Format workflow that runs `dotnet format --verify-no-changes` on PRs and pushes to main. The vendored Ycs port is excluded via generated_code. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Pass TestContext.Current.CancellationToken to ToBlockingEnumerable and File.ReadAllLinesAsync so tests cancel responsively (xUnit1051). - Use `is not SqliteConnection` pattern matching instead of `as` + null check in DataModelTestBase.ForkDatabase (IDE0019). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Normalize whitespace, strip UTF-8 BOMs, add final newlines, and sort using directives to satisfy the new .editorconfig / Format workflow. Formatting-only changes; no behavioral changes. Vendored src/Ycs is excluded from formatting. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Important Review skippedToo many files! This PR contains 88 files, which is 38 over the limit of 50. To get a review, narrow the scope: Upgrade to a paid plan to raise the limit. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (89)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Remove the redundant src/.editorconfig. Its two meaningful rules are migrated to the root config: - VSTHRD200 severity = none (don't require Async suffix on async methods) - Verify snapshot files (*.received/*.verified) excluded from reformatting The duplicate indent_size/charset rules are dropped (already set globally). Fixed the stray quotes on the Verify charset value (utf-8-bom). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
myieye
left a comment
There was a problem hiding this comment.
The space standardization brought a bunch of stuff closer to what I expect ❤️
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Summary
Sets up
dotnet format(built into the .NET SDK) with an.editorconfigcapturing the project's conventions, and a CI workflow that enforces formatting on PRs and pushes tomain.Changes
.editorconfig— 4-space indent, file-scoped namespaces, Allman braces,usingoutside namespace,charset = utf-8(no BOM). Line endings are intentionally left unmanaged (Windows CRLF working tree). The vendoredsrc/Ycsport (C# port of Yjs) is markedgenerated_code = trueso it's excluded from formatting/analysis..github/workflows/format.yaml— runsdotnet format --verify-no-changeson PRs and pushes tomain. Default severity, so warnings + analyzers are enforced without failing on soft suggestions.xUnit1051(×3): passTestContext.Current.CancellationTokentoToBlockingEnumerable/File.ReadAllLinesAsync.IDE0019: useis not SqliteConnectionpattern matching instead ofas+ null check.Verification
dotnet format --verify-no-changes→ clean (exit 0)dotnet test --configuration Release→ 235 passed, 0 failedNotes
global.json, so CI uses whateversetup-dotnet@v4installs (matching the existing workflows). Local dev here is on .NET 11 preview; different analyzer versions between local and CI could in theory produce slightly different results. Adding aglobal.jsonto pin the SDK would make this deterministic — not done here to stay consistent with the existing setup.🤖 Generated with Claude Code