forked from leanprover-community/mathlib4
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDocString.lean
More file actions
128 lines (100 loc) · 2.77 KB
/
DocString.lean
File metadata and controls
128 lines (100 loc) · 2.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
import Mathlib.Tactic.AdaptationNote
import Mathlib.Tactic.Linter.DocString
/-! Tests for the `docstring` linter -/
set_option linter.style.docString true
#adaptation_note /--This comment is not inspected by the `docString` linter.-/
example : True := by
#adaptation_note /-- This comment is not inspected by the `docString` linter.
-/
trivial
/--
warning: warning: this doc-string is empty
Note: This linter can be disabled with `set_option linter.style.docString.empty false`
-/
#guard_msgs in
/---/
example : Nat := 0
/--
warning: warning: this doc-string is empty
Note: This linter can be disabled with `set_option linter.style.docString.empty false`
-/
#guard_msgs in
/--
-/
example : Nat := 0
set_option linter.style.docString.empty false
/---/
example : Nat := 0
set_option linter.style.docString.empty true
set_option linter.style.docString false
#guard_msgs in
/--Missing space -/
example : Nat := 1
set_option linter.style.docString true
/--
warning: error: doc-strings should start with a single space or newline
Note: This linter can be disabled with `set_option linter.style.docString false`
-/
#guard_msgs in
/--Missing space -/
example : Nat := 1
/--
warning: error: doc-strings should end with a single space or newline
Note: This linter can be disabled with `set_option linter.style.docString false`
-/
#guard_msgs in
/-- Missing ending space-/
example : Nat := 1
/--
warning: error: doc-strings should start with a single space or newline
Note: This linter can be disabled with `set_option linter.style.docString false`
-/
#guard_msgs in
/-- Two starting spaces -/
example : Nat := 1
/--
warning: error: doc-strings should end with a single space or newline
Note: This linter can be disabled with `set_option linter.style.docString false`
-/
#guard_msgs in
/--
Two ending spaces -/
example : Nat := 1
/--
warning: error: doc-strings should end with a single space or newline
Note: This linter can be disabled with `set_option linter.style.docString false`
-/
#guard_msgs in
/-- Let's give an example.
```lean4
def foo : Bool := by
sorry
```
-/
example : Nat := 1
/--
warning: error: doc-strings should not end with a comma
Note: This linter can be disabled with `set_option linter.style.docString false`
-/
#guard_msgs in
/-- Let's give an example ending in a comma, -/
example : Nat := 1
/--
warning: error: doc-strings should start with a single space or newline
Note: This linter can be disabled with `set_option linter.style.docString false`
---
warning: error: doc-strings should start with a single space or newline
Note: This linter can be disabled with `set_option linter.style.docString false`
-/
#guard_msgs in
/-- The structure `X`. -/
structure X where
/-- A field of `X`.
-/
x : Unit
z : Unit
/--
A field of `X`
spanning multiple lines.
-/
y : Unit