Skip to content

Raise the Canonical .editorconfig's IDE Style Rules to Warning - #4386

Merged
ptr727 merged 13 commits into
developfrom
burndown/editorconfig-ide-severity
Nov 24, 2026
Merged

ptr727 merged 13 commits into
developfrom
burndown/editorconfig-ide-severity

Conversation

@ptr727

@ptr727 ptr727 commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

Summary

The canonical root .editorconfig set every C# code-style option with no severity. Each IDE rule those options configure therefore stayed at its default, mostly hidden. 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.

  • Every code-style rule the file's options configure now reports at warning. Each rule takes one dotnet_diagnostic.IDExxxx.severity = warning entry under [*.cs]. IDE0058, IDE0046, and IDE0079 are included.
  • Rule set: the option-to-rule map the .NET 10.0.404 SDK's code-style analyzers register. It was read by reflection from both the SDK's codestyle analyzers and the ones dotnet format ships. Formatting-only options map to no rule of their own and stay under IDE0055. IDE0070 is added beyond that map, since a probe showed dotnet_prefer_system_hash_code governs it. IDE0079 is added too, since the file sets its documented option, dotnet_remove_unnecessary_suppression_exclusions.
  • IDE0036 and IDE1006 take explicit warning entries too. Their options already set warning: the :warning suffix on csharp_preferred_modifier_order, and the three dotnet_naming_rule.*.severity values, which rise from suggestion to warning. An option suffix and a naming-rule severity are not honored under EnforceCodeStyleInBuild, so the explicit entries keep them at warning there as well.
  • IDE0055 stays none, and no CA severity changes. The blanket dotnet_analyzer_diagnostic.severity line dotnet-codestyle forbids is not used.
  • Some options configure a pair of rules, of which only one fires under the chosen value. Examples are IDE0007 and IDE0008 for var, IDE0160 and IDE0161 for namespaces, and IDE0210 and IDE0211 for top-level statements. Both rules of each pair get the entry. The *_experimental blank-line options all allow, so IDE2000 to IDE2006 report nothing today.
  • dotnet-codestyle now agrees with the new rules.
    • The guard-clause rule sends a guard that CA1510 to CA1513 match to the throw helper its rule names, such as ArgumentNullException.ThrowIfNull. A probe showed such a guard draws both IDE0046 and its CA rule. A netstandard project 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 conditional return.
    • The zero-warnings bullet says the IDE warnings fail the dotnet format style step, since they never run in the build. The bullet states that EnforceCodeStyleInBuild is 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.
    • A new paragraph after the suppression bullets says each code-style option in the root .editorconfig takes a warning entry for its rules, formatting options excepted. An option alone is the defect this change fixes.
    • The disposables pattern states a using declaration as required wherever IDE0063 matches.
    • The testing example discards its assertion result, _ = actual.Should().Be(expected);, as IDE0058 requires.
    • The conventions reference states each modern-C# and expression-bodied preference the gate now enforces as required wherever its named IDE rule matches.
    • The generated .github/skills/ and .claude-plugin/ trees are regenerated with scripts/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 AnalysisLevel latest-all, AnalysisMode All, and TreatWarningsAsErrors. The gate ran as configured, dotnet format style --verify-no-changes --severity=info --verbosity=detailed.

  • develop's file: the violating library reports IDE0054 only, and the skill's own test example passes.
  • This branch, before a fix: the library fails on IDE0003, IDE0008, IDE0022, IDE0025, IDE0032, IDE0046, IDE0054, IDE0058, and IDE0161. The test example as develop's skill wrote it fails on IDE0058.
  • This branch, after a fix: dotnet format style --severity=info fixes 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 build reports no IDE rule, since nothing sets EnforceCodeStyleInBuild. So the rules land at the format gate and in the IDE, and the build is unchanged.

Carried-content note

.editorconfig is 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 with dotnet format style --severity=info, run until it settles. IDE0058 (an unused value, such as a fluent assertion or a StringBuilder.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 introduced findings open after its edit budget. The second push fixes each one:

  • .agents/skills/dotnet-codestyle/SKILL.md guard-clause rule: ThrowIfNull is missing on netstandard. Fixed, the rule gives that target the throw-expression form.
  • .agents/skills/dotnet-codestyle/SKILL.md guard-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.
  • .editorconfig IDE0036/IDE1006 comment: fixed with explicit warning entries, and the comment is gone.
  • .agents/skills/dotnet-codestyle/SKILL.md disposables 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, where ThrowIfNull now 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 introduced findings open, and the third push fixes both. The IDE0079 removal condition now names the format step too. The zero-warnings bullet now states that EnforceCodeStyleInBuild is 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 the netstandard throw expression is owed only where IDE0016, IDE0046, or IDE0270 match.

Pre-existing findings, not filed

Closes on promotion: #1842

🤖 Generated with Claude Code

ptr727 and others added 6 commits November 23, 2026 16:47
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]>
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]>
Copilot AI lite review requested due to automatic review settings November 24, 2026 01:58
@ptr727 ptr727 added the comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses label Nov 24, 2026
@ptr727

ptr727 commented Nov 24, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head cb8e392dd1bd4586ebea227e9e7a751886ccaad1, the content this pull request carries at that commit against develop, and it recorded 4 findings.

@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 11d4a38 and e4410a0.

Files ignored due to path filters: 7

  • .claude-plugin/fleet-skills/.source-digests/dotnet-codestyle is excluded by !.claude-plugin/fleet-skills/**
  • .claude-plugin/fleet-skills/skills/dotnet-codestyle/SKILL.md is excluded by !.claude-plugin/fleet-skills/**
  • .claude-plugin/fleet-skills/skills/dotnet-codestyle/references/conventions.md is excluded by !.claude-plugin/fleet-skills/**
  • .claude-plugin/fleet-skills/skills/dotnet-codestyle/references/testing.md is excluded by !.claude-plugin/fleet-skills/**
  • .github/skills/dotnet-codestyle/SKILL.md is excluded by !.github/skills/**
  • .github/skills/dotnet-codestyle/references/conventions.md is excluded by !.github/skills/**
  • .github/skills/dotnet-codestyle/references/testing.md is excluded by !.github/skills/**
Files selected for processing: 4

  • .agents/skills/dotnet-codestyle/SKILL.md
  • .agents/skills/dotnet-codestyle/references/conventions.md
  • .agents/skills/dotnet-codestyle/references/testing.md
  • .editorconfig
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

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]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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 IDE0055 as 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

codecov Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.39%. Comparing base (b38e084) to head (e4410a0).
⚠️ Report is 316 commits behind head on develop.

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     
Flag Coverage Δ
python-3.13 79.39% <ø> (-2.22%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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]>
@ptr727

ptr727 commented Nov 24, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head d0f74dcb781126f5e56e72b1d94b0e9917816adc, the content this pull request carries at that commit against develop, and it recorded 2 findings.

@ptr727 ptr727 removed the comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses label Nov 24, 2026
ptr727 and others added 4 commits November 23, 2026 18:21
… 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]>
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]>
@ptr727

ptr727 commented Nov 24, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head e4410a0890a118e16ae93f37990773a894c9fa7e, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@ptr727

ptr727 commented Nov 24, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@ptr727

ptr727 commented Nov 24, 2026

Copy link
Copy Markdown
Owner Author

/review

@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ptr727
ptr727 merged commit 477c4d1 into develop Nov 24, 2026
14 checks passed
@ptr727
ptr727 deleted the burndown/editorconfig-ide-severity branch November 24, 2026 03:03
ptr727 added a commit that referenced this pull request Nov 24, 2026
…, 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)
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