vim-lint

Lint plugin for vim
git clone https://git.ce9e.org/vim-lint.git

commit
36a870ed7afb5d311c662a86be32dfbe6644c91c
parent
7f70151cdb70da6e30bd69230f48e6daa3dad527
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2019-02-23 15:43
mv executablecheck to ftplugins

Diffstat

M autoload/lint.vim 20 ++------------------
M ftplugin/javascript_lint_jshint.vim 6 ++++--
M ftplugin/python_lint_flake8.vim 6 ++++--
M ftplugin/sh_lint_shellcheck.vim 6 ++++--

4 files changed, 14 insertions, 24 deletions


diff --git a/autoload/lint.vim b/autoload/lint.vim

@@ -42,25 +42,9 @@ function! s:PlaceMarkers(results)
   42    42     endfor
   43    43 endfunction
   44    44 
   45    -1 function s:CheckOptions()
   46    -1     if !exists('g:lint_prg')
   47    -1         echoerr 'No linter configured (g:lint_prg)'
   48    -1         return 0
   49    -1     elseif !exists('g:lint_format')
   50    -1         echoerr 'No format configured (g:lint_format)'
   51    -1         return 0
   52    -1     else
   53    -1         let l:executable = split(g:lint_prg)[0]
   54    -1         if !executable(l:executable)
   55    -1             echoerr 'Linter '.l:executable.' cannot be executed'
   56    -1             return 0
   57    -1         endif
   58    -1     endif
   59    -1     return 1
   60    -1 endfunction
   61    -1 
   62    45 function! lint#Lint()
   63    -1     if !s:CheckOptions()
   -1    46     if !exists('g:lint_prg') || !exists('g:lint_format')
   -1    47         echon 'No linter configured'
   64    48         return
   65    49     endif
   66    50     if &readonly == 0

diff --git a/ftplugin/javascript_lint_jshint.vim b/ftplugin/javascript_lint_jshint.vim

@@ -1,2 +1,4 @@
    1    -1 let g:lint_prg = 'jshint'
    2    -1 let g:lint_format = '%f: line %l\, col %c\, %m'
   -1     1 if executable('jshint')
   -1     2     let g:lint_prg = 'jshint'
   -1     3     let g:lint_format = '%f: line %l\, col %c\, %m'
   -1     4 endif

diff --git a/ftplugin/python_lint_flake8.vim b/ftplugin/python_lint_flake8.vim

@@ -1,2 +1,4 @@
    1    -1 let g:lint_prg = 'flake8'
    2    -1 let g:lint_format = '%f:%l:%c: %m,%f:%l: %m'
   -1     1 if executable('flake8')
   -1     2     let g:lint_prg = 'flake8'
   -1     3     let g:lint_format = '%f:%l:%c: %m,%f:%l: %m'
   -1     4 endif

diff --git a/ftplugin/sh_lint_shellcheck.vim b/ftplugin/sh_lint_shellcheck.vim

@@ -1,2 +1,4 @@
    1    -1 let g:lint_prg = 'shellcheck -f gcc'
    2    -1 let g:lint_format = '%f:%l:%c: %m'
   -1     1 if executable('shellcheck')
   -1     2     let g:lint_prg = 'shellcheck -f gcc'
   -1     3     let g:lint_format = '%f:%l:%c: %m'
   -1     4 endif