You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Canonical .editorconfig Leaves IDE Style Rules at Hidden, So the Style Gate Checks Almost Nothing #1842
The canonical root .editorconfig sets every C# code-style option with no :severity suffix and no dotnet_diagnostic.IDExxxx.severity entry, for example csharp_style_var_* = false, csharp_style_namespace_declarations = file_scoped, and the csharp_style_expression_bodied_* options. With nothing raising them, Roslyn reports these IDE rules at their default hidden severity. The fleet clean-compile gate, dotnet format style --verify-no-changes --severity=info, run by the .NET Format task, the Husky hook, and CI, only reports info and above, so it never sees them.
Reproduction
Take a .NET 10 project under the hub's .editorconfig (hub main92737d1), with AnalysisLevellatest-all. Add a probe file that uses var, a block-scoped namespace, a block-bodied single-expression method, an unused using, and a this. qualifier, then run dotnet format style --verify-no-changes --severity=info.
Hub canonical: reports only IDE0130 and IDE0036, and IDE0036 only because csharp_preferred_modifier_order carries an explicit :warning.
Same file with dotnet_analyzer_diagnostic.severity = suggestion added under [*.cs]: also reports IDE0003, IDE0005, IDE0008, IDE0022, and IDE0161.
Why it matters
The dotnet-codestyle rules the options encode (no var, file-scoped namespaces, expression bodies) go unenforced wherever the canonical file is carried, and a repo converging onto it silently loses enforcement it had. This surfaced in the MediaTools resync (ptr727/MediaTools#27), whose previous .editorconfig carried the global suggestion line. dotnet-codestyle forbids that line as a blanket relaxation, since it also lowers CA rules from warning to suggestion, so a carrier has no conformant way to restore enforcement locally.
Expected
The canonical file should make the rules it configures visible to the gate, for example with a :suggestion (or stronger) suffix on each style option, or dotnet_diagnostic.IDExxxx.severity entries, without the CA-lowering global line.
Question: Should the canonical root .editorconfig raise the IDE code-style rules it configures (no var, file-scoped namespace, expression bodies, and so on) from hidden so the dotnet format style --severity=info gate sees them, accepting that carrying repos start failing it, or stay as it is?
Options, recommended first:
A dotnet_diagnostic.IDExxxx.severity = suggestion per rule (recommended): Raises only the rules the file's options configure, so the gate enforces what the file already says, in the per-rule form dotnet-codestyle prescribes. IDE0055 stays none (CSharpier owns formatting), CA severities untouched. Each csharp repo gets failures at its next .editorconfig resync, mostly fixable with dotnet format style. No work in flight.
A :suggestion suffix on each style option: Same coverage, one key per option, but a second severity form beside the documented dotnet_diagnostic one. No work in flight.
Set dotnet_analyzer_diagnostic.category-Style.severity: One line, but switches on every IDE rule the file never configures at defaults nobody chose, close to the blanket line the skill warns against. No work in flight.
Leave the file as it is: No repo fails, but the file's own rules stay unenforced and a resync keeps removing enforcement a repo had (ptr727/MediaTools#27). No work in flight.
Evidence:.editorconfig[*.cs] from :47: only dotnet_diagnostic.IDE0055.severity = none (:51) and csharp_preferred_modifier_order ...:warning (:71) carry a severity; csharp_style_namespace_declarations (:113) and csharp_style_var_* (:136-138) carry none. dotnet-codestyle SKILL.md:145-150 names dotnet_diagnostic.<RULE>.severity and forbids relaxing with dotnet_analyzer_diagnostic.severity. Nothing sets EnforceCodeStyleInBuild, so a suggestion reaches the format gate, not the build. spec/files.json:22 carries .editorconfig whole to every repo, and 7 registry repos are typed csharp.
Maintainer answer (decision triage, 2026-11-01): Option 1: add a dotnet_diagnostic.IDExxxx.severity = suggestion entry for each code-style rule the canonical .editorconfig configures. IDE0055 stays none, and CA severities are untouched. Carrying C# repos fix the new findings at their next resync. This is now work for the next burndown round.
Predicted files: .editorconfig, .agents/skills/dotnet-codestyle/SKILL.md, .agents/skills/dotnet-codestyle/references/testing.md, .agents/skills/dotnet-codestyle/references/conventions.md (the last three added 2026-11-24 per the maintainer's answer), and their build_dist outputs.
Question for the maintainer (backlog burndown round 5, 2026-11-24). The group working this issue stopped before its first push. Branch burndown/editorconfig-ide-severity holds one local commit, which adds 91 dotnet_diagnostic.IDExxxx.severity = suggestion entries taken from the .NET 10.0.404 SDK's own option-to-rule map. A constructed probe shows the gate now reports IDE0003, IDE0008, IDE0022, IDE0025, IDE0032 and IDE0161, which it previously missed.
Two rules the decision covers conflict with the dotnet-codestyle skill:
IDE0058 (an ignored return value) fails builder.Append(part); and the skill's own test example actual.Should().Be(expected);. Its fix rewrites every such call to _ = ... across the C# repos that carry the file.
IDE0046 turns a guard clause just before the final return into a ternary. That contradicts the skill's "Guard clauses: prefer early returns".
A third rule, IDE0079 (unnecessary suppression), does nothing at the gate, and in the IDE it may offer to remove third-party suppressions.
Options, recommended first:
Leave out IDE0058, IDE0046 and IDE0079, and ship the rest (recommended). The PR body names each and says why. Their fixes would rewrite fleet code against rules the skill already sets.
Leave out IDE0058 and IDE0046, and keep IDE0079.
Keep all three, as the decision literally says. The skill's test example and guard-clause rule then change too, in a separate change.
Maintainer's answer, 2026-11-24: use the strictest, most correct defaults, even where existing code has to be fixed. Keep every rule, IDE0058, IDE0046 and IDE0079 included, at warning severity rather than suggestion. Update the dotnet-codestyle skill to match: the guard-clause rule, and the _ = form in its test example. Carrying C# repositories fix their code at resync.
Activity
ptr727 commentedon Nov 1, 2026
Decision needed (decision triage, 2026-11-01)
Question: Should the canonical root
.editorconfigraise the IDE code-style rules it configures (novar, file-scoped namespace, expression bodies, and so on) fromhiddenso thedotnet format style --severity=infogate sees them, accepting that carrying repos start failing it, or stay as it is?Options, recommended first:
dotnet_diagnostic.IDExxxx.severity = suggestionper rule (recommended): Raises only the rules the file's options configure, so the gate enforces what the file already says, in the per-rule form dotnet-codestyle prescribes. IDE0055 staysnone(CSharpier owns formatting), CA severities untouched. Each csharp repo gets failures at its next .editorconfig resync, mostly fixable withdotnet format style. No work in flight.:suggestionsuffix on each style option: Same coverage, one key per option, but a second severity form beside the documenteddotnet_diagnosticone. No work in flight.dotnet_analyzer_diagnostic.category-Style.severity: One line, but switches on every IDE rule the file never configures at defaults nobody chose, close to the blanket line the skill warns against. No work in flight.Evidence:
.editorconfig[*.cs]from :47: onlydotnet_diagnostic.IDE0055.severity = none(:51) andcsharp_preferred_modifier_order ...:warning(:71) carry a severity;csharp_style_namespace_declarations(:113) andcsharp_style_var_*(:136-138) carry none. dotnet-codestyle SKILL.md:145-150 namesdotnet_diagnostic.<RULE>.severityand forbids relaxing withdotnet_analyzer_diagnostic.severity. Nothing setsEnforceCodeStyleInBuild, so asuggestionreaches the format gate, not the build.spec/files.json:22carries.editorconfigwhole to every repo, and 7 registry repos are typedcsharp.Blocks: none
ptr727 commentedon Nov 1, 2026
Maintainer answer (decision triage, 2026-11-01): Option 1: add a dotnet_diagnostic.IDExxxx.severity = suggestion entry for each code-style rule the canonical .editorconfig configures. IDE0055 stays none, and CA severities are untouched. Carrying C# repos fix the new findings at their next resync. This is now work for the next burndown round.
ptr727 commentedon Nov 23, 2026
Backlog burndown claim (round 5, 2026-11-23): branch
burndown/editorconfig-ide-severity.Predicted files: .editorconfig, .agents/skills/dotnet-codestyle/SKILL.md, .agents/skills/dotnet-codestyle/references/testing.md, .agents/skills/dotnet-codestyle/references/conventions.md (the last three added 2026-11-24 per the maintainer's answer), and their build_dist outputs.
Group issues: #1842.
ptr727 commentedon Nov 24, 2026
Question for the maintainer (backlog burndown round 5, 2026-11-24). The group working this issue stopped before its first push. Branch
burndown/editorconfig-ide-severityholds one local commit, which adds 91dotnet_diagnostic.IDExxxx.severity = suggestionentries taken from the .NET 10.0.404 SDK's own option-to-rule map. A constructed probe shows the gate now reports IDE0003, IDE0008, IDE0022, IDE0025, IDE0032 and IDE0161, which it previously missed.Two rules the decision covers conflict with the
dotnet-codestyleskill:builder.Append(part);and the skill's own test exampleactual.Should().Be(expected);. Its fix rewrites every such call to_ = ...across the C# repos that carry the file.A third rule, IDE0079 (unnecessary suppression), does nothing at the gate, and in the IDE it may offer to remove third-party suppressions.
Options, recommended first:
ptr727 commentedon Nov 24, 2026
Maintainer's answer, 2026-11-24: use the strictest, most correct defaults, even where existing code has to be fixed. Keep every rule, IDE0058, IDE0046 and IDE0079 included, at
warningseverity rather thansuggestion. Update thedotnet-codestyleskill to match: the guard-clause rule, and the_ =form in its test example. Carrying C# repositories fix their code at resync.Raise the Canonical .editorconfig's IDE Style Rules to Warning (#4386)