forked from leanprover/lean4
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add internal linter for List/Array/Vector variable names (leanp…
…rover#6966) This PR adds an internal-use-only strict linter for the variable names of `List`/`Array`/`Vector` variables, and begins cleaning up.
- Loading branch information
1 parent
85efcba
commit 1c83604
Showing
4 changed files
with
213 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
set_option linter.listName true | ||
|
||
#guard_msgs in | ||
example (l : List Nat) : l = l := rfl | ||
|
||
#guard_msgs in | ||
example (l' : List Nat) : l' = l' := rfl | ||
|
||
#guard_msgs in | ||
example (l₁ : List Nat) : l₁ = l₁ := rfl | ||
|
||
#guard_msgs in | ||
example (l₂ : List Nat) : l₂ = l₂ := rfl | ||
|
||
/-- | ||
warning: Forbidden variable appearing as a `List` name: use `l` instead of l₃ | ||
note: this linter can be disabled with `set_option linter.listName false` | ||
--- | ||
warning: Forbidden variable appearing as a `List` name: use `l` instead of l₃ | ||
note: this linter can be disabled with `set_option linter.listName false` | ||
-/ | ||
#guard_msgs in | ||
example (l₃ : List Nat) : l₃ = l₃ := rfl | ||
|
||
#guard_msgs in | ||
example (xs : List Nat) : xs = xs := rfl | ||
|
||
/-- | ||
warning: Forbidden variable appearing as a `List` name: use `l` instead of ps | ||
note: this linter can be disabled with `set_option linter.listName false` | ||
--- | ||
warning: Forbidden variable appearing as a `List` name: use `l` instead of ps | ||
note: this linter can be disabled with `set_option linter.listName false` | ||
-/ | ||
#guard_msgs in | ||
example (ps : List Nat) : ps = ps := rfl | ||
|
||
/-- | ||
warning: Forbidden variable appearing as a `Array` name: use `l` instead of l | ||
note: this linter can be disabled with `set_option linter.listName false` | ||
--- | ||
warning: Forbidden variable appearing as a `Array` name: use `l` instead of l | ||
note: this linter can be disabled with `set_option linter.listName false` | ||
-/ | ||
#guard_msgs in | ||
example (l : Array Nat) : l = l := rfl |