Only enable swiftlint checker with config file

This means that if you just have swiftlint installed, it won't be
enabled automatically. You either need a `.swiftlint.yml` or you need to
set `g:syntastic_swift_swiftlint_use_defaults` to 1 in your vimrc.
This commit is contained in:
Keith Smiley
2016-06-04 15:43:18 -07:00
parent 3cd476dc68
commit b73c0ba24d

View File

@@ -6,6 +6,15 @@ let g:loaded_syntastic_swift_swiftlint_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_swift_swiftlint_IsAvailable() dict
if !executable(self.getExec())
return 0
endif
return get(g:, 'syntastic_swift_swiftlint_use_defaults', 0)
\ || filereadable('.swiftlint.yml')
endfunction
function! SyntaxCheckers_swift_swiftlint_GetLocList() dict
let env_vars = 'SCRIPT_INPUT_FILE_COUNT=1 SCRIPT_INPUT_FILE_0=' . syntastic#util#shexpand('%:p')
let makeprg = self.makeprgBuild({