Skip to content

Commit 65e9915

Browse files
plan(HdrHistogram#115): apply brief review feedback
1 parent 9edd0dd commit 65e9915

2 files changed

Lines changed: 25 additions & 109 deletions

File tree

plan/planning/brief-review.md

Lines changed: 0 additions & 86 deletions
This file was deleted.

plan/planning/brief.md

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,44 @@
44

55
The `.editorconfig` file was introduced in issue #114 (commit `14b962b`).
66
Existing source code predates these conventions and does not yet conform to them.
7-
This issue is a one-time bulk reformatting pass using `dotnet format` to bring all files into alignment.
7+
This issue is a one-time bulk reformatting pass using `dotnet format whitespace` to bring all files into alignment.
88
The change must be isolated in its own commit so that `git blame --ignore-rev` can skip it.
99

1010
## What Needs to Change and Why
1111

12-
Running `dotnet format --verify-no-changes` on the current solution reports **346 formatting violations across 101 files**:
12+
Running `dotnet format --verify-no-changes HdrHistogram.sln` on the current branch reports **346 formatting violations across 101 files**:
1313

14+
- **213 ENDOFLINE violations** — files using CRLF line endings instead of LF (`end_of_line = lf` in `.editorconfig`)
1415
- **78 FINALNEWLINE violations** — files that do not end with a newline character (`insert_final_newline = true` in `.editorconfig`)
16+
- **47 CHARSET violations** — files with character-encoding issues (e.g. byte-order marks)
1517
- **8 WHITESPACE violations** — indentation issues in `HdrHistogram/Utilities/Bitwise.cs` (lines 43–55)
1618

17-
The changes are purely cosmetic (whitespace and newlines).
19+
The changes are purely cosmetic (whitespace, line endings, and newlines).
1820
No logic, API surface, or behaviour is altered.
1921

2022
## Affected Files
2123

22-
All four projects are affected:
24+
The repository contains 123 `.cs` files across four projects, of which 101 have at least one violation:
2325

24-
- `HdrHistogram/`51 `.cs` source files (main library)
25-
- `HdrHistogram.UnitTests/`35 `.cs` test files
26-
- `HdrHistogram.Examples/`4 `.cs` example files
27-
- `HdrHistogram.Benchmarking/`13 `.cs` benchmark files
26+
- `HdrHistogram/`56 `.cs` source files (main library)
27+
- `HdrHistogram.UnitTests/`34 `.cs` test files
28+
- `HdrHistogram.Examples/`6 `.cs` example files
29+
- `HdrHistogram.Benchmarking/`27 `.cs` benchmark files
2830

29-
**Total: 101 files, 346 violations.**
31+
The authoritative list of affected files comes from `dotnet format --verify-no-changes HdrHistogram.sln` output.
3032

3133
The file with the most substantive changes is:
3234

3335
- `HdrHistogram/Utilities/Bitwise.cs` — 8 whitespace/indentation fixes
3436

35-
All other files require only a trailing newline added at end-of-file.
37+
All other files require only line-ending normalisation and/or a trailing newline added at end-of-file.
3638

3739
## Acceptance Criteria
3840

39-
- [ ] `dotnet format --verify-no-changes` exits with code 0 after the fix is applied
40-
- [ ] `dotnet build` succeeds with no errors or warnings introduced by this change
41-
- [ ] All unit tests pass (`dotnet test`)
42-
- [ ] No functional code changes — diffs contain only whitespace and newline additions
41+
- [ ] `dotnet format --verify-no-changes HdrHistogram.sln` exits with code 0 after the fix is applied
42+
- [ ] `dotnet build HdrHistogram.sln` succeeds with no errors or warnings introduced by this change
43+
- [ ] All unit tests pass (`dotnet test HdrHistogram.sln`)
44+
- [ ] No functional code changes — diffs contain only whitespace, line-ending, and newline additions
4345
- [ ] A `.git-blame-ignore-revs` file is created at the repo root containing the SHA of the formatting commit
4446
- [ ] The commit message is `chore: apply dotnet format to match .editorconfig`
4547

@@ -50,28 +52,28 @@ Existing tests must continue to pass without modification.
5052

5153
Verification steps:
5254

53-
1. Run `dotnet format --verify-no-changes` — must exit 0
55+
1. Run `dotnet format --verify-no-changes HdrHistogram.sln` — must exit 0
5456
2. Run `dotnet build HdrHistogram.sln` — must succeed
5557
3. Run `dotnet test HdrHistogram.sln` — all tests must pass
5658
4. Inspect the diff with `git diff` before committing — confirm only whitespace/newline changes
5759

5860
## Implementation Steps
5961

60-
1. Run `dotnet format HdrHistogram.sln` to apply all fixes automatically
62+
1. Run `dotnet format whitespace HdrHistogram.sln` to apply all whitespace fixes automatically
6163
2. Verify with `dotnet format --verify-no-changes HdrHistogram.sln`
6264
3. Run `dotnet build HdrHistogram.sln` to confirm build is clean
6365
4. Run `dotnet test HdrHistogram.sln` to confirm tests pass
6466
5. Commit with message: `chore: apply dotnet format to match .editorconfig`
6567
6. Record the commit SHA and create `.git-blame-ignore-revs` with that SHA
66-
7. Commit `.git-blame-ignore-revs` (separate commit or same PR)
68+
7. Commit `.git-blame-ignore-revs` in the same PR
6769
8. Open a PR against `main`
6870

6971
## Risks and Open Questions
7072

71-
- **Risk:** `dotnet format` may apply analyser-driven style changes (not just whitespace) if analyser rules are enabled in `.editorconfig` or project files.
72-
Mitigation: review `git diff` before committing to confirm the scope is whitespace-only.
73+
- **Risk:** The `dotnet format` command without a sub-command invokes all three fixers: `whitespace`, `style`, and `analyzers`.
74+
The `.editorconfig` contains Roslyn naming-convention rules at `suggestion` severity; by default `dotnet format style` only applies rules at `warning` severity or above, so naming rules would not be auto-applied.
75+
Mitigation: use `dotnet format whitespace HdrHistogram.sln` explicitly to limit the scope to whitespace-only fixes and remove all ambiguity.
7376
- **Risk:** CRLF/LF normalisation could affect files on Windows dev machines.
74-
Mitigation: `.editorconfig` enforces `end_of_line = lf`; this is the intended target.
75-
- **Open question:** Should `.git-blame-ignore-revs` be committed in the same PR or a follow-up?
76-
Preference from issue: same PR.
77-
- **Note:** The `Bitwise.cs` indentation changes (8 violations) are the only non-trivial whitespace fixes; they should be spot-checked manually to confirm no logic change.
77+
Mitigation: `.editorconfig` enforces `end_of_line = lf`; this is the intended target, and ENDOFLINE violations confirm CRLF files exist in the repo.
78+
- **Note:** The `Bitwise.cs` indentation changes (8 WHITESPACE violations) are the only non-trivial fixes; they should be spot-checked manually to confirm no logic change.
79+
- **Note:** No custom analyser NuGet packages are present in any `.csproj` file, so the risk of non-whitespace changes from analyser rules is negligible.

0 commit comments

Comments
 (0)