Commit 3dd4e89
fix: emit lint diff in conventional got→want direction (#230)
ExecDiff ran `diff want got` with labels `--- want` / `+++ got`, so the
printed diff described how to turn the correctly-formatted file into the
current (unformatted) one. That is the inverse of the convention used by
`gofmt -d`, `prettier` and `black --diff`, where the diff goes from the
current file to the expected output and can be applied directly as a
patch to fix formatting.
Swap the operands and labels so the output is `--- got` / `+++ want`:
removed lines are the current contents, added lines are the fix.
No behavioral change to formatting or lint pass/fail; only the direction
and labels of the informational diff. lint_test.go asserts on the
returned error only, so existing tests are unaffected.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent e8ca656 commit 3dd4e89
1 file changed
Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
43 | 48 | | |
44 | 49 | | |
45 | 50 | | |
46 | 51 | | |
47 | 52 | | |
48 | | - | |
49 | | - | |
50 | 53 | | |
51 | | - | |
| 54 | + | |
| 55 | + | |
52 | 56 | | |
| 57 | + | |
53 | 58 | | |
54 | 59 | | |
55 | 60 | | |
| |||
0 commit comments