summaryrefslogtreecommitdiff
path: root/ale_linters
diff options
context:
space:
mode:
authorMichaƂ Padula <michal.padula@outlook.com>2022-05-16 17:00:34 +0200
committerGitHub <noreply@github.com>2022-05-17 00:00:34 +0900
commite343148e80f53073e2d9b2d7a421adec5e06ee66 (patch)
tree0da729c9da456d5ddbf89b0a67eb533a223334e8 /ale_linters
parent429f5a14474c21392f5d5f863f4a98e04a7e02d0 (diff)
downloadale-e343148e80f53073e2d9b2d7a421adec5e06ee66.zip
Fallback to summary field if detail exists but is empty in terraform linter (#4157)
* Fallback to summary field if detail exists but is empty in terraform linter * Add test * Update terraform.vim * remove whitespaces
Diffstat (limited to 'ale_linters')
-rw-r--r--ale_linters/terraform/terraform.vim8
1 files changed, 7 insertions, 1 deletions
diff --git a/ale_linters/terraform/terraform.vim b/ale_linters/terraform/terraform.vim
index cf134460..1beb8501 100644
--- a/ale_linters/terraform/terraform.vim
+++ b/ale_linters/terraform/terraform.vim
@@ -21,7 +21,13 @@ function! ale_linters#terraform#terraform#GetType(severity) abort
endfunction
function! ale_linters#terraform#terraform#GetDetail(error) abort
- return get(a:error, 'detail', get(a:error, 'summary', ''))
+ let l:detail = get(a:error, 'detail', '')
+
+ if strlen(l:detail) > 0
+ return l:detail
+ else
+ return get(a:error, 'summary', '')
+ endif
endfunction
function! ale_linters#terraform#terraform#Handle(buffer, lines) abort