Bug Fixes Release
This release fixes 5 bugs discovered during systematic code review: uncaught exception types, silent data loss, misordered guard clauses, and dead code. All fixes include regression tests.
🐛 Bug fixes
-
Parser exception handling:
TerraformPlanParser.Parse(null!)andParseAsync(null!)now throw the documentedTerraformPlanParseExceptioninstead ofArgumentNullException. Added explicit null guards with clear error messages for both methods. -
CLI argument validation: Multiple positional arguments (
tfplan2md a.json b.json) no longer silently overwrite the input file. The CLI now throwsCliParseExceptionwith message "Unexpected argument: {arg}. Only one input file can be specified." -
Code formatting edge case: Fixed escaped backtick removal (
\`` → empty) that was stripping content from plain text values. The stripping now only occurs insidetags where it belongs (fixing FormatDiff output like`value``).Principal mapper performance: Both
GetPrincipalNameoverloads now checkIsNullOrWhiteSpacebefore callingGetName, avoiding unnecessary dictionary lookups on invalid input.Dead code elimination: Removed redundant ternary expression
return name is not null ? name : nullinResourceSummaryBuilder.BuildDeleteSummary(simplified toreturn name).
🔗 Commits
93df991 fix: CLI parser now rejects multiple positional arguments
aaa7435 fix: escaped backtick stripping only applies to HTML code tags
19b2be0 fix: remove redundant ternary in ResourceSummaryBuilder
252ac13 fix: parser throws TerraformPlanParseException on null input
c466bb4 fix: principal mapper checks null/whitespace before dictionary lookup
76a802a test: add CLI parser test for multiple positional arguments
e1226ce test: add comprehensive tests for code formatting helpers
05889df test: add ResourceSummaryBuilder test for null display name handling
8de2c99 test: add TerraformPlanParser null stream test
ec1dbc4 test: add TerraformPlanParser null input test
8e60a0b test: add PrincipalMapper tests for null/empty/whitespace input handling