Looking again at your original message, perhaps a reasonable compromise in your case would be to apply terraform fmt -recursive
only to the modules
directory, so that it will not enter the node_modules
directory.
I want to be clear that changing terraform fmt
's selection behavior is unlikely to be a priority due to the relatively low impact of that compared to other work, but if you like you could create an enhancement request issue in the Terraform repository so it can participate in the same prioritization process as other enhancement requests.
Thanks!