mirror of
https://github.com/keith/swift.vim.git
synced 2025-12-22 12:14:13 +01:00
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:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user