forked from amix/vimrc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Taewoong Jang
committed
Nov 8, 2018
1 parent
dcdc968
commit 485cf5e
Showing
116 changed files
with
2,329 additions
and
601 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
" Author: Bjorn Neergaard <[email protected]> | ||
" Description: ansible-lint for ansible-yaml files | ||
|
||
call ale#Set('ansible_ansible_lint_executable', 'ansible-lint') | ||
|
||
function! ale_linters#ansible#ansible_lint#GetExecutable(buffer) abort | ||
return ale#Var(a:buffer, 'ansible_ansible_lint_executable') | ||
endfunction | ||
|
||
function! ale_linters#ansible#ansible_lint#Handle(buffer, lines) abort | ||
for l:line in a:lines[:10] | ||
if match(l:line, '^Traceback') >= 0 | ||
|
@@ -42,8 +48,9 @@ function! ale_linters#ansible#ansible_lint#Handle(buffer, lines) abort | |
endfunction | ||
|
||
call ale#linter#Define('ansible', { | ||
\ 'name': 'ansible', | ||
\ 'executable': 'ansible', | ||
\ 'command': 'ansible-lint -p %t', | ||
\ 'name': 'ansible_lint', | ||
\ 'aliases': ['ansible', 'ansible-lint'], | ||
\ 'executable_callback': 'ale_linters#ansible#ansible_lint#GetExecutable', | ||
\ 'command': '%e -p %t', | ||
\ 'callback': 'ale_linters#ansible#ansible_lint#Handle', | ||
\}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
" Author: aurieh <[email protected]> | ||
" Description: A Language Server implementation for D | ||
|
||
call ale#Set('d_dls_executable', 'dls') | ||
|
||
function! ale_linters#d#dls#GetExecutable(buffer) abort | ||
return ale#Var(a:buffer, 'd_dls_executable') | ||
endfunction | ||
|
||
function! ale_linters#d#dls#FindProjectRoot(buffer) abort | ||
" Note: this will return . if dub config is empty | ||
" dls can run outside DUB projects just fine | ||
return fnamemodify(ale#d#FindDUBConfig(a:buffer), ':h') | ||
endfunction | ||
|
||
call ale#linter#Define('d', { | ||
\ 'name': 'dls', | ||
\ 'lsp': 'stdio', | ||
\ 'executable_callback': 'ale_linters#d#dls#GetExecutable', | ||
\ 'command_callback': 'ale_linters#d#dls#GetExecutable', | ||
\ 'project_root_callback': 'ale_linters#d#dls#FindProjectRoot', | ||
\}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,14 @@ | ||
" Author: w0rp <[email protected]> | ||
" Description: "dmd for D files" | ||
|
||
function! s:FindDUBConfig(buffer) abort | ||
" Find a DUB configuration file in ancestor paths. | ||
" The most DUB-specific names will be tried first. | ||
for l:possible_filename in ['dub.sdl', 'dub.json', 'package.json'] | ||
let l:dub_file = ale#path#FindNearestFile(a:buffer, l:possible_filename) | ||
|
||
if !empty(l:dub_file) | ||
return l:dub_file | ||
endif | ||
endfor | ||
|
||
return '' | ||
endfunction | ||
|
||
function! ale_linters#d#dmd#DUBCommand(buffer) abort | ||
" If we can't run dub, then skip this command. | ||
if !executable('dub') | ||
" Returning an empty string skips to the DMD command. | ||
return '' | ||
endif | ||
|
||
let l:dub_file = s:FindDUBConfig(a:buffer) | ||
let l:dub_file = ale#d#FindDUBConfig(a:buffer) | ||
|
||
if empty(l:dub_file) | ||
return '' | ||
|
61 changes: 61 additions & 0 deletions
61
sources_non_forked/ale/ale_linters/dockerfile/dockerfile_lint.vim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
" Author: Alexander Olofsson <[email protected]> | ||
|
||
call ale#Set('dockerfile_dockerfile_lint_executable', 'dockerfile_lint') | ||
call ale#Set('dockerfile_dockerfile_lint_options', '') | ||
|
||
function! ale_linters#dockerfile#dockerfile_lint#GetType(type) abort | ||
if a:type is? 'error' | ||
return 'E' | ||
elseif a:type is? 'warn' | ||
return 'W' | ||
endif | ||
|
||
return 'I' | ||
endfunction | ||
|
||
function! ale_linters#dockerfile#dockerfile_lint#Handle(buffer, lines) abort | ||
try | ||
let l:data = json_decode(join(a:lines, '')) | ||
catch | ||
return [] | ||
endtry | ||
|
||
if empty(l:data) | ||
" Should never happen, but it's better to be on the safe side | ||
return [] | ||
endif | ||
|
||
let l:messages = [] | ||
|
||
for l:type in ['error', 'warn', 'info'] | ||
for l:object in l:data[l:type]['data'] | ||
let l:line = get(l:object, 'line', -1) | ||
let l:message = l:object['message'] | ||
|
||
if get(l:object, 'description', 'None') isnot# 'None' | ||
let l:message = l:message . '. ' . l:object['description'] | ||
endif | ||
|
||
call add(l:messages, { | ||
\ 'lnum': l:line, | ||
\ 'text': l:message, | ||
\ 'type': ale_linters#dockerfile#dockerfile_lint#GetType(l:type), | ||
\}) | ||
endfor | ||
endfor | ||
|
||
return l:messages | ||
endfunction | ||
|
||
function! ale_linters#dockerfile#dockerfile_lint#GetCommand(buffer) abort | ||
return '%e' . ale#Pad(ale#Var(a:buffer, 'dockerfile_dockerfile_lint_options')) | ||
\ . ' -p -j -f' | ||
\ . ' %t' | ||
endfunction | ||
|
||
call ale#linter#Define('dockerfile', { | ||
\ 'name': 'dockerfile_lint', | ||
\ 'executable_callback': ale#VarFunc('dockerfile_dockerfile_lint_executable'), | ||
\ 'command_callback': 'ale_linters#dockerfile#dockerfile_lint#GetCommand', | ||
\ 'callback': 'ale_linters#dockerfile#dockerfile_lint#Handle', | ||
\}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
" Author: Jon Parise <[email protected]> | ||
" Description: ElixirLS integration (https://github.com/JakeBecker/elixir-ls) | ||
|
||
call ale#Set('elixir_elixir_ls_release', 'elixir-ls') | ||
call ale#Set('elixir_elixir_ls_config', {}) | ||
|
||
function! ale_linters#elixir#elixir_ls#GetExecutable(buffer) abort | ||
let l:dir = ale#path#Simplify(ale#Var(a:buffer, 'elixir_elixir_ls_release')) | ||
let l:cmd = ale#Has('win32') ? '\language_server.bat' : '/language_server.sh' | ||
|
||
return l:dir . l:cmd | ||
endfunction | ||
|
||
call ale#linter#Define('elixir', { | ||
\ 'name': 'elixir-ls', | ||
\ 'lsp': 'stdio', | ||
\ 'executable_callback': 'ale_linters#elixir#elixir_ls#GetExecutable', | ||
\ 'command_callback': 'ale_linters#elixir#elixir_ls#GetExecutable', | ||
\ 'project_root_callback': 'ale#handlers#elixir#FindMixUmbrellaRoot', | ||
\ 'lsp_config_callback': ale#VarFunc('elixir_elixir_ls_config'), | ||
\}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
" Author: aclemons - https://github.com/aclemons | ||
" based on the ale rubocop linter | ||
" Description: Ruumba, RuboCop linting for ERB templates. | ||
|
||
call ale#Set('eruby_ruumba_executable', 'ruumba') | ||
call ale#Set('eruby_ruumba_options', '') | ||
|
||
function! ale_linters#eruby#ruumba#GetCommand(buffer) abort | ||
let l:executable = ale#Var(a:buffer, 'eruby_ruumba_executable') | ||
|
||
return ale#handlers#ruby#EscapeExecutable(l:executable, 'ruumba') | ||
\ . ' --format json --force-exclusion ' | ||
\ . ale#Var(a:buffer, 'eruby_ruumba_options') | ||
\ . ' --stdin ' . ale#Escape(expand('#' . a:buffer . ':p')) | ||
endfunction | ||
|
||
function! ale_linters#eruby#ruumba#Handle(buffer, lines) abort | ||
try | ||
let l:errors = json_decode(a:lines[0]) | ||
catch | ||
return [] | ||
endtry | ||
|
||
if !has_key(l:errors, 'summary') | ||
\|| l:errors['summary']['offense_count'] == 0 | ||
\|| empty(l:errors['files']) | ||
return [] | ||
endif | ||
|
||
let l:output = [] | ||
|
||
for l:error in l:errors['files'][0]['offenses'] | ||
let l:start_col = l:error['location']['column'] + 0 | ||
call add(l:output, { | ||
\ 'lnum': l:error['location']['line'] + 0, | ||
\ 'col': l:start_col, | ||
\ 'end_col': l:start_col + l:error['location']['length'] - 1, | ||
\ 'code': l:error['cop_name'], | ||
\ 'text': l:error['message'], | ||
\ 'type': ale_linters#eruby#ruumba#GetType(l:error['severity']), | ||
\}) | ||
endfor | ||
|
||
return l:output | ||
endfunction | ||
|
||
function! ale_linters#eruby#ruumba#GetType(severity) abort | ||
if a:severity is? 'convention' | ||
\|| a:severity is? 'warning' | ||
\|| a:severity is? 'refactor' | ||
return 'W' | ||
endif | ||
|
||
return 'E' | ||
endfunction | ||
|
||
call ale#linter#Define('eruby', { | ||
\ 'name': 'ruumba', | ||
\ 'executable_callback': ale#VarFunc('eruby_ruumba_executable'), | ||
\ 'command_callback': 'ale_linters#eruby#ruumba#GetCommand', | ||
\ 'callback': 'ale_linters#eruby#ruumba#Handle', | ||
\}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.