Open
Description
This is part of hashicorp/vscode-terraform#635
Use-cases
(Follow up on #27)
The user can run terraform validate
since 0.11 as a command (if dedicated clients such as VS Code extension choose to integrate) and can also run this on didSave
automatically.
The integration of linters requires similar work and could be implemented as a command, which can be executed on didSave
as well.
Proposal
- Start with the integration of a single linter
tflint
- Make use of the settings introduced in Add linter configuration to initialization options #855
- Implement
tflint
as an executable command, which calls thetflint
binary, similar tovalidate
terraform-ls/internal/langserver/handlers/command/validate.go
Lines 57 to 65 in e7abb2f
- Inspect the output
tflint --json
and how to store it in the diagnostics memdb table introduced in Store diagnostics in memdb table #856 - Add
tflint
to thedidSave
handler, similar tovalidate
terraform-ls/internal/langserver/handlers/did_save.go
Lines 18 to 29 in e7abb2f