Repository navigation
Raise the Canonical .editorconfig's IDE Style Rules to Warning - #4386
Conversation
Every C# code-style option the file sets left its IDE rule at the default hidden severity, which `dotnet format style --severity=info` never reports, so the clean-compile gate enforced almost none of them. Add a `dotnet_diagnostic.IDExxxx.severity = suggestion` entry for each rule the file's options configure, per the decision on #1842 (option 1). The rule set is the SDK's own option-to-rule map for these options, plus IDE0070 and IDE0079, whose options the file also sets. IDE0055 stays none. IDE0036 keeps the :warning its option carries, since a dotnet_diagnostic entry would override it. No CA severity changes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The maintainer chose the strictest defaults for #1842, so every code-style rule the file's options configure now reports at warning rather than suggestion. IDE0058, IDE0046 and IDE0079 stay in the set. The naming rules behind IDE1006 rise from suggestion to warning. IDE0036 already carries :warning, and a comment says why neither has an entry. dotnet-codestyle's guard-clause rule now names the IDE0046 case, and its test example discards the assertion result as IDE0058 requires. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A probe shows IDE0046 also rewrites an if/else that only returns, and a throw guard directly before a return, into one conditional return. The guard-clause rule now names that shape. The zero-warnings bullet now says the IDE code-style warnings fail the format step, since they never run in the build. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The gate now reports these rules at warning, so the conventions reference states each construct as required wherever its IDE rule matches rather than as a preference left to judgment. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A probe shows IDE0046 also matches a return followed by a throw, and that an if/throw null guard draws CA1510 at build. The guard-clause rule now sends a parameter null guard to ThrowIfNull and states the full shape. IDE0079 reports in neither the format step nor the build, so the zero-warnings bullet names it. The collection-expression bullet adds IDE0028. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
A recorded local strict-review pass covers head |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 18 minutes. View limit details
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. |
An option's :severity suffix and a naming rule's severity hold in the IDE and in dotnet format, but not under EnforceCodeStyleInBuild. Explicit warning entries for IDE0036 and IDE1006 match those values everywhere, so the comment explaining their absence goes. The guard-clause rule now gives a netstandard project, which lacks ThrowIfNull, the throw-expression form. It also routes a null-checked local to ?? throw per IDE0270, which a probe confirmed. The disposables pattern states IDE0063 as required. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Two active guidance issues remain: the prescribed ThrowIfNull usage may not compile for netstandard targets, and the documented guard-simplification rule omits diagnostics that can still fail the warning gate.
2 open issues
What changed in this PR
This PR makes the canonical .editorconfig enforce configured C# IDE style rules at warning severity and updates the .NET coding guidance and generated skill distributions to match.
Changes:
- Adds warning severities for configured IDE diagnostics while preserving
IDE0055as disabled and leaving CA severities unchanged. - Raises naming-rule severities and updates guard-clause, testing, and modern-C# guidance.
- Regenerates the GitHub and Claude skill distributions and updates the source digest.
| File | Description |
|---|---|
| .github/skills/dotnet-codestyle/SKILL.md | Generated GitHub skill copy of the updated .NET coding guidance. |
| .github/skills/dotnet-codestyle/references/testing.md | Generated GitHub testing guidance with the IDE0058-compliant assertion example. |
| .github/skills/dotnet-codestyle/references/conventions.md | Generated GitHub conventions guidance documenting enforced modern C# preferences. |
| .editorconfig | Raises configured IDE diagnostics and naming rules to warning severity while retaining the existing formatting and CA settings. |
| .claude-plugin/fleet-skills/skills/dotnet-codestyle/SKILL.md | Generated Claude skill copy of the updated .NET coding guidance. |
| .claude-plugin/fleet-skills/skills/dotnet-codestyle/references/testing.md | Generated Claude testing guidance with the IDE0058-compliant assertion example. |
| .claude-plugin/fleet-skills/skills/dotnet-codestyle/references/conventions.md | Generated Claude conventions guidance documenting enforced modern C# preferences. |
| .claude-plugin/fleet-skills/.source-digests/dotnet-codestyle | Records the source digest for the regenerated dotnet-codestyle skill distribution. |
| .agents/skills/dotnet-codestyle/SKILL.md | Updates the authored .NET coding guidance for the stricter style gate and guard-clause requirements. |
| .agents/skills/dotnet-codestyle/references/testing.md | Updates the testing guidance assertion example to comply with IDE0058. |
| .agents/skills/dotnet-codestyle/references/conventions.md | Documents the modern C# and expression-bodied preferences enforced by the updated style rules. |
Review effort: Lite
An option with no dotnet_diagnostic entry leaves its rule at the default severity, which is the defect this change fixes. dotnet-codestyle now says each new code-style option takes a warning entry, formatting options excepted. The IDE0079 sentence moves after the fix-or-suppress rule and says to remove a suppression the IDE flags. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #4386 +/- ##
===========================================
- Coverage 81.60% 79.39% -2.22%
===========================================
Files 26 46 +20
Lines 9070 16070 +7000
===========================================
+ Hits 7402 12758 +5356
- Misses 1668 3312 +1644
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
A parameter null guard followed by a return is also IDE0046's shape, and its code fix would trade the ThrowIfNull CA1510 asks for for a throw expression nothing then reports. The rule now says ThrowIfNull wins there. A suppression the IDE flags under IDE0079 may still be needed in another configuration or target framework, so removal waits on every CI build. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
A recorded local strict-review pass covers head |
… Bullet The build skips the IDE code-style rules only while EnforceCodeStyleInBuild is unset, so the bullet now states that setting. A suppression IDE0079 flags may cover an IDE rule the format step still checks, so its removal waits on that step as well as on every CI build. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A probe shows an argument or range guard draws a CA15xx throw-helper rule at build and IDE0046 at the format step, the same pairing a null guard has. The rule now sends every guard those rules match to its helper. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…Matches IDE0046 needs a return that carries a value, so a void method's guard is not its shape. On netstandard, the throw expression is owed only where IDE0016, IDE0046, or IDE0270 actually match, and any other guard stays an early throw. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
A recorded local strict-review pass covers head |
|
@coderabbitai review |
|
/review |
Action not completed
|
…, Shared Run Deadline, and Second-Shell Paste-Safe (#4388) Promotes the ten pull requests that landed on develop since the last promotion: backlog burndown round 5, plus #4374 and #4376. - #4374: Quote the last paste-safe placeholders and run the check in the local block (the #1615 remainder). - #4376: Declare host-secrets for HomeAutomation-Config in the registry. - #4378: GOVERNANCE.md "Verification Discipline" requires the whole test suite before every push. The Husky hook bullet says it passes the staged paths to the prose gate. The `pr-review-conduct` Merge Gate names the rate-limit `success` check trap, the only part of #1298 kept per the maintainer's 2026-11-23 answer. - #4379: `validate-task.yml` fails a promotion when main's first-parent chain since the previous promotion holds a single-parent commit, an accidental squash into main. The conflicted-promotion cut and the squash recovery are documented in `branching-and-release-model`, and `drive-pr` points at them. - #4380: `canonical_review.py record` binds each unit's pass to the reviewer's written report rather than a typed `--findings` count. - #4381: Every argument refusal in the `host-setup/linux` scripts exits 64 through `die_usage`, and an EXIT trap maps a stray 64 to 1. The contract is stated in CODESTYLE.md "Command-Line Arguments". - #4382: The prose gate's `paste-safe` rule reads the string handed to `su`/`runuser -c`, a POSIX shell's `-c`, and `ssh`. This edits `host-setup/agent-safety/README.md` (two example loops only), which the maintainer approved and merged on 2026-11-24. - #4384: `upstream-contribution-workflow` says what a refused lease push on the dirty branch means. `audit-a-repo` carries the convention-layout note on its `--checkout` path. - #4385: Every timed captured run in the review and install tooling goes through one shared `scripts/run_deadline.py`, so a captured timeout holds its deadline on Windows. - #4386: The canonical `.editorconfig` sets every IDE code-style rule to `warning`, per the maintainer's strictest-defaults answer, and the `dotnet-codestyle` skill now agrees with the rules it enforces. ## Owed by the maintainer before rollout - A fleet resync is owed, because carried text changed: GOVERNANCE.md, CODESTYLE.md, `.editorconfig`, the reusable `validate-task.yml`, and several skills. - Every carrying C# repository has to fix its code at its next `.editorconfig` resync (#4386). The rules likely to fire most are IDE0058, IDE0046, IDE0210, IDE0290 and IDE0047/IDE0048. - HomeAutomation-Config#1466 can adopt the exit-64 contract once this is released. - #4379 keeps the `048a442f` floor your decision named, but the walk always stops at a later promotion merge, so the floor is never reached. Whether to drop it is your call. Fixes #1615 Fixes #2280 Fixes #3820 Fixes #1298 Fixes #2510 Fixes #4373 Fixes #3804 Fixes #3605 Fixes #4375 Fixes #4345 Fixes #3854 Fixes #1842 🤖 Generated with [Claude Code](https://claude.com/claude-code)

Summary
The canonical root
.editorconfigset every C# code-style option with no severity. Each IDE rule those options configure therefore stayed at its default, mostlyhidden. The fleet clean-compile gate,dotnet format style --verify-no-changes --severity=info, never reports a hidden rule, so it enforced almost none of the file's own style choices.The maintainer's answer on #1842 is to use the strictest, most correct defaults, even where existing code has to be fixed. This change implements that.
warning. Each rule takes onedotnet_diagnostic.IDExxxx.severity = warningentry under[*.cs]. IDE0058, IDE0046, and IDE0079 are included.dotnet formatships. Formatting-only options map to no rule of their own and stay under IDE0055. IDE0070 is added beyond that map, since a probe showeddotnet_prefer_system_hash_codegoverns it. IDE0079 is added too, since the file sets its documented option,dotnet_remove_unnecessary_suppression_exclusions.warningentries too. Their options already setwarning: the:warningsuffix oncsharp_preferred_modifier_order, and the threedotnet_naming_rule.*.severityvalues, which rise fromsuggestiontowarning. An option suffix and a naming-rule severity are not honored underEnforceCodeStyleInBuild, so the explicit entries keep them atwarningthere as well.none, and no CA severity changes. The blanketdotnet_analyzer_diagnostic.severitylinedotnet-codestyleforbids is not used.var, IDE0160 and IDE0161 for namespaces, and IDE0210 and IDE0211 for top-level statements. Both rules of each pair get the entry. The*_experimentalblank-line options all allow, so IDE2000 to IDE2006 report nothing today.dotnet-codestylenow agrees with the new rules.ArgumentNullException.ThrowIfNull. A probe showed such a guard draws both IDE0046 and its CA rule. Anetstandardproject lacks those helpers, so it takes the throw expression where IDE0016, IDE0046, or IDE0270 match. A null-checked local takes?? throw, per IDE0270. The rule also names the shape IDE0046 rewrites into one conditionalreturn.dotnet format stylestep, since they never run in the build. The bullet states thatEnforceCodeStyleInBuildis left unset. IDE0079 is named as the exception, since a probe showed neither the format step nor the build reports it. The bullet says to remove a suppression the IDE flags under it only once the format step and every CI configuration and target framework pass without it..editorconfigtakes awarningentry for its rules, formatting options excepted. An option alone is the defect this change fixes.usingdeclaration as required wherever IDE0063 matches._ = actual.Should().Be(expected);, as IDE0058 requires..github/skills/and.claude-plugin/trees are regenerated withscripts/build_dist.py.Verification
A constructed .NET 10 probe in a temporary directory was used, never committed. It has a class library and an xUnit v3 test project with AwesomeAssertions. It set
AnalysisLevellatest-all,AnalysisModeAll, andTreatWarningsAsErrors. The gate ran as configured,dotnet format style --verify-no-changes --severity=info --verbosity=detailed.dotnet format style --severity=infofixes both projects, a second run settling the IDE0046-then-IDE0022 cascade. The gate then exits 0 on each, and the test reads_ = actual.Should().Be(expected);.dotnet buildreports no IDE rule, since nothing setsEnforceCodeStyleInBuild. So the rules land at the format gate and in the IDE, and the build is unchanged.Carried-content note
.editorconfigis carried whole to every fleet repository. Every carrying C# repository must fix its code at its next resync of this file. The reason is the maintainer's strictest-defaults answer, where enforcement wins over avoiding churn. Most findings clear withdotnet format style --severity=info, run until it settles. IDE0058 (an unused value, such as a fluent assertion or aStringBuilder.Append) and IDE0046 (a guard clause before the final return) are the likeliest to be numerous. So are IDE0210 (top-level statements), IDE0290 (primary constructors), and IDE0047/IDE0048 (clarifying parentheses). No other repository is touched here.Local-review findings
The pass before the opening push left four
introducedfindings open after its edit budget. The second push fixes each one:.agents/skills/dotnet-codestyle/SKILL.mdguard-clause rule:ThrowIfNullis missing onnetstandard. Fixed, the rule gives that target the throw-expression form..agents/skills/dotnet-codestyle/SKILL.mdguard-clause rule: IDE0270 also rewrites an early-throw guard. Fixed, the rule names it. A probe raised no IDE0016 on the parameter-assignment shape, so the rule does not name IDE0016..editorconfigIDE0036/IDE1006 comment: fixed with explicitwarningentries, and the comment is gone..agents/skills/dotnet-codestyle/SKILL.mddisposables pattern: fixed, IDE0063 is stated as required.A later pass raised two more, fixed in the same push: the IDE0079 sentence read as covered by the fix-or-suppress rule, and nothing stated that a new option needs its entry. It also raised a naming-rule ordering concern, which a probe disproved, since a private const and an
s_static field draw no IDE1006. A further pass raised two more, also fixed: IDE0046's fix also matches a parameter null guard, whereThrowIfNullnow wins. And removing a suppression IDE0079 flags now waits until every configuration and target framework CI builds still passes.The pass before the second push left two
introducedfindings open, and the third push fixes both. The IDE0079 removal condition now names the format step too. The zero-warnings bullet now states thatEnforceCodeStyleInBuildis left unset. A pass on the third push also widened the throw-helper exemption from CA1510 alone to CA1510 to CA1513, after a probe showed a range guard pairs CA1512 with IDE0046 the same way. Its closing pass raised two more, also fixed: the IDE0046 shape now needs a value-carrying return, and thenetstandardthrow expression is owed only where IDE0016, IDE0046, or IDE0270 match.Pre-existing findings, not filed
.agents/skills/dotnet-codestyle/references/conventions.md > Comments and documentation(pre-existing, false statement): the unit claims missing XML comments for public APIs are suppressed in.editorconfig, which carries no CS1591 entry. It is gathered on that unit's tracker, Pre-Existing Findings: .agents/skills/dotnet-codestyle/references/conventions.md > Comments and documentation #4387.Closes on promotion: #1842
🤖 Generated with Claude Code