terramate-io / terramate

Terramate CLI is an open-source Infrastructure as Code (IaC) Orchestration and Code Generation tool for Terraform, OpenTofu and Terragrunt.
https://terramate.io
Mozilla Public License 2.0
3.12k stars 86 forks source link

[BUG] terramate fmt --detailed-exit-code does not change files #1649

Closed cwe1ss closed 2 months ago

cwe1ss commented 2 months ago

Describe the bug Calling terramate fmt --detailed-exit-code does return status code 2 when a terramate file is incorrectly formatted, but it does not actually format the file.

To Reproduce

Steps to reproduce the behavior:

  1. Change a terramate file in a way that it's incorrectly formatted (e.g. by including spaces)
  2. Run command terramate fmt --detailed-exit-code
  3. The exit code will be 2, but the file will not have changed

Expected behavior terramate fmt --detailed-exit-code should format the files so that it's consistent with terramate generate --detailed-exit-code.

Environment (please complete the following information):

Additional context Originally commented in https://github.com/terramate-io/terramate/issues/1312#issuecomment-1951797427

mariux commented 2 months ago

Thanks for catching this little regression here. We are going to fix the issue and send out a release asap. And apologies that we missed the comment in the original issue. Fixing now ;)

i4ki commented 2 months ago

Hi @cwe1ss

Sorry, I also missed the comment in the other issue.

We released v0.6.4 with the fix! Thanks for reporting it.