Commit 762e57f
authored
refactor(cli): stack/security diff no longer prints directly to a stream (#264)
part of https://github.com/orgs/aws/projects/257
this refactor removes direct prints to `stderr` or `stdout` for the diff
cli command. the diff result will instead be printed through the global
`CliIoHost`.
the diff format is determined by the `Formatter` class, which takes in a
`stream` that previously was `stdout` (or `stderr`). now, we are sending
our own stream into `Formatter`, capturing what was previously
immediately printed and instead returning it as a string. we then print
the resulting string through `CliIoHost`. it should have no functional
change to how the diff cli works today.
this effort will help support diff in the toolkit lib because it allows
the `IoHost` governance of the diff print.
as this is a pure refactor, successful existing tests is enough to
ensure that this works.
---
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache-2.0 license1 parent ee0d87d commit 762e57f
File tree
5 files changed
+262
-229
lines changed- packages/aws-cdk
- lib
- api/deployments
- cli
- commands
- test/commands
5 files changed
+262
-229
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
144 | 143 | | |
145 | 144 | | |
146 | 145 | | |
| |||
224 | 223 | | |
225 | 224 | | |
226 | 225 | | |
227 | | - | |
| 226 | + | |
228 | 227 | | |
229 | | - | |
| 228 | + | |
230 | 229 | | |
231 | 230 | | |
232 | 231 | | |
| |||
242 | 241 | | |
243 | 242 | | |
244 | 243 | | |
245 | | - | |
| 244 | + | |
246 | 245 | | |
247 | | - | |
| 246 | + | |
248 | 247 | | |
249 | 248 | | |
250 | 249 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
181 | 180 | | |
182 | 181 | | |
183 | 182 | | |
| |||
196 | 195 | | |
197 | 196 | | |
198 | 197 | | |
199 | | - | |
200 | | - | |
201 | | - | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
202 | 223 | | |
203 | 224 | | |
204 | 225 | | |
| |||
231 | 252 | | |
232 | 253 | | |
233 | 254 | | |
234 | | - | |
| 255 | + | |
235 | 256 | | |
236 | 257 | | |
237 | 258 | | |
| |||
247 | 268 | | |
248 | 269 | | |
249 | 270 | | |
250 | | - | |
251 | 271 | | |
252 | 272 | | |
253 | 273 | | |
| |||
256 | 276 | | |
257 | 277 | | |
258 | 278 | | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
271 | 293 | | |
272 | 294 | | |
273 | 295 | | |
| |||
276 | 298 | | |
277 | 299 | | |
278 | 300 | | |
279 | | - | |
280 | 301 | | |
281 | 302 | | |
282 | | - | |
283 | | - | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
284 | 306 | | |
285 | 307 | | |
286 | 308 | | |
287 | | - | |
| 309 | + | |
288 | 310 | | |
289 | 311 | | |
290 | 312 | | |
| |||
401 | 423 | | |
402 | 424 | | |
403 | 425 | | |
404 | | - | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
405 | 429 | | |
406 | 430 | | |
407 | 431 | | |
| |||
1360 | 1384 | | |
1361 | 1385 | | |
1362 | 1386 | | |
1363 | | - | |
1364 | | - | |
1365 | | - | |
1366 | | - | |
1367 | | - | |
1368 | | - | |
1369 | | - | |
1370 | 1387 | | |
1371 | 1388 | | |
1372 | 1389 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
277 | | - | |
278 | 277 | | |
279 | 278 | | |
280 | 279 | | |
| |||
0 commit comments