From ffab2be22aa0999446de99f6a2f93997f0c7bf74 Mon Sep 17 00:00:00 2001 From: Jaap-Jan de Wit | DodoTech Date: Sat, 1 Aug 2026 21:43:32 +0200 Subject: [PATCH] Drop the formatting step, which spent minutes agreeing with the build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `dotnet format --verify-no-changes` re-analysed the whole solution before the build did, to reach a verdict the build reaches on its own: IDE0055 is an error in .editorconfig, EnforceCodeStyleInBuild is on and warnings are errors, so a misformatted file fails the build step. What the separate step bought was hearing about it a few minutes earlier, and it charged those minutes on every run. Checked rather than assumed, because the whole justification rests on it: appending a badly-spaced member to a source file produces three `error IDE0055` lines and a failed build with no format step in sight. Three places said the old arrangement out loud and would now be wrong on their own — the comment on the IDE0055 line, the conventions list in the README, and a note in platform-flags telling people to run dotnet format before pushing or CI would fail them. They say the build enforces it now. dotnet format is still how to fix what the build complains about; it just no longer gates anything. Co-Authored-By: Claude Opus 5 (1M context) --- .editorconfig | 4 +++- .github/workflows/ci.yml | 7 +++++-- README.md | 3 ++- docs/platform-flags.md | 8 +++++--- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.editorconfig b/.editorconfig index b7bc01e..8ae9273 100644 --- a/.editorconfig +++ b/.editorconfig @@ -91,7 +91,9 @@ dotnet_naming_style.camel_case_style.capitalization = camel_case #### Diagnostics #### -# Formatting violations fail the build; `dotnet format --verify-no-changes` gates CI. +# Formatting violations fail the build, and that is now the whole of the enforcement: CI +# has no `dotnet format --verify-no-changes` step any more, because this line already +# fails it. dotnet_diagnostic.IDE0055.severity = error # ConfigureAwait is not meaningful in ASP.NET Core (no SynchronizationContext). It IS diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c9596ef..33e7ff5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -104,8 +104,11 @@ jobs: - name: restore run: dotnet restore DodoSSH.slnx --locked-mode - - name: verify formatting - run: dotnet format DodoSSH.slnx --verify-no-changes --no-restore + # No `dotnet format --verify-no-changes` step. It re-analysed the whole solution before + # the build did, for minutes, to check something the build already checks: IDE0055 is an + # error in .editorconfig and TreatWarningsAsErrors is on, so a misformatted file fails + # the build step below on its own. What the separate step added was the ability to say + # so a few minutes earlier, and it cost more than that on every run. # Avalonia's headless renderer is still Skia, and libSkiaSharp.so — which the layout # test project copies into its own output — links against libfontconfig. Without that diff --git a/README.md b/README.md index 0f36fcd..b33a7c2 100644 --- a/README.md +++ b/README.md @@ -366,7 +366,8 @@ keychain plus a terminal — and the spike that gates all of it. ### Conventions the build enforces -- Warnings are errors. `dotnet format --verify-no-changes` gates CI. +- Warnings are errors, formatting included: `IDE0055` is an error in `.editorconfig`, so a + misformatted file fails the build itself rather than a separate CI step. - Package versions are centralised in `Directory.Packages.props`; `packages.lock.json` is committed and CI restores in locked mode. - [`BannedSymbols.txt`](BannedSymbols.txt) bans `DateTime.UtcNow` (use `TimeProvider`), diff --git a/docs/platform-flags.md b/docs/platform-flags.md index 3e91090..23fe04d 100644 --- a/docs/platform-flags.md +++ b/docs/platform-flags.md @@ -479,9 +479,11 @@ locates a fixture by source path passes locally and fails in CI. Copy fixtures t directory and read them via `AppContext.BaseDirectory` instead; `GoldenVectorTests` shows the pattern. -**`dotnet format --verify-no-changes` is part of the CI gate** and exits non-zero on style -warnings, not just whitespace. Run it before pushing; a build with zero warnings can still fail -that step. +**Formatting fails the build rather than a separate step.** `IDE0055` is an error in +`.editorconfig` and `EnforceCodeStyleInBuild` is on, so `dotnet build` reports misformatted code +the way it reports a type error. CI used to run `dotnet format --verify-no-changes` as well; it +was removed for spending minutes to reach a verdict the build reaches anyway. `dotnet format` is +still how to *fix* what the build complains about — it just no longer gates anything itself. ## Deployment