Set an option for turning Vint style issues on or off.

This commit is contained in:
w0rp 2016-10-11 13:20:56 +01:00
parent 0fa730aecf
commit 38dcf30045
2 changed files with 34 additions and 11 deletions

View File

@ -7,11 +7,20 @@ endif
let g:loaded_ale_linters_vim_vint = 1 let g:loaded_ale_linters_vim_vint = 1
" This flag can be used to change enable/disable style issues.
let g:ale_vim_vint_show_style_issues =
\ get(g:, 'ale_vim_vint_show_style_issues', 1)
let s:warning_flag = g:ale_vim_vint_show_style_issues ? '-s' : '-w'
let s:format = '-f "{file_path}:{line_number}:{column_number}: {severity}: {description} (see {reference})"' let s:format = '-f "{file_path}:{line_number}:{column_number}: {severity}: {description} (see {reference})"'
call ale#linter#Define('vim', { call ale#linter#Define('vim', {
\ 'name': 'vint', \ 'name': 'vint',
\ 'executable': 'vint', \ 'executable': 'vint',
\ 'command': g:ale#util#stdin_wrapper . ' .vim vint -w --no-color ' . s:format, \ 'command': g:ale#util#stdin_wrapper
\ . ' .vim vint '
\ . s:warning_flag
\ . ' --no-color '
\ . s:format,
\ 'callback': 'ale#handlers#HandleGCCFormat', \ 'callback': 'ale#handlers#HandleGCCFormat',
\}) \})

View File

@ -10,15 +10,16 @@ CONTENTS *ale-contents*
2. Supported Languages & Tools................|ale-support| 2. Supported Languages & Tools................|ale-support|
3. Global Options.............................|ale-options| 3. Global Options.............................|ale-options|
4. Linter Specific Options....................|ale-linter-options| 4. Linter Specific Options....................|ale-linter-options|
4.1. eslint.................................|ale-linter-options-eslint| 4.1. eslint................................|ale-linter-options-eslint|
4.2. jshint.................................|ale-linter-options-jshint| 4.2. jshint................................|ale-linter-options-jshint|
4.3. phpcs..................................|ale-linter-options-phpcs| 4.3. phpcs.................................|ale-linter-options-phpcs|
4.4. html-tidy..............................|ale-linter-options-html-tidy| 4.4. html-tidy.............................|ale-linter-options-html-tidy|
4.5. c-gcc..................................|ale-linter-options-c-gcc| 4.5. c-gcc.................................|ale-linter-options-c-gcc|
4.6. cpp-gcc................................|ale-linter-options-cpp-gcc| 4.6. cpp-gcc...............................|ale-linter-options-cpp-gcc|
4.7. fortran-gcc............................|ale-linter-options-fortran-gcc| 4.7. fortran-gcc...........................|ale-linter-options-fortran-gcc|
4.8. shell..................................|ale-linter-options-shell| 4.8. shell.................................|ale-linter-options-shell|
4.9. shellcheck.............................|ale-linter-options-shellcheck| 4.9. shellcheck............................|ale-linter-options-shellcheck|
4.10. vint..................................|ale-linter-options-vint|
5. API........................................|ale-api| 5. API........................................|ale-api|
6. Contact....................................|ale-contact| 6. Contact....................................|ale-contact|
@ -432,7 +433,7 @@ g:ale_linters_sh_shell_default_shell *g:ale_linters_sh_shell_default_shell*
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
4.9. shellchek *ale-linter-options-shellcheck* 4.9. shellcheck *ale-linter-options-shellcheck*
g:ale_linters_sh_shellckeck_exclusions *g:ale_linters_sh_shellckeck_exclusions* g:ale_linters_sh_shellckeck_exclusions *g:ale_linters_sh_shellckeck_exclusions*
@ -442,6 +443,19 @@ g:ale_linters_sh_shellckeck_exclusions *g:ale_linters_sh_shellckeck_exclusions*
Set this variable to exclude test(s) for shellcheck (-e/--exclude option). Set this variable to exclude test(s) for shellcheck (-e/--exclude option).
-------------------------------------------------------------------------------
4.10. vint *ale-linter-options-vint*
g:ale_vim_vint_show_style_issues *g:ale_vim_vint_show_style_issues*
Type: |Number|
Default: `1`
This variable will enable/disable style issues for Vint. When this option
is disabled, only warnings and errors which are not purely style issues
will be reported.
=============================================================================== ===============================================================================
5. API *ale-api* 5. API *ale-api*