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
Showing
70 changed files
with
2,045 additions
and
762 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
sources_non_forked/ale/ale_linters/cloudformation/cfn_python_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,35 @@ | ||
" Author: Yasuhiro Kiyota <[email protected]> | ||
" Description: Support cfn-python-lint for AWS Cloudformation template file | ||
|
||
function! ale_linters#cloudformation#cfn_python_lint#Handle(buffer, lines) abort | ||
" Matches patterns line the following: | ||
" | ||
" sample.template.yaml:96:7:96:15:E3012:Property Resources/Sample/Properties/FromPort should be of type Integer | ||
let l:pattern = '\v^(.*):(\d+):(\d+):(\d+):(\d+):([[:alnum:]]+):(.*)$' | ||
let l:output = [] | ||
|
||
for l:match in ale#util#GetMatches(a:lines, l:pattern) | ||
let l:code = l:match[6] | ||
|
||
if ale#path#IsBufferPath(a:buffer, l:match[1]) | ||
call add(l:output, { | ||
\ 'lnum': l:match[2], | ||
\ 'col': l:match[3], | ||
\ 'end_lnum': l:match[4], | ||
\ 'end_col': l:match[5], | ||
\ 'code': l:code, | ||
\ 'type': l:code[:0] is# 'E' ? 'E' : 'W', | ||
\ 'text': l:match[7] | ||
\}) | ||
endif | ||
endfor | ||
|
||
return l:output | ||
endfunction | ||
|
||
call ale#linter#Define('cloudformation', { | ||
\ 'name': 'cloudformation', | ||
\ 'executable': 'cfn-lint', | ||
\ 'command': 'cfn-lint --template %t --format parseable', | ||
\ 'callback': 'ale_linters#cloudformation#cfn_python_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
" Author: evnu - https://github.com/evnu | ||
" Author: colbydehart - https://github.com/colbydehart | ||
" Description: Mix compile checking for Elixir files | ||
|
||
function! ale_linters#elixir#mix#Handle(buffer, lines) abort | ||
" Matches patterns like the following: | ||
" | ||
" Error format | ||
" ** (CompileError) apps/sim/lib/sim/server.ex:87: undefined function update_in/4 | ||
" | ||
" TODO: Warning format | ||
" warning: variable "foobar" does not exist and is being expanded to "foobar()", please use parentheses to remove the ambiguity or change the variable name | ||
|
||
let l:pattern = '\v\(([^\)]+Error)\) ([^:]+):([^:]+): (.+)$' | ||
let l:output = [] | ||
|
||
for l:match in ale#util#GetMatches(a:lines, l:pattern) | ||
let l:type = 'E' | ||
let l:text = l:match[4] | ||
|
||
call add(l:output, { | ||
\ 'bufnr': a:buffer, | ||
\ 'lnum': l:match[3] + 0, | ||
\ 'col': 0, | ||
\ 'type': l:type, | ||
\ 'text': l:text, | ||
\}) | ||
endfor | ||
|
||
return l:output | ||
endfunction | ||
|
||
function! ale_linters#elixir#mix#FindProjectRoot(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') | ||
endif | ||
return '.' | ||
endfunction | ||
|
||
function! ale_linters#elixir#mix#GetCommand(buffer) abort | ||
let l:project_root = ale_linters#elixir#mix#FindProjectRoot(a:buffer) | ||
|
||
let l:temp_dir = ale#engine#CreateDirectory(a:buffer) | ||
|
||
let l:mix_build_path = has('win32') | ||
\ ? 'set MIX_BUILD_PATH=' . ale#Escape(l:temp_dir) . ' &&' | ||
\ : 'MIX_BUILD_PATH=' . ale#Escape(l:temp_dir) | ||
|
||
return ale#path#CdString(l:project_root) | ||
\ . l:mix_build_path | ||
\ . ' mix compile %s' | ||
endfunction | ||
|
||
call ale#linter#Define('elixir', { | ||
\ 'name': 'mix', | ||
\ 'executable': 'mix', | ||
\ 'command_callback': 'ale_linters#elixir#mix#GetCommand', | ||
\ 'callback': 'ale_linters#elixir#mix#Handle', | ||
\ 'lint_file': 1, | ||
\}) |
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,21 +1,10 @@ | ||
" Author: KabbAmine <[email protected]> | ||
" Description: This file adds support for checking HTML code with tidy. | ||
|
||
" CLI options | ||
let g:ale_html_tidy_executable = get(g:, 'ale_html_tidy_executable', 'tidy') | ||
" remove in 2.0 | ||
" Look for the old _args variable first. | ||
let s:deprecation_warning_echoed = 0 | ||
let s:default_options = get(g:, 'ale_html_tidy_args', '-q -e -language en') | ||
let g:ale_html_tidy_options = get(g:, 'ale_html_tidy_options', s:default_options) | ||
let g:ale_html_tidy_options = get(g:, 'ale_html_tidy_options', '-q -e -language en') | ||
|
||
function! ale_linters#html#tidy#GetCommand(buffer) abort | ||
" remove in 2.0 | ||
if exists('g:ale_html_tidy_args') && !s:deprecation_warning_echoed | ||
execute 'echom ''Rename your g:ale_html_tidy_args setting to g:ale_html_tidy_options instead. Support for this will removed in ALE 2.0.''' | ||
let s:deprecation_warning_echoed = 1 | ||
endif | ||
|
||
" Specify file encoding in options | ||
" (Idea taken from https://github.com/scrooloose/syntastic/blob/master/syntax_checkers/html/tidy.vim) | ||
let l:file_encoding = get({ | ||
|
26 changes: 26 additions & 0 deletions
26
sources_non_forked/ale/ale_linters/javascript/tsserver.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,26 @@ | ||
" Author: Chaucerbao, w0rp <[email protected]> | ||
" Description: tsserver integration for ALE | ||
|
||
call ale#Set('javascript_tsserver_executable', 'tsserver') | ||
call ale#Set('javascript_tsserver_config_path', '') | ||
call ale#Set('javascript_tsserver_use_global', get(g:, 'ale_use_global_executables', 0)) | ||
|
||
" These functions need to be defined just to comply with the API for LSP. | ||
function! ale_linters#javascript#tsserver#GetProjectRoot(buffer) abort | ||
return '' | ||
endfunction | ||
|
||
function! ale_linters#javascript#tsserver#GetExecutable(buffer) abort | ||
return ale#node#FindExecutable(a:buffer, 'javascript_tsserver', [ | ||
\ 'node_modules/.bin/tsserver', | ||
\]) | ||
endfunction | ||
|
||
call ale#linter#Define('javascript', { | ||
\ 'name': 'tsserver', | ||
\ 'lsp': 'tsserver', | ||
\ 'executable_callback': 'ale_linters#javascript#tsserver#GetExecutable', | ||
\ 'command_callback': 'ale_linters#javascript#tsserver#GetExecutable', | ||
\ 'project_root_callback': 'ale_linters#javascript#tsserver#GetProjectRoot', | ||
\ 'language': '', | ||
\}) |
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,10 +1,43 @@ | ||
" Author: w0rp <[email protected]> | ||
" Author: w0rp <[email protected]>, | ||
" Nicolas Pauss <https://github.com/nicopauss> | ||
" Description: cython syntax checking for cython files. | ||
|
||
call ale#Set('pyrex_cython_executable', 'cython') | ||
call ale#Set('pyrex_cython_options', '--warning-extra') | ||
|
||
function! ale_linters#pyrex#cython#GetExecutable(buffer) abort | ||
return ale#Var(a:buffer, 'pyrex_cython_executable') | ||
endfunction | ||
|
||
function! ale_linters#pyrex#cython#GetCommand(buffer) abort | ||
let l:local_dir = ale#Escape(fnamemodify(bufname(a:buffer), ':p:h')) | ||
|
||
return ale#Escape(ale_linters#pyrex#cython#GetExecutable(a:buffer)) | ||
\ . ' --working ' . l:local_dir . ' --include-dir ' . l:local_dir | ||
\ . ' ' . ale#Var(a:buffer, 'pyrex_cython_options') | ||
\ . ' --output-file ' . g:ale#util#nul_file . ' %t' | ||
endfunction | ||
|
||
function! ale_linters#pyrex#cython#Handle(buffer, lines) abort | ||
let l:pattern = '\v^(\w+: )?[^:]+:(\d+):?(\d+)?:? ?(.+)$' | ||
let l:output = [] | ||
|
||
for l:match in ale#util#GetMatches(a:lines, l:pattern) | ||
call add(l:output, { | ||
\ 'lnum': l:match[2] + 0, | ||
\ 'col': l:match[3] + 0, | ||
\ 'text': l:match[4], | ||
\ 'type': l:match[1][0] is# 'w' ? 'W' : 'E', | ||
\}) | ||
endfor | ||
|
||
return l:output | ||
endfunction | ||
|
||
call ale#linter#Define('pyrex', { | ||
\ 'name': 'cython', | ||
\ 'output_stream': 'stderr', | ||
\ 'executable': 'cython', | ||
\ 'command': 'cython --warning-extra -o ' . g:ale#util#nul_file . ' %t', | ||
\ 'callback': 'ale#handlers#unix#HandleAsError', | ||
\ 'executable_callback': 'ale_linters#pyrex#cython#GetExecutable', | ||
\ 'command_callback': 'ale_linters#pyrex#cython#GetCommand', | ||
\ 'callback': 'ale_linters#pyrex#cython#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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,8 @@ | ||
" Author: w0rp <[email protected]> | ||
" Description: flake8 for python files | ||
|
||
" remove in 2.0 | ||
" Support an old setting as a fallback. | ||
let s:deprecation_warning_echoed = 0 | ||
let s:default_options = get(g:, 'ale_python_flake8_args', '') | ||
|
||
call ale#Set('python_flake8_executable', 'flake8') | ||
call ale#Set('python_flake8_options', s:default_options) | ||
call ale#Set('python_flake8_options', '') | ||
call ale#Set('python_flake8_use_global', get(g:, 'ale_use_global_executables', 0)) | ||
call ale#Set('python_flake8_change_directory', 1) | ||
|
||
|
@@ -40,12 +35,6 @@ function! ale_linters#python#flake8#VersionCheck(buffer) abort | |
endfunction | ||
|
||
function! ale_linters#python#flake8#GetCommand(buffer, version_output) abort | ||
" remove in 2.0 | ||
if exists('g:ale_python_flake8_args') && !s:deprecation_warning_echoed | ||
execute 'echom ''Rename your g:ale_python_flake8_args setting to g:ale_python_flake8_options instead. Support for this will removed in ALE 2.0.''' | ||
let s:deprecation_warning_echoed = 1 | ||
endif | ||
|
||
let l:cd_string = ale#Var(a:buffer, 'python_flake8_change_directory') | ||
\ ? ale#path#BufferCdString(a:buffer) | ||
\ : '' | ||
|
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,29 @@ | ||
" Author: dsifford <[email protected]> | ||
" Description: A performant type-checker supporting LSP for Python 3 created by Facebook | ||
|
||
call ale#Set('python_pyre_executable', 'pyre') | ||
call ale#Set('python_pyre_use_global', get(g:, 'ale_use_global_executables', 0)) | ||
|
||
function! ale_linters#python#pyre#GetExecutable(buffer) abort | ||
return ale#python#FindExecutable(a:buffer, 'python_pyre', ['pyre']) | ||
endfunction | ||
|
||
function! ale_linters#python#pyre#GetCommand(buffer) abort | ||
let l:executable = ale_linters#python#pyre#GetExecutable(a:buffer) | ||
|
||
let l:exec_args = l:executable =~? 'pipenv$' | ||
\ ? ' run pyre persistent' | ||
\ : ' persistent' | ||
|
||
return ale#Escape(l:executable) . l:exec_args | ||
endfunction | ||
|
||
call ale#linter#Define('python', { | ||
\ 'name': 'pyre', | ||
\ 'lsp': 'stdio', | ||
\ 'executable_callback': 'ale_linters#python#pyre#GetExecutable', | ||
\ 'command_callback': 'ale_linters#python#pyre#GetCommand', | ||
\ 'language': 'python', | ||
\ 'project_root_callback': 'ale#python#FindProjectRoot', | ||
\ 'completion_filter': 'ale#completion#python#CompletionItemFilter', | ||
\}) |
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.