From 884109c6f4591ad057465b02fddae62c7be92c7f Mon Sep 17 00:00:00 2001 From: w0rp Date: Tue, 21 Feb 2017 11:50:59 +0000 Subject: [PATCH] Add an extra custom check for using endif instead of end, etc. --- autoload/ale/handlers.vim | 3 ++- custom-checks | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/autoload/ale/handlers.vim b/autoload/ale/handlers.vim index 93282a4b..96be427f 100644 --- a/autoload/ale/handlers.vim +++ b/autoload/ale/handlers.vim @@ -258,7 +258,8 @@ function! ale#handlers#HandleGhcFormat(buffer, lines) abort else let l:type = '' let l:text = l:match[3] - end + endif + let l:type = l:type ==# '' ? 'E' : toupper(l:type[0]) call add(l:output, { diff --git a/custom-checks b/custom-checks index 798049e3..0a1c96f7 100755 --- a/custom-checks +++ b/custom-checks @@ -67,6 +67,12 @@ check_line() { if [[ "$line" =~ ' '+$ ]]; then output_error 'Trailing whitespace' fi + + endif_regex='^ * end?i? *$' + + if [[ "$line" =~ $endif_regex ]]; then + output_error 'Write endif, not en, end, or endi' + fi } # Loop through all of the vim files and keep track of the file line numbers.