diff options
author | w0rp <devw0rp@gmail.com> | 2017-02-21 11:50:59 +0000 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-02-21 11:50:59 +0000 |
commit | 884109c6f4591ad057465b02fddae62c7be92c7f (patch) | |
tree | 8250216949be98ab22f0566d0507575f072fe423 | |
parent | 3c4af280f03aed86a5ff99fc7a66984ec322b5cf (diff) | |
download | ale-884109c6f4591ad057465b02fddae62c7be92c7f.zip |
Add an extra custom check for using endif instead of end, etc.
-rw-r--r-- | autoload/ale/handlers.vim | 3 | ||||
-rwxr-xr-x | custom-checks | 6 |
2 files changed, 8 insertions, 1 deletions
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. |