Skip to content

Commit dab05a2

Browse files
committed
chore: change UnusedSimpArgs hint
1 parent 1422c82 commit dab05a2

3 files changed

Lines changed: 20 additions & 20 deletions

File tree

src/Lean/Linter/UnusedSimpArgs.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ private def warnUnused (stx : Syntax) (i : Nat) : CoreM Unit := do
2929
otherArgs := otherArgs.push simpArgs[j]
3030
let stx' := Tactic.setSimpParams stx otherArgs
3131
let suggestion : Meta.Hint.Suggestion := stx'
32-
let suggestion := { suggestion with span? := stx }
32+
let suggestion := { suggestion with span? := stx, diffGranularity := .none }
3333
let mut hint ← MessageData.hint "Omit it from the simp argument list." #[ suggestion ]
3434
-- Add hint about `←`
3535
let isInv := argStx.getKind == ``Lean.Parser.Tactic.simpLemma && !argStx[1].isNone

tests/elab/12559.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ warning: This simp argument is unused:
1212
False
1313
1414
Hint: Omit it from the simp argument list.
15-
simp ̵[̵F̵a̵l̵s̵e̵]̵
15+
[apply] simp
1616
1717
Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`
1818
-/
@@ -30,7 +30,7 @@ warning: This simp argument is unused:
3030
False
3131
3232
Hint: Omit it from the simp argument list.
33-
simp ̵[̵F̵a̵l̵s̵e̵]̵
33+
[apply] simp
3434
3535
Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`
3636
-/

tests/elab/simpUnusedArgs.lean

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ warning: This simp argument is unused:
1212
id_eq
1313
1414
Hint: Omit it from the simp argument list.
15-
simp ̵[̵i̵d̵_̵e̵q̵]̵
15+
[apply] simp
1616
1717
Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`
1818
-/
@@ -24,7 +24,7 @@ warning: This simp argument is unused:
2424
id_eq
2525
2626
Hint: Omit it from the simp argument list.
27-
simp [i̵d̵_̵e̵q̵,̵ ̵and_self]
27+
[apply] simp [and_self]
2828
2929
Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`
3030
-/
@@ -39,7 +39,7 @@ warning: This simp argument is unused:
3939
some_def
4040
4141
Hint: Omit it from the simp argument list.
42-
simp ̵[̵s̵o̵m̵e̵_̵d̵e̵f̵]̵
42+
[apply] simp
4343
4444
Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`
4545
-/
@@ -58,15 +58,15 @@ warning: This simp argument is unused:
5858
some_def.eq_def
5959
6060
Hint: Omit it from the simp argument list.
61-
simp [some_def, some_def.eq_def,̵ ̵s̵o̵m̵e̵_̵d̵e̵f̵.̵e̵q̵_̵d̵e̵f̵]
61+
[apply] simp [some_def, some_def.eq_def]
6262
6363
Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`
6464
---
6565
warning: This simp argument is unused:
6666
some_def.eq_def
6767
6868
Hint: Omit it from the simp argument list.
69-
simp [some_def, some_def.eq_def,̵ ̵s̵o̵m̵e̵_̵d̵e̵f̵.̵e̵q̵_̵d̵e̵f̵]
69+
[apply] simp [some_def, some_def.eq_def]
7070
7171
Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`
7272
-/
@@ -77,15 +77,15 @@ warning: This simp argument is unused:
7777
(some_def.eq_def)
7878
7979
Hint: Omit it from the simp argument list.
80-
simp [some_def, (̵s̵o̵m̵e̵_̵d̵e̵f̵.̵e̵q̵_̵d̵e̵f̵)̵,̵ ̵some_def.eq_def]
80+
[apply] simp [some_def, some_def.eq_def]
8181
8282
Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`
8383
---
8484
warning: This simp argument is unused:
8585
some_def.eq_def
8686
8787
Hint: Omit it from the simp argument list.
88-
simp [some_def, (some_def.eq_def),̵ ̵s̵o̵m̵e̵_̵d̵e̵f̵.̵e̵q̵_̵d̵e̵f̵]
88+
[apply] simp [some_def, (some_def.eq_def)]
8989
9090
Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`
9191
-/
@@ -106,7 +106,7 @@ warning: This simp argument is unused:
106106
some_rdef
107107
108108
Hint: Omit it from the simp argument list.
109-
simp -failIfUnchanged ̵[̵s̵o̵m̵e̵_̵r̵d̵e̵f̵]̵
109+
[apply] simp -failIfUnchanged
110110
111111
Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`
112112
-/
@@ -121,7 +121,7 @@ warning: This simp argument is unused:
121121
some_rdef.eq_def
122122
123123
Hint: Omit it from the simp argument list.
124-
simp -failIfUnchanged [some_rdef,̵ ̵s̵o̵m̵e̵_̵r̵d̵e̵f̵.̵e̵q̵_̵d̵e̵f̵]
124+
[apply] simp -failIfUnchanged [some_rdef]
125125
126126
Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`
127127
-/
@@ -160,7 +160,7 @@ warning: This simp argument is unused:
160160
_h
161161
162162
Hint: Omit it from the simp argument list.
163-
simp -failIfUnchanged ̵[̵_̵h̵]̵
163+
[apply] simp -failIfUnchanged
164164
165165
Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`
166166
-/
@@ -178,7 +178,7 @@ warning: This simp argument is unused:
178178
↓reduceIte
179179
180180
Hint: Omit it from the simp argument list.
181-
simp only [↓reduceI̵t̵e̵,̵ ̵↓̵r̵e̵d̵u̵c̵e̵DIte]
181+
[apply] simp only [reduceDIte]
182182
183183
Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`
184184
-/
@@ -202,7 +202,7 @@ warning: This simp argument is unused:
202202
x
203203
204204
Hint: Omit it from the simp argument list.
205-
simp ̵[̵x̵]̵
205+
[apply] simp
206206
207207
Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`
208208
-/
@@ -216,7 +216,7 @@ warning: This simp argument is unused:
216216
h3
217217
218218
Hint: Omit it from the simp argument list.
219-
simp [h1, h2,̵ ̵h̵3̵]
219+
[apply] simp [h1, h2]
220220
221221
Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`
222222
-/
@@ -229,15 +229,15 @@ warning: This simp argument is unused:
229229
h2
230230
231231
Hint: Omit it from the simp argument list.
232-
simp [h1,̵ ̵h̵2̵]
232+
[apply] simp [h1]
233233
234234
Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`
235235
---
236236
warning: This simp argument is unused:
237237
h1
238238
239239
Hint: Omit it from the simp argument list.
240-
simp [h1̵,̵ ̵h̵2]
240+
[apply] simp [h2]
241241
242242
Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`
243243
-/
@@ -257,7 +257,7 @@ warning: This simp argument is unused:
257257
h
258258
259259
Hint: Omit it from the simp argument list.
260-
simp ̵[̵h̵]̵
260+
[apply] simp
261261
262262
Note: This linter can be disabled with `set_option linter.unusedSimpArgs false`
263263
-/
@@ -304,7 +304,7 @@ warning: This simp argument is unused:
304304
← ab
305305
306306
Hint: Omit it from the simp argument list.
307-
simp ̵[̵←̵ ̵a̵b̵]̵
307+
[apply] simp
308308
309309
Note: Simp arguments with `←` have the additional effect of removing the other direction from the simp set, even if the simp argument itself is unused. If the hint above does not work, try replacing `←` with `-` to only get that effect and silence this warning.
310310

0 commit comments

Comments
 (0)