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
Interesting. The provided directory gets two passes: Terraform loads the configuration, and tflint separately scans for annotations. The raw HCL bodies are also re-parsed from the source cache so rules can do low level inspection if desired.
I think the most straightforward change here is to load stdin and put it in an in-memory afero.Fs as stdin.tf. That should minimize the amount of code changing.
I'm thinking about this now, but given that TFLint is moving towards a directory-oriented interface, I'm wondering if we should implement this feature.
Once this issue is marked as pending. Discussions are welcome.
In the original example of terrafmt, it seems like there'd need be substantial value in a more advanced wrapper than just gluing together with xargs, especially in GitHub Actions.
If TFLint supported stdin, it would have to use a generated filename like input.tf and would report ranges relative to that filename and its lines.
This is not especially helpful for users, who would instead want a GitHub error annotation that is reported on the actual source, e.g., in a Terraform code block in a Markdown file.
In some CI validation usecases, such as blocks in documentation, it could be useful to pipe a configuration to
tflint
onstdin
.For example:
terrafmt blocks --zero-terminated my_docs.md | xargs -0 -n1 tflint --format=json
(Null-terminated blocks in
terrafmt
are suggested in katbyte/terrafmt#24)The text was updated successfully, but these errors were encountered: