Skip to content

chore: adopt the revised .editorconfig and enable EnforceCodeStyleInBuild (Standards §5.2, §1.2.1) - #29

Merged
StuartMeeks merged 2 commits into
mainfrom
chore/standards-style-baseline
Aug 21, 2026
Merged

chore: adopt the revised .editorconfig and enable EnforceCodeStyleInBuild (Standards §5.2, §1.2.1)#29
StuartMeeks merged 2 commits into
mainfrom
chore/standards-style-baseline

Conversation

@StuartMeeks

Copy link
Copy Markdown
Owner

Brings the repo up to the two NextIteration.Standards clauses that changed after its adoption.

What

  • §5.2.editorconfig replaced with the revised canonical copy. It is a deliberate allow-list of gated style rules (no blanket dotnet_analyzer_diagnostic.severity), so a style rule a future SDK ships never auto-gates the build.
  • §1.2.1EnforceCodeStyleInBuild=true, now a MUST. Directory.Build.props equals the template in non-comment content.
  • §2.7IDE0005 added to the test project's NoWarn, and to the demo's for the same reason.

Closes the 1.2 Directory.Build.props and 5.2 .editorconfig canon rows in audit-drift.sh.

The reformat

92 sites, mechanical and behaviour-preserving:

Rule Sites What
IDE0011 64 braces on single-statement ifs
IDE0300/0301/0028 15 collection expressions
IDE0005 5 genuinely unnecessary usings in src/
IDE0007 3 var
IDE0270 / IDE0022 / IDE0055 5 null check, expression bodies, formatting

Applied with dotnet format style, plus the collection-expression sites its fixer does not handle.

IDE0005 in the demo

IDE0005 only runs in-build when GenerateDocumentationFile is true. Both the test and demo projects set it false — neither is shipped, so neither carries XML docs, and TreatWarningsAsErrors would otherwise fail the build over every missing one. With EnforceCodeStyleInBuild on, IDE0005 then hard-errors demanding the doc file be enabled. §2.7 resolves this for test projects; the demo is the same shape and needs the same opt-out. It still gates src/, where the doc file is on — and it caught five real unnecessary usings there.

Verification

Local Release build: 0 warnings, 0 errors. dotnet test --configuration Release: 392 passed, 0 failed (196 × net8.0/net10.0) — same count as before the reformat.

No change to the library, its public surface, or the package contents.

🤖 Generated with Claude Code

…uild

NextIteration.Standards §5.2 and §1.2.1, the latter now a MUST. Closes the
`1.2 Directory.Build.props` and `5.2 .editorconfig canon` audit rows.

The canonical .editorconfig is a deliberate allow-list of gated style rules —
no blanket dotnet_analyzer_diagnostic.severity — so a rule a future SDK ships
never auto-gates the build. Directory.Build.props now equals the template in
non-comment content, EnforceCodeStyleInBuild included.

Bringing the code green was mechanical and behaviour-preserving, 92 sites:
- IDE0011 braces on single-statement ifs (64)
- IDE0300/IDE0301/IDE0028 collection expressions
- IDE0007 var, IDE0022 expression bodies, IDE0270 null check, IDE0055 format
- IDE0005 five genuinely unnecessary usings in src/

Applied with `dotnet format style`, plus the collection-expression sites its
fixer does not handle. 392 tests (196 × net8.0/net10.0) pass unchanged; build
stays at zero warnings.

IDE0005 is suppressed in the test project (§2.7) and the demo, which is the
same shape — not shipped, GenerateDocumentationFile=false, so IDE0005 would
hard-error demanding the doc file rather than run. It still gates src/.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
{
Assert.Throws<ArgumentNullException>(() => UpdateCleanup.Run((IServiceProvider)null!));
}
public void Run_with_null_services_throws() => Assert.Throws<ArgumentNullException>(() => UpdateCleanup.Run((IServiceProvider)null!));
{
Assert.Throws<ArgumentNullException>(() => UpdateCleanup.Run((IUpdateInstaller)null!, new TestConsole()));
}
public void Run_with_null_installer_throws() => Assert.Throws<ArgumentNullException>(() => UpdateCleanup.Run((IUpdateInstaller)null!, new TestConsole()));
Comment on lines +131 to +134
}

if (!EndsWithRidAndArchive(asset.Name, ridSuffix))
{
}

public string Combine(params string[] parts) => System.IO.Path.Combine(new[] { Path }.Concat(parts).ToArray());
public string Combine(params string[] parts) => System.IO.Path.Combine([Path, .. parts]);
`dotnet format`'s IDE0022 conversion hoisted two leading comments into the
gap between `=>` and the expression. Roslyn's formatter and the canonical
.editorconfig disagree about the newline trivia around a comment in that
position, and the disagreement only surfaces on the Windows runner — the
ubuntu and macOS legs, and a local Linux build, all report zero warnings.

Both sites now carry the comment above the member, which is the shape they
had before the reformat and reads better anyway. No behaviour change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@StuartMeeks
StuartMeeks merged commit 8802a6c into main Aug 21, 2026
9 checks passed
@StuartMeeks
StuartMeeks deleted the chore/standards-style-baseline branch August 21, 2026 22:58
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