From 4884e33f8b2591cce635e171e776368184def406 Mon Sep 17 00:00:00 2001 From: aurieh Date: Tue, 24 Oct 2017 15:03:47 +0300 Subject: [PATCH 1/4] Add checkmake (resolves #866) --- ale_linters/make/checkmake.vim | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 ale_linters/make/checkmake.vim diff --git a/ale_linters/make/checkmake.vim b/ale_linters/make/checkmake.vim new file mode 100644 index 00000000..3dd8cc91 --- /dev/null +++ b/ale_linters/make/checkmake.vim @@ -0,0 +1,24 @@ +" Author: aurieh - https://github.com/aurieh + +function! ale_linters#make#checkmake#Handle(buffer, lines) abort + let l:pattern = '\v^(\d+):(.+):(.+)$' + let l:output = [] + + for l:match in ale#util#GetMatches(a:lines, l:pattern) + let l:text = l:match[2] . ': ' . l:match[3] + call add(l:output, { + \ 'bufnr': a:buffer, + \ 'lnum': l:match[1] + 0, + \ 'type': 'E', + \ 'text': l:text, + \}) + endfor + return l:output +endfunction + +call ale#linter#Define('make', { +\ 'name': 'checkmake', +\ 'executable': 'checkmake', +\ 'command': 'checkmake %s --format="{{.LineNumber}}:{{.Rule}}:{{.Violation}}"', +\ 'callback': 'ale_linters#make#checkmake#Handle', +\}) From f0a0aef33d0f023f60605823fcf47778726ce6e1 Mon Sep 17 00:00:00 2001 From: aurieh Date: Tue, 24 Oct 2017 15:09:56 +0300 Subject: [PATCH 2/4] Update doc/ale.txt & README.md --- README.md | 1 + doc/ale.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 89fd3809..b61817b9 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,7 @@ formatting. | LaTeX | [chktex](http://www.nongnu.org/chktex/), [lacheck](https://www.ctan.org/pkg/lacheck), [proselint](http://proselint.com/) | | LLVM | [llc](https://llvm.org/docs/CommandGuide/llc.html) | | Lua | [luacheck](https://github.com/mpeterv/luacheck) | +| Make | [checkmake](https://github.com/mrtazz/checkmake) | | Markdown | [mdl](https://github.com/mivok/markdownlint), [proselint](http://proselint.com/), [vale](https://github.com/ValeLint/vale), [remark-lint](https://github.com/wooorm/remark-lint) !! | | MATLAB | [mlint](https://www.mathworks.com/help/matlab/ref/mlint.html) | | Nim | [nim check](https://nim-lang.org/docs/nimc.html) !! | diff --git a/doc/ale.txt b/doc/ale.txt index fb0b5a76..e32a03db 100644 --- a/doc/ale.txt +++ b/doc/ale.txt @@ -261,6 +261,7 @@ Notes: * LaTeX (tex): `chktex`, `lacheck`, `proselint` * LLVM: `llc` * Lua: `luacheck` +* Make: `checkmake` * Markdown: `mdl`, `proselint`, `vale`, `remark-lint` * MATLAB: `mlint` * Nim: `nim check`!! From b401772d23267f16070092d50c944872f74adff0 Mon Sep 17 00:00:00 2001 From: aurieh Date: Wed, 25 Oct 2017 00:39:54 +0300 Subject: [PATCH 3/4] Add Vader tests --- test/handler/test_checkmake_handler.vader | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 test/handler/test_checkmake_handler.vader diff --git a/test/handler/test_checkmake_handler.vader b/test/handler/test_checkmake_handler.vader new file mode 100644 index 00000000..61fe141a --- /dev/null +++ b/test/handler/test_checkmake_handler.vader @@ -0,0 +1,19 @@ +Execute(Parsing checkmake errors should work): + runtime ale_linters/make/checkmake.vim + silent file Makefile + + AssertEqual + \ [ + \ { + \ 'bufnr': 42, + \ 'lnum': 1, + \ 'type': 'E', + \ 'text': 'woops: an error has occurred', + \ } + \ ], + \ ale_linters#make#checkmake#Handle(42, [ + \ 'This shouldnt match', + \ '1:woops:an error has occurred', + \ ]) +After: + call ale#linter#Reset() From d644dc797f74e446c3301292107ffaf6ed9a6121 Mon Sep 17 00:00:00 2001 From: Su Shangjun Date: Tue, 24 Oct 2017 08:11:56 -0500 Subject: [PATCH 4/4] example for 'rcfile' on ale_python_pylint_options Two hyphens instead of one will enable the option `rcfile`. --- doc/ale-python.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ale-python.txt b/doc/ale-python.txt index a8d033e2..755094a3 100644 --- a/doc/ale-python.txt +++ b/doc/ale-python.txt @@ -174,7 +174,7 @@ g:ale_python_pylint_options *g:ale_python_pylint_options* Python 3, you may want to set > let g:ale_python_pylint_executable = 'python3' " or 'python' for Python 2 - let g:ale_python_pylint_options = '-rcfile /path/to/pylint.rc' + let g:ale_python_pylint_options = '--rcfile /path/to/pylint.rc' " The virtualenv detection needs to be disabled. let g:ale_python_pylint_use_global = 0