Indent with tabs #24
Loading…
Reference in a new issue
No description provided.
Delete branch "chore/indent-with-tabs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
indent_style = tabon the root[*]rule, so the house rule is stated once and the exceptions are enumerated with reasons: YAML and JSON keep spaces (tabs are invalid in YAML),.mdkeeps spaces (a leading tab is a code block in CommonMark), and.sqlkeeps spaces because a merged script is immutable under ADR-0021, so tabs would reach only new scripts and leave the rule disagreeing with every script in the tree.The
indent_size = 2rule for build files is deleted, not updated — with tabs, "two for build files, four for code" has nothing left to express, and leaving it would silently have meant something else.Whitespace only, proven three ways rather than asserted:
git diff --ignore-all-spaceis empty outside.editorconfig, and every file has identical added/deleted counts.ValueTextfor every string and char literal in all 47.csfiles before and after: 668 literal values byte-identical.dotnet format --verify-no-changesexits 0 before, 2 after the.editorconfigedit alone, 0 after the sweep. CI already runs that command, so this is enforced rather than advisory.dotnet formatreaches.csonly — the.razorfiles came out byte-identical, so those, plus.csproj/.props/.slnx,.cssandindex.html, were converted by hand. Continuation lines that align under text above them are padded with spaces so the alignment survives any tab width; the XML comment continuations in four.csprojfiles needed correcting after naive unit division put them four tabs deep.Worth knowing:
dotnet formatdoes not touch the interior of a multi-line raw string literal, so the SQL inDatabaseSeeder.csand three test files keeps its 8-space body — the only space indentation left in any.csfile. Reindenting those interiors by hand is precisely the operation that silently changes a string, so it was not done. Attab_width = 4they render as before; at any other width the body no longer lines up under its declaration.Release build 0 warnings, 123 tests pass.
.editorconfig[*]comment: "There is deliberately no per-file-type size below … What each section does opt out of is tabs themselves" —[*.{yml,yaml}]and[*.json]setindent_size = 2and[*.sql]setsindent_size = 4, so three of the four sections below do set a per-file-type size; reword, and drop[*.sql] indent_size = 4while there, which only restates the inherited value.Verdict: changes required
Fixed in
7dc4634: the[*]comment now says a section states a size only where it wants one other than the four above, records thetab_width-defaults-to-indent_sizereason the build-file size had to go, and[*.sql]no longer restates theindent_size = 4it inherits..editorconfig:25-26— "opts out of tabs for a format where a tab is illegal or means something other than indentation" holds for[*.{yml,yaml}]and[*.md]but not for[*.json]or[*.sql]: a tab is ordinary legal whitespace in both, and each of those two states a different ground three lines below it (not our file to reformat; merged scripts are immutable). Widen the sentence or drop the reason from it and leave it to the sections.Verdict: changes required
Remove the superfluous comments in
.editorconfig. There's no need for them. Also remove theindent_sizeproperties; users should not have that enforcedVerdict: changes required
Fixed in
6447b15: the summary no longer claims all four exemptions are formats where a tab is illegal — it says the reasons are not all of a kind and leaves the specifics to the sections that state them.Nothing to action at
6447b15.Verdict: mergeable