feat(#115): Run dotnet format to fix existing code to match .editorconfig#128
Merged
LeeCampbell merged 9 commits intoHdrHistogram:mainfrom Mar 1, 2026
Conversation
4 tasks
LeeCampbell
approved these changes
Mar 1, 2026
2c6ecad to
0890835
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #115: Run dotnet format to fix existing code to match .editorconfig
Summary
The
.editorconfigfile was introduced in issue #114 (commit14b962b).Existing source code predates these conventions and does not yet conform to them.
This issue is a one-time bulk reformatting pass using
dotnet format whitespaceto bring all files into alignment.The change must be isolated in its own commit so that
git blame --ignore-revcan skip it.What Needs to Change and Why
Running
dotnet format --verify-no-changes HdrHistogram.slnon the current branch reports 346 formatting violations across 101 files:end_of_line = lfin.editorconfig)insert_final_newline = truein.editorconfig)HdrHistogram/Utilities/Bitwise.cs(lines 43–55)The changes are purely cosmetic (whitespace, line endings, and newlines).
No logic, API surface, or behaviour is altered.
Affected Files
The repository contains 123
.csfiles across four projects, of which 101 have at least one violation:HdrHistogram/— 56.cssource files (main library)HdrHistogram.UnitTests/— 34.cstest filesHdrHistogram.Examples/— 6.csexample filesHdrHistogram.Benchmarking/— 27.csbenchmark filesThe authoritative list of affected files comes from
dotnet format --verify-no-changes HdrHistogram.slnoutput.The file with the most substantive changes is:
HdrHistogram/Utilities/Bitwise.cs— 8 whitespace/indentation fixesAll other files require only line-ending normalisation and/or a trailing newline added at end-of-file.
Acceptance Criteria
dotnet format --verify-no-changes HdrHistogram.slnexits with code 0 after the fix is applieddotnet build HdrHistogram.slnsucceeds with no errors or warnings introduced by this changedotnet test HdrHistogram.sln).git-blame-ignore-revsfile is created at the repo root containing the SHA of the formatting commitchore: apply dotnet format to match .editorconfigTest Strategy
No new tests are required — this is a pure formatting change.
Existing tests must continue to pass without modification.
Verification steps:
dotnet format --verify-no-changes HdrHistogram.sln— must exit 0dotnet build HdrHistogram.sln— must succeeddotnet test HdrHistogram.sln— all tests must passgit diffbefore committing — confirm only whitespace/newline changesImplementation Steps
dotnet format whitespace HdrHistogram.slnto apply all whitespace fixes automaticallydotnet format --verify-no-changes HdrHistogram.slndotnet build HdrHistogram.slnto confirm build is cleandotnet test HdrHistogram.slnto confirm tests passchore: apply dotnet format to match .editorconfig.git-blame-ignore-revswith that SHA.git-blame-ignore-revsin the same PRmainRisks and Open Questions
dotnet formatcommand without a sub-command invokes all three fixers:whitespace,style, andanalyzers.The
.editorconfigcontains Roslyn naming-convention rules atsuggestionseverity; by defaultdotnet format styleonly applies rules atwarningseverity or above, so naming rules would not be auto-applied.Mitigation: use
dotnet format whitespace HdrHistogram.slnexplicitly to limit the scope to whitespace-only fixes and remove all ambiguity.Mitigation:
.editorconfigenforcesend_of_line = lf; this is the intended target, and ENDOFLINE violations confirm CRLF files exist in the repo.Bitwise.csindentation changes (8 WHITESPACE violations) are the only non-trivial fixes; they should be spot-checked manually to confirm no logic change..csprojfile, so the risk of non-whitespace changes from analyser rules is negligible.Task breakdown
Task List: Issue #115 — Run dotnet format to fix existing code
Context
A one-time bulk reformatting pass using
dotnet format whitespaceto bring all 123.csfiles into alignment with the
.editorconfigintroduced in issue #114.346 violations exist across 101 files: 213 ENDOFLINE, 78 FINALNEWLINE, 47 CHARSET, 8 WHITESPACE.
No logic, API surface, or behaviour is altered.
Tasks
1. Apply formatting
dotnet format whitespace HdrHistogram.slnto automatically fix all whitespace,line-ending, charset, and final-newline violations across all four projects.
Why: The brief mandates using the
whitespacesub-command explicitly to avoid invokingstyleoranalyzersfixers that could make non-cosmetic changes.Verify: Command exits with code 0 and reports files modified.
2. Spot-check Bitwise.cs
HdrHistogram/Utilities/Bitwise.cs(lines 40–60) usinggit diffto confirm the 8 WHITESPACE fixes are indentation-only and contain no logic change.
Why: This is the only file with substantive (non-trivial) formatting changes; the brief
calls it out explicitly as requiring manual verification.
Verify: Diff shows only whitespace/indentation changes; no executable tokens added or removed.
3. Verify formatting is fully resolved
dotnet format --verify-no-changes HdrHistogram.slnand confirm it exits withcode 0 and reports zero violations.
Why: Acceptance criterion 1 — the formatter must report a clean state after the fix.
Verify: Exit code is 0; output contains no violation lines.
4. Confirm build is clean
dotnet build HdrHistogram.slnand confirm it succeeds with no errors and nowarnings introduced by this change.
Why: Acceptance criterion 2 — reformatting must not break the build.
Verify: Build output ends with
Build succeededand warning count is unchanged.5. Confirm all unit tests pass
dotnet test HdrHistogram.slnand confirm every test passes.Why: Acceptance criterion 3 — existing tests must continue to pass without modification.
Verify: Test output shows 0 failed, 0 skipped (or same counts as pre-change baseline).
6. Commit the formatting change
git add -u) and create a commit with the exact message:chore: apply dotnet format to match .editorconfigWhy: Acceptance criterion 6 — the commit message must match this string exactly so that
tooling (e.g.
git log --grep) and the blame-ignore-revs entry can reference it reliably.Verify:
git log -1 --format=%soutputs the required message verbatim.7. Create
.git-blame-ignore-revsgit rev-parse HEAD) and create.git-blame-ignore-revsat the repository root containing that SHA, prefixed with acomment line:
# chore: apply dotnet format to match .editorconfigWhy: Acceptance criterion 5 — the bulk formatting commit must be skippable via
git blame --ignore-revs-file .git-blame-ignore-revsso thatgit blameoutput remainsmeaningful for future authors.
Verify: File exists at repo root; contains the correct 40-character SHA; running
git blame --ignore-revs-file .git-blame-ignore-revs HdrHistogram/Utilities/Bitwise.csdoes not attribute lines to the formatting commit.
8. Commit
.git-blame-ignore-revs.git-blame-ignore-revswith message:chore: add .git-blame-ignore-revs for formatting commitWhy: The brief says to include this file in the same PR; it must be its own commit so it
is not mixed with the formatting diff.
Verify:
git log --oneline -2shows both the formatting commit and this follow-up commit.9. Open a pull request
mainusinggh pr create.PR title:
chore: apply dotnet format to match .editorconfig (#115)PR body must reference issue Run dotnet format to fix existing code to match .editorconfig #115 and summarise: what was run, violation counts fixed,
and note that
.git-blame-ignore-revsis included.Why: Required by the git workflow in CLAUDE.md; the brief asks for the PR to be opened.
Verify: PR is open, CI passes, PR description references issue Run dotnet format to fix existing code to match .editorconfig #115.
Acceptance Criterion Cross-Reference
dotnet format --verify-no-changes HdrHistogram.slnexits code 0dotnet build HdrHistogram.slnsucceeds with no errors or warningsdotnet test HdrHistogram.sln).git-blame-ignore-revscreated at repo root with formatting commit SHAchore: apply dotnet format to match .editorconfigCloses #115