From 62904d39ee5dd89d14ff809cc505f7492cdddf4a Mon Sep 17 00:00:00 2001 From: w0rp Date: Sun, 19 Nov 2017 13:37:56 +0000 Subject: [PATCH] #852 - Capture error codes for tflint --- ale_linters/terraform/tflint.vim | 1 + test/handler/test_tflint_handler.vader | 3 +++ 2 files changed, 4 insertions(+) diff --git a/ale_linters/terraform/tflint.vim b/ale_linters/terraform/tflint.vim index 894be22d..93966ff3 100644 --- a/ale_linters/terraform/tflint.vim +++ b/ale_linters/terraform/tflint.vim @@ -23,6 +23,7 @@ function! ale_linters#terraform#tflint#Handle(buffer, lines) abort \ 'lnum': l:error.line, \ 'text': l:error.message, \ 'type': l:type, + \ 'code': l:error.detector, \}) endfor diff --git a/test/handler/test_tflint_handler.vader b/test/handler/test_tflint_handler.vader index 95671b8a..099d0926 100644 --- a/test/handler/test_tflint_handler.vader +++ b/test/handler/test_tflint_handler.vader @@ -10,16 +10,19 @@ Execute(The tflint handler should parse items correctly): \ { \ 'lnum': 12, \ 'text': 'be warned, traveller', + \ 'code': 'aws_db_instance_readable_password', \ 'type': 'W', \ }, \ { \ 'lnum': 9, \ 'text': 'error message', + \ 'code': 'aws_elasticache_cluster_invalid_type', \ 'type': 'E', \ }, \ { \ 'lnum': 5, \ 'text': 'just so ya know', + \ 'code': 'aws_instance_not_specified_iam_profile', \ 'type': 'I', \ }, \ ],