|
| 1 | +# Brief Review: Issue #115 — Run dotnet format |
| 2 | + |
| 3 | +## Overall Assessment |
| 4 | + |
| 5 | +The brief is clear and well-structured. |
| 6 | +The scope is appropriate for a single PR. |
| 7 | +Three concrete issues need fixing before implementation begins. |
| 8 | + |
| 9 | +--- |
| 10 | + |
| 11 | +## Issues Found |
| 12 | + |
| 13 | +### 1. Violation count is internally inconsistent (Critical) |
| 14 | + |
| 15 | +The brief states **346 formatting violations across 101 files**, but the breakdown only accounts for 86: |
| 16 | + |
| 17 | +- 78 FINALNEWLINE violations |
| 18 | +- 8 WHITESPACE violations |
| 19 | +- **Total: 86**, not 346 |
| 20 | + |
| 21 | +Either the 346 figure is from a different tool invocation or reporting mode, or there are additional violation categories not listed. |
| 22 | +An implementer checking their work against "346" will be confused if `dotnet format --verify-no-changes` reports a different number. |
| 23 | + |
| 24 | +**Action**: Run `dotnet format --verify-no-changes HdrHistogram.sln` on the current branch and replace the stale counts with actual output. |
| 25 | +If there are additional violation types (e.g. ENCODING, CHARSET), list them explicitly. |
| 26 | + |
| 27 | +--- |
| 28 | + |
| 29 | +### 2. Per-project file counts are inaccurate (Significant) |
| 30 | + |
| 31 | +The brief's per-directory `.cs` file counts do not match the actual filesystem: |
| 32 | + |
| 33 | +| Project | Brief claimed | Actual on disk | |
| 34 | +|---------|--------------|----------------| |
| 35 | +| `HdrHistogram/` | 51 | 56 | |
| 36 | +| `HdrHistogram.UnitTests/` | 35 | 34 | |
| 37 | +| `HdrHistogram.Examples/` | 4 | 6 | |
| 38 | +| `HdrHistogram.Benchmarking/` | 13 | 27 | |
| 39 | +| **Total** | **103** | **123** | |
| 40 | + |
| 41 | +The benchmarking project discrepancy (13 vs 27) is large enough to cast doubt on the "101 affected files" claim. |
| 42 | +Additionally, the per-directory totals in the brief sum to 103, not the stated 101 — a secondary arithmetic error. |
| 43 | + |
| 44 | +**Action**: Replace the static file counts with the actual output of `dotnet format --verify-no-changes --verbosity diagnostic`, which lists every affected file. |
| 45 | +Alternatively, note that these are approximate counts and that the authoritative list comes from the tool. |
| 46 | + |
| 47 | +--- |
| 48 | + |
| 49 | +### 3. `dotnet format` sub-command scope is unspecified (Minor) |
| 50 | + |
| 51 | +The implementation step says: |
| 52 | + |
| 53 | +> Run `dotnet format HdrHistogram.sln` |
| 54 | +
|
| 55 | +Running `dotnet format` without a sub-command invokes all three fixers: `whitespace`, `style`, and `analyzers`. |
| 56 | +The `.editorconfig` contains Roslyn naming-convention rules (`_camelCase` private fields, `PascalCase` public members) at `suggestion` severity. |
| 57 | +By default `dotnet format style` only applies rules at `warning` severity or above, so naming rules will not be auto-applied — but this is not stated in the brief, leaving an implementer uncertain. |
| 58 | + |
| 59 | +**Action**: Either: |
| 60 | + |
| 61 | +- Narrow the command to `dotnet format whitespace HdrHistogram.sln` to make the whitespace-only scope explicit and remove ambiguity, or |
| 62 | +- Keep `dotnet format HdrHistogram.sln` but add a note explaining that `suggestion`-severity naming rules are excluded from the default run, so the diff will still be whitespace-only. |
| 63 | + |
| 64 | +The brief already identifies this as a risk; it just needs a resolution, not just a mitigation note. |
| 65 | + |
| 66 | +--- |
| 67 | + |
| 68 | +## What Is Good |
| 69 | + |
| 70 | +- **Clarity**: Step-by-step implementation instructions are unambiguous. |
| 71 | +- **Scope**: A one-time bulk formatting pass is exactly one PR's worth of work. |
| 72 | +- **Feasibility**: All referenced files and directories exist. |
| 73 | + `.editorconfig` is confirmed to contain `insert_final_newline = true` and `end_of_line = lf`. |
| 74 | + `HdrHistogram/Utilities/Bitwise.cs` exists and has visible indentation/trailing-whitespace issues. |
| 75 | +- **Test strategy**: Correct — no new tests needed; existing suite verifies no regressions. |
| 76 | +- **Acceptance criteria**: All six criteria are measurable and verifiable by command exit code or `git diff` inspection. |
| 77 | +- **`.git-blame-ignore-revs`**: File does not yet exist; creating it in the same PR is the right call. |
| 78 | +- **Analyser risk**: No custom analyser NuGet packages are present in any `.csproj` file, so the risk of non-whitespace changes from analyser rules is low. |
| 79 | + |
| 80 | +--- |
| 81 | + |
| 82 | +## Summary of Required Changes to Brief |
| 83 | + |
| 84 | +1. Replace stale violation counts (346 / 101) with figures from a fresh `dotnet format --verify-no-changes` run. |
| 85 | +2. Correct or remove the per-project `.cs` file counts (actual totals are 56 / 34 / 6 / 27 = 123 files). |
| 86 | +3. Resolve the sub-command ambiguity: specify `dotnet format whitespace` or document why `dotnet format` (full) is safe. |
0 commit comments