You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
terraform-docs always generates LF endings. When running terraform-docs --output-check when a README was downloaded from a VCS with CRLF line endings, this output check fails. This means that any post commit checks that run with CRLF checkouts cannot properly verify the output with --output-check, because the line endings are inconsistent with what terraform-docs is hardcoded to produce.
We are using terraform-docs on windows in a situation where having the files checked out with CRLF is preferable. We're configuring windows systems and that consistency in tooling is preferable over using linux runners for this one aspect of our tech stack.
How could terraform-docs help solve your problem?
Add a flag to use CRLF line endings in the output README. This will allow anyone facing as similar problem to specify the expected line endings for any VCS.
The text was updated successfully, but these errors were encountered:
Interesting issue. One that I came across before. The npm-ini package has a similar issue related to generating INI files (npm/ini@6a3cb38).
Their solution was to use define line endings based upon detecting of the OS, but allow the override if required.
Is that a "better" option? If you are on a Windows environment, it is pretty much a standard thing that the files will be made with CRLF, and so, having to set an option for the expected default behaviour would seem a bit odd.
As the binaries are built for different operating systems, is it acceptable to have the default value for line endings based upon the target OS?
I'm not a go expert, and so whilst this idea may be fine for npm-ini, it may not be "how things are done" in Go apps.
That would require that everyone executing terraform-docs does so from the same OS as well as having the same vcs client configurations, right? Any contributor for my terraform project who used windows when we're on *nix or vice-versa would generate docs that flip the line endings. Plus, you can only run terraform docs --output-check as part of your CI process with one OS, so flipping between them isn't nice either. And that's not really backward compatible, since however many windows clients would suddenly start using CRLF line endings with little explanation.
What problem are you facing?
terraform-docs always generates LF endings. When running
terraform-docs --output-check
when a README was downloaded from a VCS with CRLF line endings, this output check fails. This means that any post commit checks that run with CRLF checkouts cannot properly verify the output with --output-check, because the line endings are inconsistent with what terraform-docs is hardcoded to produce.We are using terraform-docs on windows in a situation where having the files checked out with CRLF is preferable. We're configuring windows systems and that consistency in tooling is preferable over using linux runners for this one aspect of our tech stack.
How could terraform-docs help solve your problem?
Add a flag to use CRLF line endings in the output README. This will allow anyone facing as similar problem to specify the expected line endings for any VCS.
The text was updated successfully, but these errors were encountered: