nixd
Loading...
Searching...
No Matches
libnixf
src
Basic
diagnostic.py
Go to the documentation of this file.
1
from
typing
import
Literal, TypedDict
2
3
4
class
Diagnostic
(TypedDict):
5
sname: str
6
"Short name"
7
8
cname: str
9
"C++ ideintifer name"
10
11
severity: Literal[
"Error"
,
"Warning"
,
"Fatal"
,
"Hint"
]
12
13
message: str
14
"Message of this diagnostic"
15
16
17
diagnostics: list[Diagnostic] = [
18
{
19
"sname"
:
"lex-unterminated-bcomment"
,
20
"cname"
:
"UnterminatedBComment"
,
21
"severity"
:
"Error"
,
22
"message"
:
"unterminated /* comment"
,
23
},
24
{
25
"sname"
:
"lex-float-no-exp"
,
26
"cname"
:
"FloatNoExp"
,
27
"severity"
:
"Fatal"
,
28
"message"
:
"float point has trailing `{}` but has no exponential part"
,
29
},
30
{
31
"sname"
:
"lex-float-leading-zero"
,
32
"cname"
:
"FloatLeadingZero"
,
33
"severity"
:
"Warning"
,
34
"message"
:
"float begins with extra zeros `{}` is nixf extension"
,
35
},
36
{
37
"sname"
:
"parse-expected"
,
38
"cname"
:
"Expected"
,
39
"severity"
:
"Error"
,
40
"message"
:
"expected {}"
,
41
},
42
{
43
"sname"
:
"parse-int-too-big"
,
44
"cname"
:
"IntTooBig"
,
45
"severity"
:
"Error"
,
46
"message"
:
"this integer is too big for nix interpreter"
,
47
},
48
{
49
"sname"
:
"parse-redundant-paren"
,
50
"cname"
:
"RedundantParen"
,
51
"severity"
:
"Warning"
,
52
"message"
:
"redundant parentheses"
,
53
},
54
{
55
"sname"
:
"parse-attrpath-extra-dot"
,
56
"cname"
:
"AttrPathExtraDot"
,
57
"severity"
:
"Error"
,
58
"message"
:
"extra `.` at the end of attrpath"
,
59
},
60
{
61
"sname"
:
"parse-select-extra-dot"
,
62
"cname"
:
"SelectExtraDot"
,
63
"severity"
:
"Error"
,
64
"message"
:
"extra `.` after expression, but missing attrpath"
,
65
},
66
{
67
"sname"
:
"parse-unexpected-between"
,
68
"cname"
:
"UnexpectedBetween"
,
69
"severity"
:
"Error"
,
70
"message"
:
"unexpected {} between {} and {}"
,
71
},
72
{
73
"sname"
:
"parse-unexpected"
,
74
"cname"
:
"UnexpectedText"
,
75
"severity"
:
"Error"
,
76
"message"
:
"unexpected text"
,
77
},
78
{
79
"sname"
:
"parse-missing-sep-formals"
,
80
"cname"
:
"MissingSepFormals"
,
81
"severity"
:
"Error"
,
82
"message"
:
"missing seperator `,` between two lambda formals"
,
83
},
84
{
85
"sname"
:
"parse-lambda-arg-extra-at"
,
86
"cname"
:
"LambdaArgExtraAt"
,
87
"severity"
:
"Error"
,
88
"message"
:
"extra `@` for lambda arg"
,
89
},
90
{
91
"sname"
:
"parse-operator-noassoc"
,
92
"cname"
:
"OperatorNotAssociative"
,
93
"severity"
:
"Error"
,
94
"message"
:
"operator is non-associative"
,
95
},
96
{
97
"sname"
:
"let-dynamic"
,
98
"cname"
:
"LetDynamic"
,
99
"severity"
:
"Error"
,
100
"message"
:
"dynamic attributes are not allowed in let ... in ... expression"
,
101
},
102
{
103
"sname"
:
"empty-inherit"
,
104
"cname"
:
"EmptyInherit"
,
105
"severity"
:
"Warning"
,
106
"message"
:
"empty inherit expression"
,
107
},
108
{
109
"sname"
:
"or-identifier"
,
110
"cname"
:
"OrIdentifier"
,
111
"severity"
:
"Warning"
,
112
"message"
:
"keyword `or` used as an identifier"
,
113
},
114
{
115
"sname"
:
"deprecated-url-literal"
,
116
"cname"
:
"DeprecatedURL"
,
117
"severity"
:
"Warning"
,
118
"message"
:
"URL literal is deprecated"
,
119
},
120
{
121
"sname"
:
"deprecated-let"
,
122
"cname"
:
"DeprecatedLet"
,
123
"severity"
:
"Warning"
,
124
"message"
:
"using deprecated `let' syntactic sugar `let {{..., body = ...}}' -> (rec {{..., body = ...}}).body'"
,
125
},
126
{
127
"sname"
:
"path-trailing-slash"
,
128
"cname"
:
"PathTrailingSlash"
,
129
"severity"
:
"Fatal"
,
130
"message"
:
"path has a trailing slash"
,
131
},
132
{
133
"sname"
:
"merge-diff-rec"
,
134
"cname"
:
"MergeDiffRec"
,
135
"severity"
:
"Warning"
,
136
"message"
:
"merging two attributes with different `rec` modifiers, the latter will be implicitly ignored"
,
137
},
138
{
139
"sname"
:
"sema-duplicated-attrname"
,
140
"cname"
:
"DuplicatedAttrName"
,
141
"severity"
:
"Error"
,
142
"message"
:
"duplicated attrname `{}`"
,
143
},
144
{
145
"sname"
:
"sema-dynamic-inherit"
,
146
"cname"
:
"DynamicInherit"
,
147
"severity"
:
"Error"
,
148
"message"
:
"dynamic attributes are not allowed in inherit"
,
149
},
150
{
151
"sname"
:
"sema-empty-formal"
,
152
"cname"
:
"EmptyFormal"
,
153
"severity"
:
"Error"
,
154
"message"
:
"empty formal"
,
155
},
156
{
157
"sname"
:
"sema-formal-missing-comma"
,
158
"cname"
:
"FormalMissingComma"
,
159
"severity"
:
"Error"
,
160
"message"
:
"missing `,` for lambda formal"
,
161
},
162
{
163
"sname"
:
"sema-formal-extra-ellipsis"
,
164
"cname"
:
"FormalExtraEllipsis"
,
165
"severity"
:
"Error"
,
166
"message"
:
"extra `...` for lambda formal"
,
167
},
168
{
169
"sname"
:
"sema-misplaced-ellipsis"
,
170
"cname"
:
"FormalMisplacedEllipsis"
,
171
"severity"
:
"Error"
,
172
"message"
:
"misplaced `...` for lambda formal"
,
173
},
174
{
175
"sname"
:
"sema-dup-formal"
,
176
"cname"
:
"DuplicatedFormal"
,
177
"severity"
:
"Error"
,
178
"message"
:
"duplicated function formal"
,
179
},
180
{
181
"sname"
:
"sema-dup-formal-arg"
,
182
"cname"
:
"DuplicatedFormalToArg"
,
183
"severity"
:
"Error"
,
184
"message"
:
"function argument duplicated to a function formal"
,
185
},
186
{
187
"sname"
:
"sema-undefined-variable"
,
188
"cname"
:
"UndefinedVariable"
,
189
"severity"
:
"Error"
,
190
"message"
:
"undefined variable `{}`"
,
191
},
192
{
193
"sname"
:
"sema-unused-def-let"
,
194
"cname"
:
"UnusedDefLet"
,
195
"severity"
:
"Warning"
,
196
"message"
:
"definition `{}` in let-expression is not used"
,
197
},
198
{
199
"sname"
:
"sema-unused-def-lambda-noarg-formal"
,
200
"cname"
:
"UnusedDefLambdaNoArg_Formal"
,
201
"severity"
:
"Warning"
,
202
"message"
:
"attribute `{}` of argument is not used"
,
203
},
204
{
205
"sname"
:
"sema-unused-def-lambda-witharg-formal"
,
206
"cname"
:
"UnusedDefLambdaWithArg_Formal"
,
207
"severity"
:
"Hint"
,
208
"message"
:
"attribute `{}` of `@`-pattern argument is not used, but may be referenced from the argument"
,
209
},
210
{
211
"sname"
:
"sema-unused-def-lambda-witharg-arg"
,
212
"cname"
:
"UnusedDefLambdaWithArg_Arg"
,
213
"severity"
:
"Warning"
,
214
"message"
:
"argument `{}` in `@`-pattern is not used"
,
215
},
216
{
217
"sname"
:
"sema-extra-rec"
,
218
"cname"
:
"ExtraRecursive"
,
219
"severity"
:
"Warning"
,
220
"message"
:
"attrset is not necessary to be `rec`ursive"
,
221
},
222
{
223
"sname"
:
"sema-extra-with"
,
224
"cname"
:
"ExtraWith"
,
225
"severity"
:
"Warning"
,
226
"message"
:
"unused `with` expression"
,
227
},
228
]
diagnostic.Diagnostic
Definition
diagnostic.py:4
Generated by
1.12.0