Commit 86a8c14
committed
(PUP-12026) Change non-literal type check to deprecation warning
Previously, the ILLEGAL_NONLITERAL_PARAMETER_TYPE issue was under control of the
`strict` setting. Since `strict` defaults to `error`, `puppet parser validate`
logged an error message and exited non-zero for non-literal types such as
`Integer[0, 60*24]`
In order to gradually phase out non-literal parameter types, this commit changes
the issue to be a deprecation. When parsing and validating puppet code a warning
is now logged, regardless of `strict`, and it exits with 0:
Warning: The parameter '$i' must be a literal type, not a ...
(file: /etc/puppetlabs/code/environments/production/manifests/site.pp,
line: 2, column: 19)
As a result of this change, the ClassInfoService error does not include locator
information in the error hash:
{"error":"The parmeter '$i' is invalid: The expression <60*24> is not a valid type specification"}
But the location information is included in the deprecation warning logged on
the server.
All language deprecation warnings can already be disabled via the
`disable_warnings=deprecations` setting. In a future major release, the
non-literal type issue will be converted to an error.
This pattern follows how we handled the most recent language checks:
ILLEGAL_DEFINITION_LOCATION: see 6e7835b, 44c4ea0 and 81e61de
ILLEGAL_TOP_CONSTRUCT_LOCATION: see 5661509 and 81e61de1 parent 1a53bf7 commit 86a8c14
File tree
6 files changed
+26
-31
lines changed- lib/puppet
- info_service
- pops/validation
- spec
- lib/puppet_spec
- unit
- pops
- evaluator
- validator
6 files changed
+26
-31
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
92 | 92 | | |
93 | | - | |
94 | | - | |
95 | | - | |
| 93 | + | |
| 94 | + | |
96 | 95 | | |
97 | 96 | | |
98 | 97 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
17 | 23 | | |
18 | 24 | | |
19 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
518 | 518 | | |
519 | 519 | | |
520 | 520 | | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
521 | 524 | | |
522 | 525 | | |
523 | 526 | | |
524 | | - | |
| 527 | + | |
525 | 528 | | |
526 | | - | |
| 529 | + | |
527 | 530 | | |
528 | 531 | | |
529 | 532 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | 214 | | |
222 | 215 | | |
223 | 216 | | |
| |||
269 | 262 | | |
270 | 263 | | |
271 | 264 | | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | 265 | | |
280 | 266 | | |
281 | 267 | | |
| |||
306 | 292 | | |
307 | 293 | | |
308 | 294 | | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | 295 | | |
317 | 296 | | |
318 | 297 | | |
| |||
343 | 322 | | |
344 | 323 | | |
345 | 324 | | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
346 | 333 | | |
347 | 334 | | |
348 | 335 | | |
| |||
0 commit comments