Make code more consistent

This commit is contained in:
w0rp 2017-04-15 12:52:08 +01:00
parent c9a5d9845b
commit cab68cba25
13 changed files with 184 additions and 183 deletions

View File

@ -1,8 +1,7 @@
" Author: Lucas Kolstad <lkolstad@uw.edu> " Author: Lucas Kolstad <lkolstad@uw.edu>
" Description: gcc linter for asm files " Description: gcc linter for asm files
let g:ale_asm_gcc_options = let g:ale_asm_gcc_options = get(g:, 'ale_asm_gcc_options', '-Wall')
\ get(g:, 'ale_asm_gcc_options', '-Wall')
function! ale_linters#asm#gcc#GetCommand(buffer) abort function! ale_linters#asm#gcc#GetCommand(buffer) abort
return 'gcc -x assembler -fsyntax-only ' return 'gcc -x assembler -fsyntax-only '

View File

@ -48,4 +48,3 @@ call ale#linter#Define('chef', {
\ 'command_callback': 'ale_linters#chef#foodcritic#GetCommand', \ 'command_callback': 'ale_linters#chef#foodcritic#GetCommand',
\ 'callback': 'ale_linters#chef#foodcritic#Handle', \ 'callback': 'ale_linters#chef#foodcritic#Handle',
\}) \})

View File

@ -40,4 +40,5 @@ call ale#linter#Define('dockerfile', {
\ 'name': 'hadolint', \ 'name': 'hadolint',
\ 'executable': 'hadolint', \ 'executable': 'hadolint',
\ 'command': 'hadolint -', \ 'command': 'hadolint -',
\ 'callback': 'ale_linters#dockerfile#hadolint#Handle' }) \ 'callback': 'ale_linters#dockerfile#hadolint#Handle',
\})

View File

@ -39,4 +39,5 @@ call ale#linter#Define('elixir', {
\ 'name': 'credo', \ 'name': 'credo',
\ 'executable': 'mix', \ 'executable': 'mix',
\ 'command': 'mix credo suggest --format=flycheck --read-from-stdin %s', \ 'command': 'mix credo suggest --format=flycheck --read-from-stdin %s',
\ 'callback': 'ale_linters#elixir#credo#Handle' }) \ 'callback': 'ale_linters#elixir#credo#Handle',
\})

View File

@ -18,8 +18,11 @@ function! ale_linters#go#gobuild#GetCommand(buffer, goenv_output) abort
\ 'GOROOT': a:goenv_output[1], \ 'GOROOT': a:goenv_output[1],
\} \}
endif endif
" Run go test in local directory with relative path " Run go test in local directory with relative path
return 'GOPATH=' . s:go_env.GOPATH . ' cd ' . fnamemodify(bufname(a:buffer), ':.:h') . ' && go test -c -o /dev/null ./' return 'GOPATH=' . s:go_env.GOPATH
\ . ' cd ' . fnamemodify(bufname(a:buffer), ':.:h')
\ . ' && go test -c -o /dev/null ./'
endfunction endfunction
function! ale_linters#go#gobuild#Handler(buffer, lines) abort function! ale_linters#go#gobuild#Handler(buffer, lines) abort

View File

@ -27,7 +27,7 @@ endfunction
function! ale_linters#handlebars#embertemplatelint#Handle(buffer, lines) abort function! ale_linters#handlebars#embertemplatelint#Handle(buffer, lines) abort
if len(a:lines) == 0 if len(a:lines) == 0
return [] return []
end endif
let l:output = [] let l:output = []

View File

@ -51,7 +51,7 @@ function! ale_linters#nim#nimcheck#Handle(buffer, lines) abort
endfunction endfunction
function! ale_linters#nim#nimcheck#GetCommand(buffer) function! ale_linters#nim#nimcheck#GetCommand(buffer) abort
return 'nim check --path:' . fnameescape(fnamemodify(bufname(a:buffer), ':p:h')) . ' --threads:on --verbosity:0 --colors:off --listFullPaths %t' return 'nim check --path:' . fnameescape(fnamemodify(bufname(a:buffer), ':p:h')) . ' --threads:on --verbosity:0 --colors:off --listFullPaths %t'
endfunction endfunction

View File

@ -6,8 +6,7 @@ if !exists('g:merlin')
endif endif
function! ale_linters#ocaml#merlin#Handle(buffer, lines) abort function! ale_linters#ocaml#merlin#Handle(buffer, lines) abort
let l:errors = merlin#ErrorLocList() return merlin#ErrorLocList()
return l:errors
endfunction endfunction
call ale#linter#Define('ocaml', { call ale#linter#Define('ocaml', {
@ -16,4 +15,3 @@ call ale#linter#Define('ocaml', {
\ 'command': 'true', \ 'command': 'true',
\ 'callback': 'ale_linters#ocaml#merlin#Handle', \ 'callback': 'ale_linters#ocaml#merlin#Handle',
\}) \})

View File

@ -32,9 +32,9 @@ function! ale_linters#ruby#rubocop#Handle(buffer, lines) abort
endfunction endfunction
function! ale_linters#ruby#rubocop#GetCommand(buffer) abort function! ale_linters#ruby#rubocop#GetCommand(buffer) abort
return 'rubocop --format emacs --force-exclusion ' . return 'rubocop --format emacs --force-exclusion '
\ g:ale_ruby_rubocop_options . \ . g:ale_ruby_rubocop_options
\ ' --stdin ' . bufname(a:buffer) \ . ' --stdin ' . bufname(a:buffer)
endfunction endfunction
" Set this option to change Rubocop options. " Set this option to change Rubocop options.