github oocx/tfplan2md v1.18.1

18 hours ago

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!) and ParseAsync(null!) now throw the documented TerraformPlanParseException instead of ArgumentNullException. 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 throws CliParseException with 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 inside tags where it belongs (fixing FormatDiff output like`value``).

  • Principal mapper performance: Both GetPrincipalName overloads now check IsNullOrWhiteSpace before calling GetName, avoiding unnecessary dictionary lookups on invalid input.

  • Dead code elimination: Removed redundant ternary expression return name is not null ? name : null in ResourceSummaryBuilder.BuildDeleteSummary (simplified to return 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

Don't miss a new tfplan2md release

NewReleases is sending notifications on new releases.