Skip to content

Commit

Permalink
terraform: pass -chdir= to terraform command (#709)
Browse files Browse the repository at this point in the history
This ensures `terraform validate` is aware of `.terraform/` and does not
report false positives for missing  (uninstalled) modules.

More information in comment on PR that originally changed that:
#694 (comment).
  • Loading branch information
gegoune authored Jan 5, 2025
1 parent 1fea92f commit 0f43320
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/lint/linters/terraform_validate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ local terraform_severity_to_diagnostic_severity = {
return function()
return {
cmd = 'terraform',
args = { 'validate', '-json', vim.fn.fnamemodify(vim.api.nvim_buf_get_name(0), ':.:h') },
args = { '-chdir=' .. vim.fn.fnamemodify(vim.api.nvim_buf_get_name(0), ':.:h'), 'validate', '-json' },
append_fname = false,
stdin = false,
stream = 'both',
Expand Down

0 comments on commit 0f43320

Please sign in to comment.