Commit 454b25e
committed
fix: recognize .env filename, preserve null values and empty mappings
- cli.py: detect .env files by name (target_path.name == '.env') in
addition to suffix, so the conventional dotfile without an extension
is not rejected as unsupported format.
- loader.py _flatten_nested: preserve None values (JSON/YAML null)
instead of converting to empty string, so fix can write back null
when the baseline specifies it.
- loader.py _flatten_nested: preserve empty dict values ({}) so
reconstruction does not silently drop unrelated empty mappings when
other keys in the same file need fixing.
- cli.py: add _json_null_handler for json.dumps to serialize preserved
None values as JSON null.
Addresses Codex review: cli.py:435 (P1), cli.py:349 (P1),
cli.py:387 (P1)1 parent 7e86bd6 commit 454b25e
2 files changed
Lines changed: 26 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
26 | 36 | | |
27 | 37 | | |
28 | 38 | | |
| |||
361 | 371 | | |
362 | 372 | | |
363 | 373 | | |
| 374 | + | |
| 375 | + | |
364 | 376 | | |
365 | 377 | | |
366 | 378 | | |
| |||
369 | 381 | | |
370 | 382 | | |
371 | 383 | | |
372 | | - | |
| 384 | + | |
373 | 385 | | |
374 | 386 | | |
375 | 387 | | |
376 | 388 | | |
377 | 389 | | |
378 | 390 | | |
| 391 | + | |
379 | 392 | | |
380 | 393 | | |
381 | 394 | | |
| |||
395 | 408 | | |
396 | 409 | | |
397 | 410 | | |
398 | | - | |
| 411 | + | |
399 | 412 | | |
400 | 413 | | |
401 | 414 | | |
| |||
432 | 445 | | |
433 | 446 | | |
434 | 447 | | |
435 | | - | |
| 448 | + | |
436 | 449 | | |
437 | 450 | | |
438 | 451 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
117 | 122 | | |
118 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
119 | 127 | | |
120 | 128 | | |
121 | 129 | | |
| |||
0 commit comments