Commit c1db8c8
committed
Ruleset: wire in
This commit adds a mechanism to handle errors encountered while loading a ruleset in a more user-friendly manner.
* Errors and notices aimed at end-users and ruleset maintainers will be collected while processing the ruleset.
* Only once the complete processing of the ruleset is finished, will all errors/notices be displayed.
This prevents "one error hiding behind another".
* If there are only notices (deprecations/notices/warnings), these will not display when running `-e` (explain), `-q` (quiet mode) or `--generator=...` (documentation).
* Errors will always display and will hard exit out of the run with a non-zero exit code.
This implementation should be seen as an interim - "good enough for now" - solution, which can be iterated on in the future.
I can imagine a more code-base wide solution at some later point in time, but that should not block this initial improvement.
As the current implementation doesn't change the public API (the only new methods are `private`), it should be feasible to transform the current solution to whatever form a future solution will take without breaking changes.
Includes tests covering the new functionality.MessageCollector
1 parent 581eef9 commit c1db8c8
File tree
2 files changed
+358
-5
lines changed- src
- tests/Core/Ruleset
2 files changed
+358
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
131 | 132 | | |
132 | 133 | | |
133 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
134 | 149 | | |
135 | 150 | | |
136 | 151 | | |
137 | 152 | | |
138 | 153 | | |
139 | 154 | | |
140 | 155 | | |
141 | | - | |
| 156 | + | |
142 | 157 | | |
143 | 158 | | |
144 | 159 | | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
149 | 165 | | |
150 | 166 | | |
151 | 167 | | |
| |||
242 | 258 | | |
243 | 259 | | |
244 | 260 | | |
| 261 | + | |
| 262 | + | |
245 | 263 | | |
246 | 264 | | |
247 | 265 | | |
| |||
461 | 479 | | |
462 | 480 | | |
463 | 481 | | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
464 | 511 | | |
465 | 512 | | |
466 | 513 | | |
| |||
0 commit comments