boltops-tools / terraspace

Terraspace: The Terraform Framework
https://terraspace.cloud
Apache License 2.0
678 stars 46 forks source link

cleanup terraspace fmt exit status return #313

Closed tongueroo closed 1 year ago

tongueroo commented 1 year ago

This is a 🙋‍♂️ feature or enhancement.

Summary

Some refactoring/cleanup of #308

Context

related #308

How to Test

  1. write some malform terraform code and then run terraspace fmt and check the exit status, echo $? . It looks like terraform fmt returns 2 and terraspace passes that back up to terraspace fmt
  2. write some good terraform code and then run terraspace fmt and check the exit status, echo $?. That returns 0.

Version Changes

Patch

alexjfisher commented 1 year ago

@tongueroo Are you sure this is correct? I was looking at this code with the intention of adding a --check option, but couldn't understand how exit status was being tracked. If there are multiple directories, some with errors, some without, doesn't the exit status of the 'last' directory win?

tongueroo commented 1 year ago

Fixed in https://github.com/boltops-tools/terraspace/commit/352e639ac09eabfa7575c8b0f061bc6176eae374 Fix release in terraspace 2.2.8

Thanks so much again for catching this and pointing it out!