Commit 3a45453
committed
test+refactor: fix dead conditional assert and unify Sprintf in conciseness rule
Two fixes from code-review round 3:
- rule_test.go: TestCheck_MessageNoConcatenationWhenExamplesPresent guarded
the assert.Contains(msg, "e.g.,") behind `if strings.Contains(msg, "reduce
verbose cues")`, making it a no-op in the exact regression it was meant to
catch (message drops cue text → outer if is false → inner assert never runs).
verboseParagraph() always produces cues, so assert both strings
unconditionally. Remove the now-unused "strings" import.
- rule.go: Replace the if/else with two identical fmt.Sprintf call sites (same
three arguments, same format prefix) with a single call that takes a
conditional cuesSuffix string. The base format string now lives in one place
so it can't diverge between the cue and no-cue paths.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QYub2iGP6CeeEFSfjV3Wv1 parent 12f6a79 commit 3a45453
2 files changed
Lines changed: 11 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
112 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
113 | 109 | | |
114 | 110 | | |
115 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
314 | 313 | | |
315 | 314 | | |
316 | 315 | | |
317 | | - | |
318 | | - | |
| 316 | + | |
319 | 317 | | |
320 | 318 | | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
325 | 322 | | |
326 | 323 | | |
327 | 324 | | |
| |||
0 commit comments