Commit 71c553b
authored
Fix backward incompatibility issues released via KtLint 0.45.0 and 0.45.1 (#1442)
* Fix backward incompatibility issues released via KtLint 0.45.0 and 0.45.1.
* Deprecate data class 'Params' as it only provides the userData parameter
which prohibits API Consumers to split the '.editorconfig' properties
from the other user data.
* Deprecate function 'toExperimentalParams' to force API Consumers to
start using the 'ExperimentalParams'.
* In ExperimentalParams clarify that 'userData' should not contain any
'.editorconfig' properties. Now also a runtime error is thrown
whenever the lint/format methods are called and 'userData' contains
'.editorconfig' properties.
* Remove confusing TODO's about moving methods 'lint' and 'format' to
the 'ktlint-test' module.
* Update deprecation messages to clarify intention.
* The 'lint' and 'format' methods in module 'ktlint-core' no longer
call the 'VisitorProvider' with parameter 'isUnitTestContext'
enabled. API Consumers call these methods with production code
for which this parameter should be disabled.
* The RuleExtension calls the 'lint' and 'format' methods but do
provide a VisitorProvider for which the parameter
'isUnitTestContext' is enabled.
* Deprecate the 'format' which accepted the 'ExperimentalParams'
and 'Iterable<RuleSet>' while the latter is already included
in the first.
* Add new 'format' method which accepts 'ExperimentalParams' and
'VisitorProvider' only.
* Move 'EditorConfigOverride' from 'ktlint-test' to 'ktlint-core'
Closes #14341 parent f5cfce3 commit 71c553b
19 files changed
Lines changed: 840 additions & 79 deletions
File tree
- ktlint-core/src
- main/kotlin/com/pinterest/ktlint/core
- api
- internal
- test/kotlin/com/pinterest/ktlint/core
- internal
- ktlint-ruleset-experimental/src/test/kotlin/com/pinterest/ktlint/ruleset/experimental
- ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard
- importordering
- ktlint-test/src/main/kotlin/com/pinterest/ktlint/test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
Lines changed: 66 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
3 | 6 | | |
4 | 7 | | |
5 | 8 | | |
6 | 9 | | |
7 | 10 | | |
8 | 11 | | |
9 | | - | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
62 | 68 | | |
63 | 69 | | |
64 | 70 | | |
| |||
74 | 80 | | |
75 | 81 | | |
76 | 82 | | |
77 | | - | |
| 83 | + | |
78 | 84 | | |
79 | 85 | | |
80 | 86 | | |
| |||
100 | 106 | | |
101 | 107 | | |
102 | 108 | | |
103 | | - | |
| 109 | + | |
104 | 110 | | |
105 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
106 | 140 | | |
107 | 141 | | |
108 | 142 | | |
| |||
118 | 152 | | |
119 | 153 | | |
120 | 154 | | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
121 | 159 | | |
122 | 160 | | |
123 | 161 | | |
| |||
137 | 175 | | |
138 | 176 | | |
139 | 177 | | |
140 | | - | |
141 | | - | |
142 | 178 | | |
143 | | - | |
| 179 | + | |
144 | 180 | | |
145 | 181 | | |
146 | 182 | | |
| |||
153 | 189 | | |
154 | 190 | | |
155 | 191 | | |
156 | | - | |
157 | | - | |
| 192 | + | |
158 | 193 | | |
159 | 194 | | |
160 | 195 | | |
| |||
165 | 200 | | |
166 | 201 | | |
167 | 202 | | |
168 | | - | |
169 | | - | |
170 | 203 | | |
171 | 204 | | |
172 | 205 | | |
| |||
308 | 341 | | |
309 | 342 | | |
310 | 343 | | |
311 | | - | |
312 | | - | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
313 | 348 | | |
314 | 349 | | |
315 | 350 | | |
| |||
321 | 356 | | |
322 | 357 | | |
323 | 358 | | |
324 | | - | |
325 | | - | |
| 359 | + | |
326 | 360 | | |
327 | 361 | | |
328 | 362 | | |
| |||
333 | 367 | | |
334 | 368 | | |
335 | 369 | | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
336 | 376 | | |
337 | 377 | | |
338 | 378 | | |
339 | 379 | | |
340 | 380 | | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
341 | 391 | | |
342 | 392 | | |
343 | 393 | | |
| |||
347 | 397 | | |
348 | 398 | | |
349 | 399 | | |
350 | | - | |
| 400 | + | |
351 | 401 | | |
352 | 402 | | |
353 | 403 | | |
| |||
378 | 428 | | |
379 | 429 | | |
380 | 430 | | |
381 | | - | |
| 431 | + | |
382 | 432 | | |
383 | 433 | | |
384 | 434 | | |
| |||
Lines changed: 13 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
12 | 16 | | |
13 | 17 | | |
14 | 18 | | |
| |||
22 | 26 | | |
23 | 27 | | |
24 | 28 | | |
25 | | - | |
26 | | - | |
| 29 | + | |
27 | 30 | | |
28 | 31 | | |
29 | 32 | | |
| |||
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
43 | | - | |
44 | | - | |
| 46 | + | |
| 47 | + | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
| |||
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
203 | 210 | | |
204 | 211 | | |
205 | 212 | | |
| |||
Lines changed: 19 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
26 | 32 | | |
27 | 33 | | |
28 | 34 | | |
| |||
48 | 54 | | |
49 | 55 | | |
50 | 56 | | |
51 | | - | |
| 57 | + | |
52 | 58 | | |
53 | 59 | | |
54 | 60 | | |
| |||
60 | 66 | | |
61 | 67 | | |
62 | 68 | | |
63 | | - | |
| 69 | + | |
64 | 70 | | |
65 | 71 | | |
66 | 72 | | |
67 | 73 | | |
68 | 74 | | |
69 | | - | |
| 75 | + | |
| 76 | + | |
70 | 77 | | |
71 | 78 | | |
72 | 79 | | |
| |||
99 | 106 | | |
100 | 107 | | |
101 | 108 | | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
109 | 118 | | |
110 | 119 | | |
111 | 120 | | |
| |||
0 commit comments