mirror of https://github.com/amix/vimrc.git
parent
d2d303593e
commit
e99e9e9c3e
@ -1,10 +1,21 @@ |
||||
" Author: neersighted <bjorn@neersighted.com> |
||||
" Description: golint for Go files |
||||
|
||||
call ale#Set('go_golint_executable', 'golint') |
||||
call ale#Set('go_golint_options', '') |
||||
|
||||
function! ale_linters#go#golint#GetCommand(buffer) abort |
||||
let l:options = ale#Var(a:buffer, 'go_golint_options') |
||||
|
||||
return '%e' |
||||
\ . (!empty(l:options) ? ' ' . l:options : '') |
||||
\ . ' %t' |
||||
endfunction |
||||
|
||||
call ale#linter#Define('go', { |
||||
\ 'name': 'golint', |
||||
\ 'output_stream': 'both', |
||||
\ 'executable': 'golint', |
||||
\ 'command': 'golint %t', |
||||
\ 'executable_callback': ale#VarFunc('go_golint_executable'), |
||||
\ 'command_callback': 'ale_linters#go#golint#GetCommand', |
||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning', |
||||
\}) |
||||
|
@ -1,9 +1,28 @@ |
||||
" Author: KabbAmine - https://github.com/KabbAmine, |
||||
" Ben Falconer <ben@falconers.me.uk> |
||||
" Author: sQVe - https://github.com/sQVe |
||||
|
||||
call ale#Set('sass_sasslint_executable', 'sass-lint') |
||||
call ale#Set('sass_sasslint_options', '') |
||||
call ale#Set('sass_sasslint_use_global', get(g:, 'ale_use_global_executables', 0)) |
||||
|
||||
function! ale_linters#sass#sasslint#GetExecutable(buffer) abort |
||||
return ale#node#FindExecutable(a:buffer, 'sass_sasslint', [ |
||||
\ 'node_modules/sass-lint/bin/sass-lint.js', |
||||
\ 'node_modules/.bin/sass-lint', |
||||
\]) |
||||
endfunction |
||||
|
||||
function! ale_linters#sass#sasslint#GetCommand(buffer) abort |
||||
let l:executable = ale_linters#sass#sasslint#GetExecutable(a:buffer) |
||||
let l:options = ale#Var(a:buffer, 'sass_sasslint_options') |
||||
|
||||
return ale#node#Executable(a:buffer, l:executable) |
||||
\ . (!empty(l:options) ? ' ' . l:options : '') |
||||
\ . ' -v -q -f compact %t' |
||||
endfunction |
||||
|
||||
call ale#linter#Define('sass', { |
||||
\ 'name': 'sasslint', |
||||
\ 'executable': 'sass-lint', |
||||
\ 'command_callback': 'ale#handlers#sasslint#GetCommand', |
||||
\ 'executable_callback': 'ale_linters#sass#sasslint#GetExecutable', |
||||
\ 'command_callback': 'ale_linters#sass#sasslint#GetCommand', |
||||
\ 'callback': 'ale#handlers#css#HandleCSSLintFormat', |
||||
\}) |
||||
|
@ -1,18 +1,28 @@ |
||||
" Author: KabbAmine - https://github.com/KabbAmine, Ben Falconer |
||||
" <ben@falconers.me.uk> |
||||
" Author: sQVe - https://github.com/sQVe |
||||
|
||||
call ale#Set('scss_sasslint_executable', 'sass-lint') |
||||
call ale#Set('scss_sasslint_options', '') |
||||
call ale#Set('scss_sasslint_use_global', get(g:, 'ale_use_global_executables', 0)) |
||||
|
||||
function! ale_linters#scss#sasslint#GetExecutable(buffer) abort |
||||
return ale#node#FindExecutable(a:buffer, 'scss_sasslint', [ |
||||
\ 'node_modules/sass-lint/bin/sass-lint.js', |
||||
\ 'node_modules/.bin/sass-lint', |
||||
\]) |
||||
endfunction |
||||
|
||||
function! ale_linters#scss#sasslint#GetCommand(buffer) abort |
||||
return ale#path#BufferCdString(a:buffer) |
||||
\ . ale#Escape('sass-lint') |
||||
\ . ' -v' |
||||
\ . ' -q' |
||||
\ . ' -f compact' |
||||
\ . ' %t' |
||||
let l:executable = ale_linters#scss#sasslint#GetExecutable(a:buffer) |
||||
let l:options = ale#Var(a:buffer, 'scss_sasslint_options') |
||||
|
||||
return ale#node#Executable(a:buffer, l:executable) |
||||
\ . (!empty(l:options) ? ' ' . l:options : '') |
||||
\ . ' -v -q -f compact %t' |
||||
endfunction |
||||
|
||||
call ale#linter#Define('scss', { |
||||
\ 'name': 'sasslint', |
||||
\ 'executable': 'sass-lint', |
||||
\ 'executable_callback': 'ale_linters#scss#sasslint#GetExecutable', |
||||
\ 'command_callback': 'ale_linters#scss#sasslint#GetCommand', |
||||
\ 'callback': 'ale#handlers#css#HandleCSSLintFormat', |
||||
\}) |
||||
|
@ -1,13 +1,28 @@ |
||||
" Author: Matteo Centenaro (bugant) - https://github.com/bugant |
||||
" |
||||
" Description: find the root directory for an elixir project that uses mix |
||||
" Author: Jon Parise <jon@indelible.org> |
||||
" Description: Functions for working with Elixir projects |
||||
|
||||
" Find the root directory for an elixir project that uses mix. |
||||
function! ale#handlers#elixir#FindMixProjectRoot(buffer) abort |
||||
let l:mix_file = ale#path#FindNearestFile(a:buffer, 'mix.exs') |
||||
|
||||
if !empty(l:mix_file) |
||||
return fnamemodify(l:mix_file, ':p:h') |
||||
return fnamemodify(l:mix_file, ':p:h') |
||||
endif |
||||
|
||||
return '.' |
||||
endfunction |
||||
|
||||
" Similar to ale#handlers#elixir#FindMixProjectRoot but also continue the |
||||
" search upward for a potential umbrella project root. If an umbrella root |
||||
" does not exist, the initial project root will be returned. |
||||
function! ale#handlers#elixir#FindMixUmbrellaRoot(buffer) abort |
||||
let l:app_root = ale#handlers#elixir#FindMixProjectRoot(a:buffer) |
||||
let l:umbrella_root = fnamemodify(l:app_root, ':h:h') |
||||
|
||||
if filereadable(l:umbrella_root . '/mix.exs') |
||||
return l:umbrella_root |
||||
endif |
||||
|
||||
return l:app_root |
||||
endfunction |
||||
|
@ -1,8 +0,0 @@ |
||||
" Author: KabbAmine - https://github.com/KabbAmine, |
||||
" Ben Falconer <ben@falconers.me.uk> |
||||
|
||||
function! ale#handlers#sasslint#GetCommand(buffer) abort |
||||
return ale#path#BufferCdString(a:buffer) |
||||
\ . ale#Escape('sass-lint') |
||||
\ . ' -v -q -f compact %t' |
||||
endfunction |
@ -1,15 +1,37 @@ |
||||
=============================================================================== |
||||
ALE Eruby Integration *ale-eruby-options* |
||||
|
||||
There are three linters for `eruby` files: |
||||
There are four linters for `eruby` files: |
||||
|
||||
- `erb` |
||||
- `erubis` |
||||
- `erubi` |
||||
- `ruumba` |
||||
|
||||
`erb` is in the Ruby standard library and is mostly universal. `erubis` is the |
||||
default parser in Rails between 3.0 and 5.1. `erubi` is the default in Rails |
||||
5.1 and later. To selectively enable a subset, see |g:ale_linters|. |
||||
5.1 and later. `ruumba` can extract Ruby from eruby files and run rubocop on |
||||
the result. To selectively enable a subset, see |g:ale_linters|. |
||||
|
||||
=============================================================================== |
||||
ruumba *ale-eruby-ruumba* |
||||
|
||||
g:ale_eruby_ruumba_executable *g:ale_eruby_ruumba_executable* |
||||
*b:ale_eruby_ruumba_executable* |
||||
Type: String |
||||
Default: `'ruumba` |
||||
|
||||
Override the invoked ruumba binary. This is useful for running ruumba |
||||
from binstubs or a bundle. |
||||
|
||||
|
||||
g:ale_eruby_ruumba_options *g:ale_ruby_ruumba_options* |
||||
*b:ale_ruby_ruumba_options* |
||||
Type: |String| |
||||
Default: `''` |
||||
|
||||
This variable can be change to modify flags given to ruumba. |
||||
|
||||
|
||||
=============================================================================== |
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: |
||||
|