You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: rewrite the duplicateImports linter (#17555)
as part of the header linter. This yields better error spans, is more robust (as it avoids false positives from text-based parsing) and yields results more quickly (providing a better user experience).
Also rewrite the `broadImports` linter to log warnings directly, as opposed to passing them down to the `headerLinter` and logging them there.
Co-authored-by: grunweg <rothgami@math.hu-berlin.de>
Co-authored-by: adomani <adomani@gmail.com>
Copy file name to clipboardExpand all lines: MathlibTest/Header.lean
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -6,23 +6,27 @@ Authors: Damiano Testa
6
6
7
7
import Mathlib.Tactic.Linter.Header
8
8
import Lake
9
+
import Mathlib.Tactic.Linter.Header
9
10
import/- -/ Mathlib.Tactic -- the `TextBased` linter does not flag this `broadImport`
10
11
import Mathlib.Tactic.Have
11
12
import Mathlib.Deprecated.Subfield
12
13
13
14
/--
14
-
warning: In the past, importing 'Lake' in mathlib has led to dramatic slow-downs of the linter (see e.g. mathlib4#13779). Please consider carefully if this import is useful and make sure to benchmark it. If this is fine, feel free to allow this linter.
15
+
warning: In the past, importing 'Lake' in mathlib has led to dramatic slow-downs of the linter (see e.g. mathlib4#13779). Please consider carefully if this import is useful and make sure to benchmark it. If this is fine, feel free to silence this linter.
15
16
note: this linter can be disabled with `set_option linter.style.header false`
16
17
---
17
18
warning: Files in mathlib cannot import the whole tactic folder.
18
19
note: this linter can be disabled with `set_option linter.style.header false`
19
20
---
20
-
warning: Mathlib.Tactic.Have defines a deprecated form of the 'have' tactic; please do not use it in mathlib.
21
+
warning: 'Mathlib.Tactic.Have' defines a deprecated form of the 'have' tactic; please do not use it in mathlib.
21
22
note: this linter can be disabled with `set_option linter.style.header false`
22
23
---
23
24
warning: Files in the `Deprecated` directory are not supposed to be imported.
24
25
note: this linter can be disabled with `set_option linter.style.header false`
0 commit comments