mirror of
https://github.com/amix/vimrc
synced 2025-02-28 14:12:51 +08:00
Update ui_glue.vim, lightline.txt, and 333 more files...
This commit is contained in:
parent
43c7efba8d
commit
1cca3b1df2
26
sources_non_forked/ale/ale_linters/ada/adals.vim
Normal file
26
sources_non_forked/ale/ale_linters/ada/adals.vim
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
" Author: Bartek Jasicki http://github.com/thindil
|
||||||
|
" Description: Support for Ada Language Server
|
||||||
|
|
||||||
|
call ale#Set('ada_adals_executable', 'ada_language_server')
|
||||||
|
call ale#Set('ada_adals_project', 'default.gpr')
|
||||||
|
call ale#Set('ada_adals_encoding', 'utf-8')
|
||||||
|
|
||||||
|
function! ale_linters#ada#adals#GetAdaLSConfig(buffer) abort
|
||||||
|
return {
|
||||||
|
\ 'ada.projectFile': ale#Var(a:buffer, 'ada_adals_project'),
|
||||||
|
\ 'ada.defaultCharset': ale#Var(a:buffer, 'ada_adals_encoding')
|
||||||
|
\}
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#ada#adals#GetRootDirectory(buffer) abort
|
||||||
|
return fnamemodify(bufname(a:buffer), ':p:h')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('ada', {
|
||||||
|
\ 'name': 'adals',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'ada_adals_executable')},
|
||||||
|
\ 'command': '%e',
|
||||||
|
\ 'project_root': function('ale_linters#ada#adals#GetRootDirectory'),
|
||||||
|
\ 'lsp_config': function('ale_linters#ada#adals#GetAdaLSConfig')
|
||||||
|
\})
|
@ -1,4 +1,4 @@
|
|||||||
" Author: Bjorn Neergaard <bjorn@neersighted.com>
|
" Authors: Bjorn Neergaard <bjorn@neersighted.com>, Vytautas Macionis <vytautas.macionis@manomail.de>
|
||||||
" Description: ansible-lint for ansible-yaml files
|
" Description: ansible-lint for ansible-yaml files
|
||||||
|
|
||||||
call ale#Set('ansible_ansible_lint_executable', 'ansible-lint')
|
call ale#Set('ansible_ansible_lint_executable', 'ansible-lint')
|
||||||
@ -7,7 +7,7 @@ function! ale_linters#ansible#ansible_lint#GetExecutable(buffer) abort
|
|||||||
return ale#Var(a:buffer, 'ansible_ansible_lint_executable')
|
return ale#Var(a:buffer, 'ansible_ansible_lint_executable')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#ansible#ansible_lint#Handle(buffer, lines) abort
|
function! ale_linters#ansible#ansible_lint#Handle(buffer, version, lines) abort
|
||||||
for l:line in a:lines[:10]
|
for l:line in a:lines[:10]
|
||||||
if match(l:line, '^Traceback') >= 0
|
if match(l:line, '^Traceback') >= 0
|
||||||
return [{
|
return [{
|
||||||
@ -18,39 +18,86 @@ function! ale_linters#ansible#ansible_lint#Handle(buffer, lines) abort
|
|||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
" Matches patterns line the following:
|
let l:version_group = ale#semver#GTE(a:version, [5, 0, 0]) ? '>=5.0.0' : '<5.0.0'
|
||||||
"
|
|
||||||
" test.yml:35: [EANSIBLE0002] Trailing whitespace
|
|
||||||
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):?(\d+)?: \[?([[:alnum:]]+)\]? (.*)$'
|
|
||||||
let l:output = []
|
let l:output = []
|
||||||
|
|
||||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
if '>=5.0.0' is# l:version_group
|
||||||
let l:code = l:match[4]
|
" Matches patterns line the following:
|
||||||
|
" test.yml:3:148: syntax-check 'var' is not a valid attribute for a Play
|
||||||
|
" roles/test/tasks/test.yml:8: [package-latest] [VERY_LOW] Package installs should not use latest
|
||||||
|
" D:\test\tasks\test.yml:8: [package-latest] [VERY_LOW] package installs should not use latest
|
||||||
|
let l:pattern = '\v^(%([a-zA-Z]:)?[^:]+):(\d+):%((\d+):)? %(\[([-[:alnum:]]+)\]) %(\[([_[:alnum:]]+)\]) (.*)$'
|
||||||
|
let l:error_codes = { 'VERY_HIGH': 'E', 'HIGH': 'E', 'MEDIUM': 'W', 'LOW': 'W', 'VERY_LOW': 'W', 'INFO': 'I' }
|
||||||
|
|
||||||
if l:code is# 'EANSIBLE0002'
|
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||||
\&& !ale#Var(a:buffer, 'warn_about_trailing_whitespace')
|
if ale#path#IsBufferPath(a:buffer, l:match[1])
|
||||||
" Skip warnings for trailing whitespace if the option is off.
|
call add(l:output, {
|
||||||
continue
|
\ 'lnum': l:match[2] + 0,
|
||||||
endif
|
\ 'col': l:match[3] + 0,
|
||||||
|
\ 'text': l:match[6],
|
||||||
|
\ 'code': l:match[4],
|
||||||
|
\ 'type': l:error_codes[l:match[5]],
|
||||||
|
\})
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
endif
|
||||||
|
|
||||||
if ale#path#IsBufferPath(a:buffer, l:match[1])
|
if '<5.0.0' is# l:version_group
|
||||||
call add(l:output, {
|
" Matches patterns line the following:
|
||||||
\ 'lnum': l:match[2] + 0,
|
" test.yml:35: [EANSIBLE0002] Trailing whitespace
|
||||||
\ 'col': l:match[3] + 0,
|
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):?(\d+)?: \[?([[:alnum:]]+)\]? (.*)$'
|
||||||
\ 'text': l:match[5],
|
|
||||||
\ 'code': l:code,
|
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||||
\ 'type': l:code[:0] is# 'E' ? 'E' : 'W',
|
let l:code = l:match[4]
|
||||||
\})
|
|
||||||
endif
|
if l:code is# 'EANSIBLE0002'
|
||||||
endfor
|
\&& !ale#Var(a:buffer, 'warn_about_trailing_whitespace')
|
||||||
|
" Skip warnings for trailing whitespace if the option is off.
|
||||||
|
continue
|
||||||
|
endif
|
||||||
|
|
||||||
|
if ale#path#IsBufferPath(a:buffer, l:match[1])
|
||||||
|
call add(l:output, {
|
||||||
|
\ 'lnum': l:match[2] + 0,
|
||||||
|
\ 'col': l:match[3] + 0,
|
||||||
|
\ 'text': l:match[5],
|
||||||
|
\ 'code': l:code,
|
||||||
|
\ 'type': l:code[:0] is# 'E' ? 'E' : 'W',
|
||||||
|
\})
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
endif
|
||||||
|
|
||||||
return l:output
|
return l:output
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#ansible#ansible_lint#GetCommand(buffer, version) abort
|
||||||
|
let l:commands = {
|
||||||
|
\ '>=5.0.0': '%e --parseable-severity -x yaml',
|
||||||
|
\ '<5.0.0': '%e -p %t'
|
||||||
|
\}
|
||||||
|
let l:command = ale#semver#GTE(a:version, [5, 0]) ? l:commands['>=5.0.0'] : l:commands['<5.0.0']
|
||||||
|
|
||||||
|
return l:command
|
||||||
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('ansible', {
|
call ale#linter#Define('ansible', {
|
||||||
\ 'name': 'ansible_lint',
|
\ 'name': 'ansible_lint',
|
||||||
\ 'aliases': ['ansible', 'ansible-lint'],
|
\ 'aliases': ['ansible', 'ansible-lint'],
|
||||||
\ 'executable': function('ale_linters#ansible#ansible_lint#GetExecutable'),
|
\ 'executable': function('ale_linters#ansible#ansible_lint#GetExecutable'),
|
||||||
\ 'command': '%e -p %t',
|
\ 'command': {buffer -> ale#semver#RunWithVersionCheck(
|
||||||
\ 'callback': 'ale_linters#ansible#ansible_lint#Handle',
|
\ buffer,
|
||||||
|
\ ale_linters#ansible#ansible_lint#GetExecutable(buffer),
|
||||||
|
\ '%e --version',
|
||||||
|
\ function('ale_linters#ansible#ansible_lint#GetCommand'),
|
||||||
|
\ )},
|
||||||
|
\ 'callback': {buffer, lines -> ale#semver#RunWithVersionCheck(
|
||||||
|
\ buffer,
|
||||||
|
\ ale_linters#ansible#ansible_lint#GetExecutable(buffer),
|
||||||
|
\ '%e --version',
|
||||||
|
\ {buffer, version -> ale_linters#ansible#ansible_lint#Handle(
|
||||||
|
\ buffer,
|
||||||
|
\ l:version,
|
||||||
|
\ lines)},
|
||||||
|
\ )},
|
||||||
\})
|
\})
|
||||||
|
@ -0,0 +1,12 @@
|
|||||||
|
" Author: Leo <thinkabit.ukim@gmail.com>
|
||||||
|
" Description: apkbuild-lint from atools linter for APKBUILDs
|
||||||
|
|
||||||
|
call ale#Set('apkbuild_apkbuild_lint_executable', 'apkbuild-lint')
|
||||||
|
|
||||||
|
call ale#linter#Define('apkbuild', {
|
||||||
|
\ 'name': 'apkbuild_lint',
|
||||||
|
\ 'output_stream': 'stdout',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'apkbuild_apkbuild_lint_executable')},
|
||||||
|
\ 'command': '%e %t',
|
||||||
|
\ 'callback': 'ale#handlers#atools#Handle',
|
||||||
|
\})
|
@ -0,0 +1,12 @@
|
|||||||
|
" Author: Leo <thinkabit.ukim@gmail.com>
|
||||||
|
" Description: secfixes-check from atools linter for APKBUILDs
|
||||||
|
|
||||||
|
call ale#Set('apkbuild_secfixes_check_executable', 'secfixes-check')
|
||||||
|
|
||||||
|
call ale#linter#Define('apkbuild', {
|
||||||
|
\ 'name': 'secfixes_check',
|
||||||
|
\ 'output_stream': 'stdout',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'apkbuild_secfixes_check_executable')},
|
||||||
|
\ 'command': '%e %t',
|
||||||
|
\ 'callback': 'ale#handlers#atools#Handle',
|
||||||
|
\})
|
@ -5,15 +5,13 @@ call ale#Set('c_cppcheck_executable', 'cppcheck')
|
|||||||
call ale#Set('c_cppcheck_options', '--enable=style')
|
call ale#Set('c_cppcheck_options', '--enable=style')
|
||||||
|
|
||||||
function! ale_linters#c#cppcheck#GetCommand(buffer) abort
|
function! ale_linters#c#cppcheck#GetCommand(buffer) abort
|
||||||
let l:cd_command = ale#handlers#cppcheck#GetCdCommand(a:buffer)
|
|
||||||
let l:compile_commands_option = ale#handlers#cppcheck#GetCompileCommandsOptions(a:buffer)
|
let l:compile_commands_option = ale#handlers#cppcheck#GetCompileCommandsOptions(a:buffer)
|
||||||
let l:buffer_path_include = empty(l:compile_commands_option)
|
let l:buffer_path_include = empty(l:compile_commands_option)
|
||||||
\ ? ale#handlers#cppcheck#GetBufferPathIncludeOptions(a:buffer)
|
\ ? ale#handlers#cppcheck#GetBufferPathIncludeOptions(a:buffer)
|
||||||
\ : ''
|
\ : ''
|
||||||
let l:template = ' --template=''{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}'''
|
let l:template = ' --template=' . ale#Escape('{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}')
|
||||||
|
|
||||||
return l:cd_command
|
return '%e -q --language=c'
|
||||||
\ . '%e -q --language=c'
|
|
||||||
\ . l:template
|
\ . l:template
|
||||||
\ . ale#Pad(l:compile_commands_option)
|
\ . ale#Pad(l:compile_commands_option)
|
||||||
\ . ale#Pad(ale#Var(a:buffer, 'c_cppcheck_options'))
|
\ . ale#Pad(ale#Var(a:buffer, 'c_cppcheck_options'))
|
||||||
@ -25,6 +23,7 @@ call ale#linter#Define('c', {
|
|||||||
\ 'name': 'cppcheck',
|
\ 'name': 'cppcheck',
|
||||||
\ 'output_stream': 'both',
|
\ 'output_stream': 'both',
|
||||||
\ 'executable': {b -> ale#Var(b, 'c_cppcheck_executable')},
|
\ 'executable': {b -> ale#Var(b, 'c_cppcheck_executable')},
|
||||||
|
\ 'cwd': function('ale#handlers#cppcheck#GetCwd'),
|
||||||
\ 'command': function('ale_linters#c#cppcheck#GetCommand'),
|
\ 'command': function('ale_linters#c#cppcheck#GetCommand'),
|
||||||
\ 'callback': 'ale#handlers#cppcheck#HandleCppCheckFormat',
|
\ 'callback': 'ale#handlers#cppcheck#HandleCppCheckFormat',
|
||||||
\})
|
\})
|
||||||
|
@ -29,6 +29,7 @@ endfunction
|
|||||||
|
|
||||||
call ale#linter#Define('cloudformation', {
|
call ale#linter#Define('cloudformation', {
|
||||||
\ 'name': 'cloudformation',
|
\ 'name': 'cloudformation',
|
||||||
|
\ 'aliases': ['cfn-lint'],
|
||||||
\ 'executable': 'cfn-lint',
|
\ 'executable': 'cfn-lint',
|
||||||
\ 'command': 'cfn-lint --template %t --format parseable',
|
\ 'command': 'cfn-lint --template %t --format parseable',
|
||||||
\ 'callback': 'ale_linters#cloudformation#cfn_python_lint#Handle',
|
\ 'callback': 'ale_linters#cloudformation#cfn_python_lint#Handle',
|
||||||
|
@ -23,11 +23,13 @@ function! ale_linters#cpp#clangtidy#GetCommand(buffer, output) abort
|
|||||||
let l:options = ale#Var(a:buffer, 'cpp_clangtidy_options')
|
let l:options = ale#Var(a:buffer, 'cpp_clangtidy_options')
|
||||||
let l:cflags = ale#c#GetCFlags(a:buffer, a:output)
|
let l:cflags = ale#c#GetCFlags(a:buffer, a:output)
|
||||||
let l:options .= !empty(l:options) ? ale#Pad(l:cflags) : l:cflags
|
let l:options .= !empty(l:options) ? ale#Pad(l:cflags) : l:cflags
|
||||||
endif
|
|
||||||
|
|
||||||
" Tell clang-tidy a .h header with a C++ filetype in Vim is a C++ file.
|
" Tell clang-tidy a .h header with a C++ filetype in Vim is a C++ file
|
||||||
if expand('#' . a:buffer) =~# '\.h$'
|
" only when compile-commands.json file is not there. Adding these
|
||||||
let l:options .= !empty(l:options) ? ' -x c++' : '-x c++'
|
" flags makes clang-tidy completely ignore compile commmands.
|
||||||
|
if expand('#' . a:buffer) =~# '\.h$'
|
||||||
|
let l:options .= !empty(l:options) ? ' -x c++' : '-x c++'
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Get the options to pass directly to clang-tidy
|
" Get the options to pass directly to clang-tidy
|
||||||
|
@ -5,15 +5,13 @@ call ale#Set('cpp_cppcheck_executable', 'cppcheck')
|
|||||||
call ale#Set('cpp_cppcheck_options', '--enable=style')
|
call ale#Set('cpp_cppcheck_options', '--enable=style')
|
||||||
|
|
||||||
function! ale_linters#cpp#cppcheck#GetCommand(buffer) abort
|
function! ale_linters#cpp#cppcheck#GetCommand(buffer) abort
|
||||||
let l:cd_command = ale#handlers#cppcheck#GetCdCommand(a:buffer)
|
|
||||||
let l:compile_commands_option = ale#handlers#cppcheck#GetCompileCommandsOptions(a:buffer)
|
let l:compile_commands_option = ale#handlers#cppcheck#GetCompileCommandsOptions(a:buffer)
|
||||||
let l:buffer_path_include = empty(l:compile_commands_option)
|
let l:buffer_path_include = empty(l:compile_commands_option)
|
||||||
\ ? ale#handlers#cppcheck#GetBufferPathIncludeOptions(a:buffer)
|
\ ? ale#handlers#cppcheck#GetBufferPathIncludeOptions(a:buffer)
|
||||||
\ : ''
|
\ : ''
|
||||||
let l:template = ' --template=''{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}'''
|
let l:template = ' --template=' . ale#Escape('{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}')
|
||||||
|
|
||||||
return l:cd_command
|
return '%e -q --language=c++'
|
||||||
\ . '%e -q --language=c++'
|
|
||||||
\ . l:template
|
\ . l:template
|
||||||
\ . ale#Pad(l:compile_commands_option)
|
\ . ale#Pad(l:compile_commands_option)
|
||||||
\ . ale#Pad(ale#Var(a:buffer, 'cpp_cppcheck_options'))
|
\ . ale#Pad(ale#Var(a:buffer, 'cpp_cppcheck_options'))
|
||||||
@ -25,6 +23,7 @@ call ale#linter#Define('cpp', {
|
|||||||
\ 'name': 'cppcheck',
|
\ 'name': 'cppcheck',
|
||||||
\ 'output_stream': 'both',
|
\ 'output_stream': 'both',
|
||||||
\ 'executable': {b -> ale#Var(b, 'cpp_cppcheck_executable')},
|
\ 'executable': {b -> ale#Var(b, 'cpp_cppcheck_executable')},
|
||||||
|
\ 'cwd': function('ale#handlers#cppcheck#GetCwd'),
|
||||||
\ 'command': function('ale_linters#cpp#cppcheck#GetCommand'),
|
\ 'command': function('ale_linters#cpp#cppcheck#GetCommand'),
|
||||||
\ 'callback': 'ale#handlers#cppcheck#HandleCppCheckFormat',
|
\ 'callback': 'ale#handlers#cppcheck#HandleCppCheckFormat',
|
||||||
\})
|
\})
|
||||||
|
@ -3,14 +3,10 @@ call ale#Set('cs_csc_source', '')
|
|||||||
call ale#Set('cs_csc_assembly_path', [])
|
call ale#Set('cs_csc_assembly_path', [])
|
||||||
call ale#Set('cs_csc_assemblies', [])
|
call ale#Set('cs_csc_assemblies', [])
|
||||||
|
|
||||||
function! s:GetWorkingDirectory(buffer) abort
|
function! ale_linters#cs#csc#GetCwd(buffer) abort
|
||||||
let l:working_directory = ale#Var(a:buffer, 'cs_csc_source')
|
let l:cwd = ale#Var(a:buffer, 'cs_csc_source')
|
||||||
|
|
||||||
if !empty(l:working_directory)
|
return !empty(l:cwd) ? l:cwd : expand('#' . a:buffer . ':p:h')
|
||||||
return l:working_directory
|
|
||||||
endif
|
|
||||||
|
|
||||||
return expand('#' . a:buffer . ':p:h')
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#cs#csc#GetCommand(buffer) abort
|
function! ale_linters#cs#csc#GetCommand(buffer) abort
|
||||||
@ -34,8 +30,7 @@ function! ale_linters#cs#csc#GetCommand(buffer) abort
|
|||||||
|
|
||||||
" The code is compiled as a module and the output is redirected to a
|
" The code is compiled as a module and the output is redirected to a
|
||||||
" temporary file.
|
" temporary file.
|
||||||
return ale#path#CdString(s:GetWorkingDirectory(a:buffer))
|
return 'csc /unsafe'
|
||||||
\ . 'csc /unsafe'
|
|
||||||
\ . ale#Pad(ale#Var(a:buffer, 'cs_csc_options'))
|
\ . ale#Pad(ale#Var(a:buffer, 'cs_csc_options'))
|
||||||
\ . ale#Pad(l:lib_option)
|
\ . ale#Pad(l:lib_option)
|
||||||
\ . ale#Pad(l:r_option)
|
\ . ale#Pad(l:r_option)
|
||||||
@ -57,8 +52,7 @@ function! ale_linters#cs#csc#Handle(buffer, lines) abort
|
|||||||
\ '^\v([^ ]+)\s+([Cc][sS][^ ]+):\s+(.+)$',
|
\ '^\v([^ ]+)\s+([Cc][sS][^ ]+):\s+(.+)$',
|
||||||
\]
|
\]
|
||||||
let l:output = []
|
let l:output = []
|
||||||
|
let l:dir = ale_linters#cs#csc#GetCwd(a:buffer)
|
||||||
let l:dir = s:GetWorkingDirectory(a:buffer)
|
|
||||||
|
|
||||||
for l:match in ale#util#GetMatches(a:lines, l:patterns)
|
for l:match in ale#util#GetMatches(a:lines, l:patterns)
|
||||||
if len(l:match) > 6 && strlen(l:match[5]) > 2 && l:match[5][:1] is? 'CS'
|
if len(l:match) > 6 && strlen(l:match[5]) > 2 && l:match[5][:1] is? 'CS'
|
||||||
@ -89,6 +83,7 @@ call ale#linter#Define('cs',{
|
|||||||
\ 'name': 'csc',
|
\ 'name': 'csc',
|
||||||
\ 'output_stream': 'stdout',
|
\ 'output_stream': 'stdout',
|
||||||
\ 'executable': 'csc',
|
\ 'executable': 'csc',
|
||||||
|
\ 'cwd': function('ale_linters#cs#csc#GetCwd'),
|
||||||
\ 'command': function('ale_linters#cs#csc#GetCommand'),
|
\ 'command': function('ale_linters#cs#csc#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#cs#csc#Handle',
|
\ 'callback': 'ale_linters#cs#csc#Handle',
|
||||||
\ 'lint_file': 1
|
\ 'lint_file': 1
|
||||||
|
@ -3,14 +3,10 @@ call ale#Set('cs_mcsc_source', '')
|
|||||||
call ale#Set('cs_mcsc_assembly_path', [])
|
call ale#Set('cs_mcsc_assembly_path', [])
|
||||||
call ale#Set('cs_mcsc_assemblies', [])
|
call ale#Set('cs_mcsc_assemblies', [])
|
||||||
|
|
||||||
function! s:GetWorkingDirectory(buffer) abort
|
function! ale_linters#cs#mcsc#GetCwd(buffer) abort
|
||||||
let l:working_directory = ale#Var(a:buffer, 'cs_mcsc_source')
|
let l:cwd = ale#Var(a:buffer, 'cs_mcsc_source')
|
||||||
|
|
||||||
if !empty(l:working_directory)
|
return !empty(l:cwd) ? l:cwd : expand('#' . a:buffer . ':p:h')
|
||||||
return l:working_directory
|
|
||||||
endif
|
|
||||||
|
|
||||||
return expand('#' . a:buffer . ':p:h')
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#cs#mcsc#GetCommand(buffer) abort
|
function! ale_linters#cs#mcsc#GetCommand(buffer) abort
|
||||||
@ -34,8 +30,7 @@ function! ale_linters#cs#mcsc#GetCommand(buffer) abort
|
|||||||
|
|
||||||
" The code is compiled as a module and the output is redirected to a
|
" The code is compiled as a module and the output is redirected to a
|
||||||
" temporary file.
|
" temporary file.
|
||||||
return ale#path#CdString(s:GetWorkingDirectory(a:buffer))
|
return 'mcs -unsafe'
|
||||||
\ . 'mcs -unsafe'
|
|
||||||
\ . ale#Pad(ale#Var(a:buffer, 'cs_mcsc_options'))
|
\ . ale#Pad(ale#Var(a:buffer, 'cs_mcsc_options'))
|
||||||
\ . ale#Pad(l:lib_option)
|
\ . ale#Pad(l:lib_option)
|
||||||
\ . ale#Pad(l:r_option)
|
\ . ale#Pad(l:r_option)
|
||||||
@ -58,7 +53,7 @@ function! ale_linters#cs#mcsc#Handle(buffer, lines) abort
|
|||||||
\]
|
\]
|
||||||
let l:output = []
|
let l:output = []
|
||||||
|
|
||||||
let l:dir = s:GetWorkingDirectory(a:buffer)
|
let l:dir = ale_linters#cs#mcsc#GetCwd(a:buffer)
|
||||||
|
|
||||||
for l:match in ale#util#GetMatches(a:lines, l:patterns)
|
for l:match in ale#util#GetMatches(a:lines, l:patterns)
|
||||||
if len(l:match) > 6 && strlen(l:match[5]) > 2 && l:match[5][:1] is? 'CS'
|
if len(l:match) > 6 && strlen(l:match[5]) > 2 && l:match[5][:1] is? 'CS'
|
||||||
@ -89,6 +84,7 @@ call ale#linter#Define('cs',{
|
|||||||
\ 'name': 'mcsc',
|
\ 'name': 'mcsc',
|
||||||
\ 'output_stream': 'stderr',
|
\ 'output_stream': 'stderr',
|
||||||
\ 'executable': 'mcs',
|
\ 'executable': 'mcs',
|
||||||
|
\ 'cwd': function('ale_linters#cs#mcsc#GetCwd'),
|
||||||
\ 'command': function('ale_linters#cs#mcsc#GetCommand'),
|
\ 'command': function('ale_linters#cs#mcsc#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#cs#mcsc#Handle',
|
\ 'callback': 'ale_linters#cs#mcsc#Handle',
|
||||||
\ 'lint_file': 1
|
\ 'lint_file': 1
|
||||||
|
@ -11,7 +11,7 @@ endfunction
|
|||||||
|
|
||||||
call ale#linter#Define('css', {
|
call ale#linter#Define('css', {
|
||||||
\ 'name': 'stylelint',
|
\ 'name': 'stylelint',
|
||||||
\ 'executable': {b -> ale#node#FindExecutable(b, 'css_stylelint', [
|
\ 'executable': {b -> ale#path#FindExecutable(b, 'css_stylelint', [
|
||||||
\ 'node_modules/.bin/stylelint',
|
\ 'node_modules/.bin/stylelint',
|
||||||
\ ])},
|
\ ])},
|
||||||
\ 'command': function('ale_linters#css#stylelint#GetCommand'),
|
\ 'command': function('ale_linters#css#stylelint#GetCommand'),
|
||||||
|
23
sources_non_forked/ale/ale_linters/cuda/clangd.vim
Normal file
23
sources_non_forked/ale/ale_linters/cuda/clangd.vim
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
" Author: Tommy Chiang <ty1208chiang@gmail.com>
|
||||||
|
" Description: Clangd language server for CUDA (modified from Andrey
|
||||||
|
" Melentyev's implementation for C++)
|
||||||
|
|
||||||
|
call ale#Set('cuda_clangd_executable', 'clangd')
|
||||||
|
call ale#Set('cuda_clangd_options', '')
|
||||||
|
call ale#Set('c_build_dir', '')
|
||||||
|
|
||||||
|
function! ale_linters#cuda#clangd#GetCommand(buffer) abort
|
||||||
|
let l:build_dir = ale#c#GetBuildDirectory(a:buffer)
|
||||||
|
|
||||||
|
return '%e'
|
||||||
|
\ . ale#Pad(ale#Var(a:buffer, 'cuda_clangd_options'))
|
||||||
|
\ . (!empty(l:build_dir) ? ' -compile-commands-dir=' . ale#Escape(l:build_dir) : '')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('cuda', {
|
||||||
|
\ 'name': 'clangd',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'cuda_clangd_executable')},
|
||||||
|
\ 'command': function('ale_linters#cuda#clangd#GetCommand'),
|
||||||
|
\ 'project_root': function('ale#c#FindProjectRoot'),
|
||||||
|
\})
|
@ -1,64 +1,106 @@
|
|||||||
" Author: w0rp <devw0rp@gmail.com>
|
" Author: w0rp <devw0rp@gmail.com>
|
||||||
" Description: "dmd for D files"
|
" Description: "dmd for D files"
|
||||||
|
|
||||||
function! ale_linters#d#dmd#GetDUBCommand(buffer) abort
|
function! s:GetDUBCommand(buffer) abort
|
||||||
" If we can't run dub, then skip this command.
|
" If we can't run dub, then skip this command.
|
||||||
if !executable('dub')
|
if executable('dub')
|
||||||
" Returning an empty string skips to the DMD command.
|
" Returning an empty string skips to the DMD command.
|
||||||
return ''
|
let l:config = ale#d#FindDUBConfig(a:buffer)
|
||||||
|
|
||||||
|
" To support older dub versions, we just change the directory to the
|
||||||
|
" directory where we found the dub config, and then run `dub describe`
|
||||||
|
" from that directory.
|
||||||
|
if !empty(l:config)
|
||||||
|
return [fnamemodify(l:config, ':h'), 'dub describe --data-list
|
||||||
|
\ --data=import-paths
|
||||||
|
\ --data=string-import-paths
|
||||||
|
\ --data=versions
|
||||||
|
\ --data=debug-versions
|
||||||
|
\']
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let l:dub_file = ale#d#FindDUBConfig(a:buffer)
|
return ['', '']
|
||||||
|
|
||||||
if empty(l:dub_file)
|
|
||||||
return ''
|
|
||||||
endif
|
|
||||||
|
|
||||||
" To support older dub versions, we just change the directory to
|
|
||||||
" the directory where we found the dub config, and then run `dub describe`
|
|
||||||
" from that directory.
|
|
||||||
return 'cd ' . ale#Escape(fnamemodify(l:dub_file, ':h'))
|
|
||||||
\ . ' && dub describe --import-paths'
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#d#dmd#RunDUBCommand(buffer) abort
|
function! ale_linters#d#dmd#RunDUBCommand(buffer) abort
|
||||||
let l:command = ale_linters#d#dmd#GetDUBCommand(a:buffer)
|
let [l:cwd, l:command] = s:GetDUBCommand(a:buffer)
|
||||||
|
|
||||||
if empty(l:command)
|
if empty(l:command)
|
||||||
" If we can't run DUB, just run DMD.
|
" If we can't run DUB, just run DMD.
|
||||||
return ale_linters#d#dmd#DMDCommand(a:buffer, [], {})
|
return ale_linters#d#dmd#DMDCommand(a:buffer, [], {})
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return ale#command#Run(a:buffer, l:command, function('ale_linters#d#dmd#DMDCommand'))
|
return ale#command#Run(
|
||||||
|
\ a:buffer,
|
||||||
|
\ l:command,
|
||||||
|
\ function('ale_linters#d#dmd#DMDCommand'),
|
||||||
|
\ {'cwd': l:cwd},
|
||||||
|
\)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#d#dmd#DMDCommand(buffer, dub_output, meta) abort
|
function! ale_linters#d#dmd#DMDCommand(buffer, dub_output, meta) abort
|
||||||
let l:import_list = []
|
let l:import_list = []
|
||||||
|
let l:str_import_list = []
|
||||||
|
let l:versions_list = []
|
||||||
|
let l:deb_versions_list = []
|
||||||
|
let l:list_ind = 1
|
||||||
|
let l:seen_line = 0
|
||||||
|
|
||||||
" Build a list of import paths generated from DUB, if available.
|
" Build a list of options generated from DUB, if available.
|
||||||
|
" DUB output each path or version on a single line.
|
||||||
|
" Each list is separated by a blank line.
|
||||||
|
" Empty list are represented by a blank line (followed and/or
|
||||||
|
" preceded by a separation blank line)
|
||||||
for l:line in a:dub_output
|
for l:line in a:dub_output
|
||||||
|
" line still has end of line char on windows
|
||||||
|
let l:line = substitute(l:line, '[\r\n]*$', '', '')
|
||||||
|
|
||||||
if !empty(l:line)
|
if !empty(l:line)
|
||||||
" The arguments must be '-Ifilename', not '-I filename'
|
if l:list_ind == 1
|
||||||
call add(l:import_list, '-I' . ale#Escape(l:line))
|
call add(l:import_list, '-I' . ale#Escape(l:line))
|
||||||
|
elseif l:list_ind == 2
|
||||||
|
call add(l:str_import_list, '-J' . ale#Escape(l:line))
|
||||||
|
elseif l:list_ind == 3
|
||||||
|
call add(l:versions_list, '-version=' . ale#Escape(l:line))
|
||||||
|
elseif l:list_ind == 4
|
||||||
|
call add(l:deb_versions_list, '-debug=' . ale#Escape(l:line))
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:seen_line = 1
|
||||||
|
elseif !l:seen_line
|
||||||
|
" if list is empty must skip one empty line
|
||||||
|
let l:seen_line = 1
|
||||||
|
else
|
||||||
|
let l:seen_line = 0
|
||||||
|
let l:list_ind += 1
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
return 'dmd '. join(l:import_list) . ' -o- -wi -vcolumns -c %t'
|
return 'dmd ' . join(l:import_list) . ' ' .
|
||||||
|
\ join(l:str_import_list) . ' ' .
|
||||||
|
\ join(l:versions_list) . ' ' .
|
||||||
|
\ join(l:deb_versions_list) . ' -o- -wi -vcolumns -c %t'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#d#dmd#Handle(buffer, lines) abort
|
function! ale_linters#d#dmd#Handle(buffer, lines) abort
|
||||||
" Matches patterns lines like the following:
|
" Matches patterns lines like the following:
|
||||||
" /tmp/tmp.qclsa7qLP7/file.d(1): Error: function declaration without return type. (Note that constructors are always named 'this')
|
" /tmp/tmp.qclsa7qLP7/file.d(1): Error: function declaration without return type. (Note that constructors are always named 'this')
|
||||||
" /tmp/tmp.G1L5xIizvB.d(8,8): Error: module weak_reference is in file 'dstruct/weak_reference.d' which cannot be read
|
" /tmp/tmp.G1L5xIizvB.d(8,8): Error: module weak_reference is in file 'dstruct/weak_reference.d' which cannot be read
|
||||||
let l:pattern = '^[^(]\+(\([0-9]\+\)\,\?\([0-9]*\)): \([^:]\+\): \(.\+\)'
|
let l:pattern = '\v^(\f+)\((\d+)(,(\d+))?\): (\w+): (.+)$'
|
||||||
let l:output = []
|
let l:output = []
|
||||||
|
let l:dir = expand('#' . a:buffer . ':p:h')
|
||||||
|
|
||||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||||
|
" If dmd was invoked with relative path, match[1] is relative, otherwise it is absolute.
|
||||||
|
" As we invoke dmd with the buffer path (in /tmp), this will generally be absolute already
|
||||||
|
let l:fname = ale#path#GetAbsPath(l:dir, l:match[1])
|
||||||
call add(l:output, {
|
call add(l:output, {
|
||||||
\ 'lnum': l:match[1],
|
\ 'filename': l:fname,
|
||||||
\ 'col': l:match[2],
|
\ 'lnum': l:match[2],
|
||||||
\ 'type': l:match[3] is# 'Warning' ? 'W' : 'E',
|
\ 'col': l:match[4],
|
||||||
\ 'text': l:match[4],
|
\ 'type': l:match[5] is# 'Warning' || l:match[5] is# 'Deprecation' ? 'W' : 'E',
|
||||||
|
\ 'text': l:match[6],
|
||||||
\})
|
\})
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ function! ale_linters#dafny#dafny#Handle(buffer, lines) abort
|
|||||||
|
|
||||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||||
call add(l:output, {
|
call add(l:output, {
|
||||||
\ 'bufnr': a:buffer,
|
\ 'filename': l:match[1],
|
||||||
\ 'col': l:match[3] + 0,
|
\ 'col': l:match[3] + 0,
|
||||||
\ 'lnum': l:match[2] + 0,
|
\ 'lnum': l:match[2] + 0,
|
||||||
\ 'text': l:match[5],
|
\ 'text': l:match[5],
|
||||||
@ -14,13 +14,28 @@ function! ale_linters#dafny#dafny#Handle(buffer, lines) abort
|
|||||||
\ })
|
\ })
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
|
for l:match in ale#util#GetMatches(a:lines, '\v(.*)\((\d+),(\d+)\): (Verification of .{-} timed out after \d+ seconds)')
|
||||||
|
call add(l:output, {
|
||||||
|
\ 'filename': l:match[1],
|
||||||
|
\ 'col': l:match[3] + 0,
|
||||||
|
\ 'lnum': l:match[2] + 0,
|
||||||
|
\ 'text': l:match[4],
|
||||||
|
\ 'type': 'E',
|
||||||
|
\ })
|
||||||
|
endfor
|
||||||
|
|
||||||
return l:output
|
return l:output
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#dafny#dafny#GetCommand(buffer) abort
|
||||||
|
return printf('dafny %%s /compile:0 /timeLimit:%d', ale#Var(a:buffer, 'dafny_dafny_timelimit'))
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#Set('dafny_dafny_timelimit', 10)
|
||||||
call ale#linter#Define('dafny', {
|
call ale#linter#Define('dafny', {
|
||||||
\ 'name': 'dafny',
|
\ 'name': 'dafny',
|
||||||
\ 'executable': 'dafny',
|
\ 'executable': 'dafny',
|
||||||
\ 'command': 'dafny %s /compile:0',
|
\ 'command': function('ale_linters#dafny#dafny#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#dafny#dafny#Handle',
|
\ 'callback': 'ale_linters#dafny#dafny#Handle',
|
||||||
\ 'lint_file': 1,
|
\ 'lint_file': 1,
|
||||||
\ })
|
\ })
|
||||||
|
29
sources_non_forked/ale/ale_linters/dart/analysis_server.vim
Normal file
29
sources_non_forked/ale/ale_linters/dart/analysis_server.vim
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
" Author: Nelson Yeung <nelsyeung@gmail.com>
|
||||||
|
" Description: Check Dart files with dart analysis server LSP
|
||||||
|
|
||||||
|
call ale#Set('dart_analysis_server_executable', 'dart')
|
||||||
|
|
||||||
|
function! ale_linters#dart#analysis_server#GetProjectRoot(buffer) abort
|
||||||
|
" Note: pub only looks for pubspec.yaml, there's no point in adding
|
||||||
|
" support for pubspec.yml
|
||||||
|
let l:pubspec = ale#path#FindNearestFile(a:buffer, 'pubspec.yaml')
|
||||||
|
|
||||||
|
return !empty(l:pubspec) ? fnamemodify(l:pubspec, ':h:h') : '.'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#dart#analysis_server#GetCommand(buffer) abort
|
||||||
|
let l:executable = ale#Var(a:buffer, 'dart_analysis_server_executable')
|
||||||
|
let l:dart = resolve(exepath(l:executable))
|
||||||
|
|
||||||
|
return '%e '
|
||||||
|
\ . fnamemodify(l:dart, ':h') . '/snapshots/analysis_server.dart.snapshot'
|
||||||
|
\ . ' --lsp'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('dart', {
|
||||||
|
\ 'name': 'analysis_server',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'dart_analysis_server_executable')},
|
||||||
|
\ 'command': function('ale_linters#dart#analysis_server#GetCommand'),
|
||||||
|
\ 'project_root': function('ale_linters#dart#analysis_server#GetProjectRoot'),
|
||||||
|
\})
|
@ -0,0 +1,31 @@
|
|||||||
|
call ale#Set('desktop_desktop_file_validate_options', '')
|
||||||
|
|
||||||
|
" Example matches for pattern:
|
||||||
|
"
|
||||||
|
" foo.desktop: warning: key "TerminalOptions" in group ...
|
||||||
|
" foo.desktop: error: action "new-private-window" is defined, ...
|
||||||
|
let s:pattern = '\v^(.+): ([a-z]+): (.+)$'
|
||||||
|
|
||||||
|
function! ale_linters#desktop#desktop_file_validate#Handle(buffer, lines) abort
|
||||||
|
" The error format doesn't specify lines, so we can just put all of the
|
||||||
|
" errors on line 1.
|
||||||
|
return ale#util#MapMatches(a:lines, s:pattern, {match -> {
|
||||||
|
\ 'lnum': 1,
|
||||||
|
\ 'col': 1,
|
||||||
|
\ 'type': match[2] is? 'error' ? 'E' : 'W',
|
||||||
|
\ 'text': match[3],
|
||||||
|
\}})
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('desktop', {
|
||||||
|
\ 'name': 'desktop_file_validate',
|
||||||
|
\ 'aliases': ['desktop-file-validate'],
|
||||||
|
\ 'executable': 'desktop-file-validate',
|
||||||
|
\ 'command': {b ->
|
||||||
|
\ '%e'
|
||||||
|
\ . ale#Pad(ale#Var(b, 'desktop_desktop_file_validate_options'))
|
||||||
|
\ . ' %t'
|
||||||
|
\ },
|
||||||
|
\ 'callback': 'ale_linters#desktop#desktop_file_validate#Handle',
|
||||||
|
\ 'output_stream': 'both',
|
||||||
|
\})
|
@ -9,7 +9,7 @@ function! ale_linters#dockerfile#hadolint#Handle(buffer, lines) abort
|
|||||||
"
|
"
|
||||||
" /dev/stdin:19 DL3001 Pipe chain should start with a raw value.
|
" /dev/stdin:19 DL3001 Pipe chain should start with a raw value.
|
||||||
" /dev/stdin:19:3 unexpected thing
|
" /dev/stdin:19:3 unexpected thing
|
||||||
let l:pattern = '\v^/dev/stdin:(\d+):?(\d+)? ((DL|SC)(\d+) )?(.+)$'
|
let l:pattern = '\v^%(/dev/stdin|-):(\d+):?(\d+)? ((DL|SC)(\d+) )?((.+)?: )?(.+)$'
|
||||||
let l:output = []
|
let l:output = []
|
||||||
|
|
||||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||||
@ -24,9 +24,19 @@ function! ale_linters#dockerfile#hadolint#Handle(buffer, lines) abort
|
|||||||
let l:colnum = l:match[2] + 0
|
let l:colnum = l:match[2] + 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let l:type = 'W'
|
" Shellcheck knows a 'style' severity - pin it to info level as well.
|
||||||
let l:text = l:match[6]
|
if l:match[7] is# 'style'
|
||||||
let l:detail = l:match[6]
|
let l:type = 'I'
|
||||||
|
elseif l:match[7] is# 'info'
|
||||||
|
let l:type = 'I'
|
||||||
|
elseif l:match[7] is# 'warning'
|
||||||
|
let l:type = 'W'
|
||||||
|
else
|
||||||
|
let l:type = 'E'
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:text = l:match[8]
|
||||||
|
let l:detail = l:match[8]
|
||||||
let l:domain = 'https://github.com/hadolint/hadolint/wiki/'
|
let l:domain = 'https://github.com/hadolint/hadolint/wiki/'
|
||||||
|
|
||||||
if l:match[4] is# 'SC'
|
if l:match[4] is# 'SC'
|
||||||
@ -82,12 +92,15 @@ endfunction
|
|||||||
|
|
||||||
function! ale_linters#dockerfile#hadolint#GetCommand(buffer) abort
|
function! ale_linters#dockerfile#hadolint#GetCommand(buffer) abort
|
||||||
let l:command = ale_linters#dockerfile#hadolint#GetExecutable(a:buffer)
|
let l:command = ale_linters#dockerfile#hadolint#GetExecutable(a:buffer)
|
||||||
|
let l:opts = '--no-color -'
|
||||||
|
|
||||||
if l:command is# 'docker'
|
if l:command is# 'docker'
|
||||||
return 'docker run --rm -i ' . ale#Var(a:buffer, 'dockerfile_hadolint_docker_image')
|
return printf('docker run --rm -i %s hadolint %s',
|
||||||
|
\ ale#Var(a:buffer, 'dockerfile_hadolint_docker_image'),
|
||||||
|
\ l:opts)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return 'hadolint -'
|
return 'hadolint ' . l:opts
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
@ -45,19 +45,27 @@ function! ale_linters#elixir#credo#GetMode() abort
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#elixir#credo#GetCommand(buffer) abort
|
function! ale_linters#elixir#credo#GetConfigFile() abort
|
||||||
let l:project_root = ale#handlers#elixir#FindMixUmbrellaRoot(a:buffer)
|
let l:config_file = get(g:, 'ale_elixir_credo_config_file', '')
|
||||||
let l:mode = ale_linters#elixir#credo#GetMode()
|
|
||||||
|
|
||||||
return ale#path#CdString(l:project_root)
|
if empty(l:config_file)
|
||||||
\ . 'mix help credo && '
|
return ''
|
||||||
|
endif
|
||||||
|
|
||||||
|
return ' --config-file ' . l:config_file
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#elixir#credo#GetCommand(buffer) abort
|
||||||
|
return 'mix help credo && '
|
||||||
\ . 'mix credo ' . ale_linters#elixir#credo#GetMode()
|
\ . 'mix credo ' . ale_linters#elixir#credo#GetMode()
|
||||||
|
\ . ale_linters#elixir#credo#GetConfigFile()
|
||||||
\ . ' --format=flycheck --read-from-stdin %s'
|
\ . ' --format=flycheck --read-from-stdin %s'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('elixir', {
|
call ale#linter#Define('elixir', {
|
||||||
\ 'name': 'credo',
|
\ 'name': 'credo',
|
||||||
\ 'executable': 'mix',
|
\ 'executable': 'mix',
|
||||||
|
\ 'cwd': function('ale#handlers#elixir#FindMixUmbrellaRoot'),
|
||||||
\ 'command': function('ale_linters#elixir#credo#GetCommand'),
|
\ 'command': function('ale_linters#elixir#credo#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#elixir#credo#Handle',
|
\ 'callback': 'ale_linters#elixir#credo#Handle',
|
||||||
\})
|
\})
|
||||||
|
@ -25,17 +25,10 @@ function! ale_linters#elixir#dialyxir#Handle(buffer, lines) abort
|
|||||||
return l:output
|
return l:output
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#elixir#dialyxir#GetCommand(buffer) abort
|
|
||||||
let l:project_root = ale#handlers#elixir#FindMixProjectRoot(a:buffer)
|
|
||||||
|
|
||||||
return ale#path#CdString(l:project_root)
|
|
||||||
\ . ' mix help dialyzer && mix dialyzer'
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
call ale#linter#Define('elixir', {
|
call ale#linter#Define('elixir', {
|
||||||
\ 'name': 'dialyxir',
|
\ 'name': 'dialyxir',
|
||||||
\ 'executable': 'mix',
|
\ 'executable': 'mix',
|
||||||
\ 'command': function('ale_linters#elixir#dialyxir#GetCommand'),
|
\ 'cwd': function('ale#handlers#elixir#FindMixProjectRoot'),
|
||||||
|
\ 'command': 'mix help dialyzer && mix dialyzer',
|
||||||
\ 'callback': 'ale_linters#elixir#dialyxir#Handle',
|
\ 'callback': 'ale_linters#elixir#dialyxir#Handle',
|
||||||
\})
|
\})
|
||||||
|
|
||||||
|
@ -29,17 +29,11 @@ function! ale_linters#elixir#dogma#Handle(buffer, lines) abort
|
|||||||
return l:output
|
return l:output
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#elixir#dogma#GetCommand(buffer) abort
|
|
||||||
let l:project_root = ale#handlers#elixir#FindMixProjectRoot(a:buffer)
|
|
||||||
|
|
||||||
return ale#path#CdString(l:project_root)
|
|
||||||
\ . ' mix help dogma && mix dogma %s --format=flycheck'
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
call ale#linter#Define('elixir', {
|
call ale#linter#Define('elixir', {
|
||||||
\ 'name': 'dogma',
|
\ 'name': 'dogma',
|
||||||
\ 'executable': 'mix',
|
\ 'executable': 'mix',
|
||||||
\ 'command': function('ale_linters#elixir#dogma#GetCommand'),
|
\ 'cwd': function('ale#handlers#elixir#FindMixProjectRoot'),
|
||||||
|
\ 'command': 'mix help dogma && mix dogma %s --format=flycheck',
|
||||||
\ 'lint_file': 1,
|
\ 'lint_file': 1,
|
||||||
\ 'callback': 'ale_linters#elixir#dogma#Handle',
|
\ 'callback': 'ale_linters#elixir#dogma#Handle',
|
||||||
\})
|
\})
|
||||||
|
@ -30,22 +30,15 @@ function! ale_linters#elixir#mix#Handle(buffer, lines) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#elixir#mix#GetCommand(buffer) abort
|
function! ale_linters#elixir#mix#GetCommand(buffer) abort
|
||||||
let l:project_root = ale#handlers#elixir#FindMixProjectRoot(a:buffer)
|
|
||||||
|
|
||||||
let l:temp_dir = ale#command#CreateDirectory(a:buffer)
|
let l:temp_dir = ale#command#CreateDirectory(a:buffer)
|
||||||
|
|
||||||
let l:mix_build_path = has('win32')
|
return ale#Env('MIX_BUILD_PATH', l:temp_dir) . 'mix compile %s'
|
||||||
\ ? '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
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('elixir', {
|
call ale#linter#Define('elixir', {
|
||||||
\ 'name': 'mix',
|
\ 'name': 'mix',
|
||||||
\ 'executable': 'mix',
|
\ 'executable': 'mix',
|
||||||
|
\ 'cwd': function('ale#handlers#elixir#FindMixProjectRoot'),
|
||||||
\ 'command': function('ale_linters#elixir#mix#GetCommand'),
|
\ 'command': function('ale_linters#elixir#mix#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#elixir#mix#Handle',
|
\ 'callback': 'ale_linters#elixir#mix#Handle',
|
||||||
\ 'lint_file': 1,
|
\ 'lint_file': 1,
|
||||||
|
@ -28,7 +28,7 @@ endfunction
|
|||||||
call ale#linter#Define('elm', {
|
call ale#linter#Define('elm', {
|
||||||
\ 'name': 'elm_ls',
|
\ 'name': 'elm_ls',
|
||||||
\ 'lsp': 'stdio',
|
\ 'lsp': 'stdio',
|
||||||
\ 'executable': {b -> ale#node#FindExecutable(b, 'elm_ls', [
|
\ 'executable': {b -> ale#path#FindExecutable(b, 'elm_ls', [
|
||||||
\ 'node_modules/.bin/elm-language-server',
|
\ 'node_modules/.bin/elm-language-server',
|
||||||
\ 'node_modules/.bin/elm-lsp',
|
\ 'node_modules/.bin/elm-lsp',
|
||||||
\ 'elm-lsp'
|
\ 'elm-lsp'
|
||||||
|
@ -186,24 +186,23 @@ function! ale_linters#elm#make#IsTest(buffer) abort
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#elm#make#GetCwd(buffer) abort
|
||||||
|
let l:root_dir = ale_linters#elm#make#GetRootDir(a:buffer)
|
||||||
|
|
||||||
|
return !empty(l:root_dir) ? l:root_dir : ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
" Return the command to execute the linter in the projects directory.
|
" Return the command to execute the linter in the projects directory.
|
||||||
" If it doesn't, then this will fail when imports are needed.
|
" If it doesn't, then this will fail when imports are needed.
|
||||||
function! ale_linters#elm#make#GetCommand(buffer) abort
|
function! ale_linters#elm#make#GetCommand(buffer) abort
|
||||||
let l:executable = ale_linters#elm#make#GetExecutable(a:buffer)
|
let l:executable = ale_linters#elm#make#GetExecutable(a:buffer)
|
||||||
let l:root_dir = ale_linters#elm#make#GetRootDir(a:buffer)
|
|
||||||
let l:is_v19 = ale_linters#elm#make#IsVersionGte19(a:buffer)
|
let l:is_v19 = ale_linters#elm#make#IsVersionGte19(a:buffer)
|
||||||
let l:is_using_elm_test = l:executable =~# 'elm-test$'
|
let l:is_using_elm_test = l:executable =~# 'elm-test$'
|
||||||
|
|
||||||
if empty(l:root_dir)
|
|
||||||
let l:dir_set_cmd = ''
|
|
||||||
else
|
|
||||||
let l:dir_set_cmd = 'cd ' . ale#Escape(l:root_dir) . ' && '
|
|
||||||
endif
|
|
||||||
|
|
||||||
" elm-test needs to know the path of elm-make if elm isn't installed globally.
|
" elm-test needs to know the path of elm-make if elm isn't installed globally.
|
||||||
" https://github.com/rtfeldman/node-test-runner/blob/57728f10668f2d2ab3179e7e3208bcfa9a1f19aa/README.md#--compiler
|
" https://github.com/rtfeldman/node-test-runner/blob/57728f10668f2d2ab3179e7e3208bcfa9a1f19aa/README.md#--compiler
|
||||||
if l:is_v19 && l:is_using_elm_test
|
if l:is_v19 && l:is_using_elm_test
|
||||||
let l:elm_make_executable = ale#node#FindExecutable(a:buffer, 'elm_make', ['node_modules/.bin/elm'])
|
let l:elm_make_executable = ale#path#FindExecutable(a:buffer, 'elm_make', ['node_modules/.bin/elm'])
|
||||||
let l:elm_test_compiler_flag = ' --compiler ' . l:elm_make_executable . ' '
|
let l:elm_test_compiler_flag = ' --compiler ' . l:elm_make_executable . ' '
|
||||||
else
|
else
|
||||||
let l:elm_test_compiler_flag = ' '
|
let l:elm_test_compiler_flag = ' '
|
||||||
@ -213,7 +212,9 @@ function! ale_linters#elm#make#GetCommand(buffer) abort
|
|||||||
" a sort of flag to tell the compiler not to generate an output file,
|
" a sort of flag to tell the compiler not to generate an output file,
|
||||||
" which is why this is hard coded here.
|
" which is why this is hard coded here.
|
||||||
" Source: https://github.com/elm-lang/elm-compiler/blob/19d5a769b30ec0b2fc4475985abb4cd94cd1d6c3/builder/src/Generate/Output.hs#L253
|
" Source: https://github.com/elm-lang/elm-compiler/blob/19d5a769b30ec0b2fc4475985abb4cd94cd1d6c3/builder/src/Generate/Output.hs#L253
|
||||||
return l:dir_set_cmd . '%e make --report=json --output=/dev/null' . l:elm_test_compiler_flag . '%t'
|
return '%e make --report=json --output=/dev/null'
|
||||||
|
\ . l:elm_test_compiler_flag
|
||||||
|
\ . '%t'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#elm#make#GetExecutable(buffer) abort
|
function! ale_linters#elm#make#GetExecutable(buffer) abort
|
||||||
@ -221,13 +222,13 @@ function! ale_linters#elm#make#GetExecutable(buffer) abort
|
|||||||
let l:is_v19 = ale_linters#elm#make#IsVersionGte19(a:buffer)
|
let l:is_v19 = ale_linters#elm#make#IsVersionGte19(a:buffer)
|
||||||
|
|
||||||
if l:is_test && l:is_v19
|
if l:is_test && l:is_v19
|
||||||
return ale#node#FindExecutable(
|
return ale#path#FindExecutable(
|
||||||
\ a:buffer,
|
\ a:buffer,
|
||||||
\ 'elm_make',
|
\ 'elm_make',
|
||||||
\ ['node_modules/.bin/elm-test', 'node_modules/.bin/elm']
|
\ ['node_modules/.bin/elm-test', 'node_modules/.bin/elm']
|
||||||
\)
|
\)
|
||||||
else
|
else
|
||||||
return ale#node#FindExecutable(a:buffer, 'elm_make', ['node_modules/.bin/elm'])
|
return ale#path#FindExecutable(a:buffer, 'elm_make', ['node_modules/.bin/elm'])
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@ -235,6 +236,7 @@ call ale#linter#Define('elm', {
|
|||||||
\ 'name': 'make',
|
\ 'name': 'make',
|
||||||
\ 'executable': function('ale_linters#elm#make#GetExecutable'),
|
\ 'executable': function('ale_linters#elm#make#GetExecutable'),
|
||||||
\ 'output_stream': 'both',
|
\ 'output_stream': 'both',
|
||||||
|
\ 'cwd': function('ale_linters#elm#make#GetCwd'),
|
||||||
\ 'command': function('ale_linters#elm#make#GetCommand'),
|
\ 'command': function('ale_linters#elm#make#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#elm#make#Handle'
|
\ 'callback': 'ale_linters#elm#make#Handle'
|
||||||
\})
|
\})
|
||||||
|
@ -3,6 +3,11 @@
|
|||||||
|
|
||||||
let g:ale_erlang_dialyzer_executable =
|
let g:ale_erlang_dialyzer_executable =
|
||||||
\ get(g:, 'ale_erlang_dialyzer_executable', 'dialyzer')
|
\ get(g:, 'ale_erlang_dialyzer_executable', 'dialyzer')
|
||||||
|
let g:ale_erlang_dialyzer_options =
|
||||||
|
\ get(g:, 'ale_erlang_dialyzer_options', '-Wunmatched_returns'
|
||||||
|
\ . ' -Werror_handling'
|
||||||
|
\ . ' -Wrace_conditions'
|
||||||
|
\ . ' -Wunderspecs')
|
||||||
let g:ale_erlang_dialyzer_plt_file =
|
let g:ale_erlang_dialyzer_plt_file =
|
||||||
\ get(g:, 'ale_erlang_dialyzer_plt_file', '')
|
\ get(g:, 'ale_erlang_dialyzer_plt_file', '')
|
||||||
let g:ale_erlang_dialyzer_rebar3_profile =
|
let g:ale_erlang_dialyzer_rebar3_profile =
|
||||||
@ -54,13 +59,12 @@ function! ale_linters#erlang#dialyzer#GetExecutable(buffer) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#erlang#dialyzer#GetCommand(buffer) abort
|
function! ale_linters#erlang#dialyzer#GetCommand(buffer) abort
|
||||||
|
let l:options = ale#Var(a:buffer, 'erlang_dialyzer_options')
|
||||||
|
|
||||||
let l:command = ale#Escape(ale_linters#erlang#dialyzer#GetExecutable(a:buffer))
|
let l:command = ale#Escape(ale_linters#erlang#dialyzer#GetExecutable(a:buffer))
|
||||||
\ . ' -n'
|
\ . ' -n'
|
||||||
\ . ' --plt ' . ale#Escape(ale_linters#erlang#dialyzer#GetPlt(a:buffer))
|
\ . ' --plt ' . ale#Escape(ale_linters#erlang#dialyzer#GetPlt(a:buffer))
|
||||||
\ . ' -Wunmatched_returns'
|
\ . ' ' . l:options
|
||||||
\ . ' -Werror_handling'
|
|
||||||
\ . ' -Wrace_conditions'
|
|
||||||
\ . ' -Wunderspecs'
|
|
||||||
\ . ' %s'
|
\ . ' %s'
|
||||||
|
|
||||||
return l:command
|
return l:command
|
||||||
|
@ -1,14 +1,22 @@
|
|||||||
" Author: Magnus Ottenklinger - https://github.com/evnu
|
" Author: Magnus Ottenklinger - https://github.com/evnu
|
||||||
|
|
||||||
|
let g:ale_erlang_erlc_executable = get(g:, 'ale_erlang_erlc_executable', 'erlc')
|
||||||
let g:ale_erlang_erlc_options = get(g:, 'ale_erlang_erlc_options', '')
|
let g:ale_erlang_erlc_options = get(g:, 'ale_erlang_erlc_options', '')
|
||||||
|
|
||||||
|
function! ale_linters#erlang#erlc#GetExecutable(buffer) abort
|
||||||
|
return ale#Var(a:buffer, 'erlang_erlc_executable')
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#erlang#erlc#GetCommand(buffer) abort
|
function! ale_linters#erlang#erlc#GetCommand(buffer) abort
|
||||||
let l:output_file = ale#util#Tempname()
|
let l:output_file = ale#util#Tempname()
|
||||||
call ale#command#ManageFile(a:buffer, l:output_file)
|
call ale#command#ManageFile(a:buffer, l:output_file)
|
||||||
|
|
||||||
return 'erlc -o ' . ale#Escape(l:output_file)
|
let l:command = ale#Escape(ale_linters#erlang#erlc#GetExecutable(a:buffer))
|
||||||
\ . ' ' . ale#Var(a:buffer, 'erlang_erlc_options')
|
\ . ' -o ' . ale#Escape(l:output_file)
|
||||||
\ . ' %t'
|
\ . ' ' . ale#Var(a:buffer, 'erlang_erlc_options')
|
||||||
|
\ . ' %t'
|
||||||
|
|
||||||
|
return l:command
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#erlang#erlc#Handle(buffer, lines) abort
|
function! ale_linters#erlang#erlc#Handle(buffer, lines) abort
|
||||||
@ -90,7 +98,7 @@ endfunction
|
|||||||
|
|
||||||
call ale#linter#Define('erlang', {
|
call ale#linter#Define('erlang', {
|
||||||
\ 'name': 'erlc',
|
\ 'name': 'erlc',
|
||||||
\ 'executable': 'erlc',
|
\ 'executable': function('ale_linters#erlang#erlc#GetExecutable'),
|
||||||
\ 'command': function('ale_linters#erlang#erlc#GetCommand'),
|
\ 'command': function('ale_linters#erlang#erlc#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#erlang#erlc#Handle',
|
\ 'callback': 'ale_linters#erlang#erlc#Handle',
|
||||||
\})
|
\})
|
||||||
|
@ -10,8 +10,7 @@ function! ale_linters#go#gobuild#GetCommand(buffer) abort
|
|||||||
let l:options = ale#Var(a:buffer, 'go_gobuild_options')
|
let l:options = ale#Var(a:buffer, 'go_gobuild_options')
|
||||||
|
|
||||||
" Run go test in local directory with relative path
|
" Run go test in local directory with relative path
|
||||||
return ale#path#BufferCdString(a:buffer)
|
return ale#go#EnvString(a:buffer)
|
||||||
\ . ale#go#EnvString(a:buffer)
|
|
||||||
\ . ale#Var(a:buffer, 'go_go_executable') . ' test'
|
\ . ale#Var(a:buffer, 'go_go_executable') . ' test'
|
||||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||||
\ . ' -c -o /dev/null ./'
|
\ . ' -c -o /dev/null ./'
|
||||||
@ -50,6 +49,7 @@ call ale#linter#Define('go', {
|
|||||||
\ 'name': 'gobuild',
|
\ 'name': 'gobuild',
|
||||||
\ 'aliases': ['go build'],
|
\ 'aliases': ['go build'],
|
||||||
\ 'executable': {b -> ale#Var(b, 'go_go_executable')},
|
\ 'executable': {b -> ale#Var(b, 'go_go_executable')},
|
||||||
|
\ 'cwd': '%s:h',
|
||||||
\ 'command': function('ale_linters#go#gobuild#GetCommand'),
|
\ 'command': function('ale_linters#go#gobuild#GetCommand'),
|
||||||
\ 'output_stream': 'stderr',
|
\ 'output_stream': 'stderr',
|
||||||
\ 'callback': 'ale_linters#go#gobuild#Handler',
|
\ 'callback': 'ale_linters#go#gobuild#Handler',
|
||||||
|
@ -12,14 +12,12 @@ function! ale_linters#go#golangci_lint#GetCommand(buffer) abort
|
|||||||
|
|
||||||
|
|
||||||
if l:lint_package
|
if l:lint_package
|
||||||
return ale#path#BufferCdString(a:buffer)
|
return ale#go#EnvString(a:buffer)
|
||||||
\ . ale#go#EnvString(a:buffer)
|
|
||||||
\ . '%e run '
|
\ . '%e run '
|
||||||
\ . l:options
|
\ . l:options
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return ale#path#BufferCdString(a:buffer)
|
return ale#go#EnvString(a:buffer)
|
||||||
\ . ale#go#EnvString(a:buffer)
|
|
||||||
\ . '%e run '
|
\ . '%e run '
|
||||||
\ . ale#Escape(l:filename)
|
\ . ale#Escape(l:filename)
|
||||||
\ . ' ' . l:options
|
\ . ' ' . l:options
|
||||||
@ -53,6 +51,7 @@ endfunction
|
|||||||
call ale#linter#Define('go', {
|
call ale#linter#Define('go', {
|
||||||
\ 'name': 'golangci-lint',
|
\ 'name': 'golangci-lint',
|
||||||
\ 'executable': {b -> ale#Var(b, 'go_golangci_lint_executable')},
|
\ 'executable': {b -> ale#Var(b, 'go_golangci_lint_executable')},
|
||||||
|
\ 'cwd': '%s:h',
|
||||||
\ 'command': function('ale_linters#go#golangci_lint#GetCommand'),
|
\ 'command': function('ale_linters#go#golangci_lint#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#go#golangci_lint#Handler',
|
\ 'callback': 'ale_linters#go#golangci_lint#Handler',
|
||||||
\ 'lint_file': 1,
|
\ 'lint_file': 1,
|
||||||
|
@ -13,14 +13,12 @@ function! ale_linters#go#gometalinter#GetCommand(buffer) abort
|
|||||||
" BufferCdString is used so that we can be sure the paths output from gometalinter can
|
" BufferCdString is used so that we can be sure the paths output from gometalinter can
|
||||||
" be calculated to absolute paths in the Handler
|
" be calculated to absolute paths in the Handler
|
||||||
if l:lint_package
|
if l:lint_package
|
||||||
return ale#path#BufferCdString(a:buffer)
|
return ale#go#EnvString(a:buffer)
|
||||||
\ . ale#go#EnvString(a:buffer)
|
|
||||||
\ . '%e'
|
\ . '%e'
|
||||||
\ . (!empty(l:options) ? ' ' . l:options : '') . ' .'
|
\ . (!empty(l:options) ? ' ' . l:options : '') . ' .'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return ale#path#BufferCdString(a:buffer)
|
return ale#go#EnvString(a:buffer)
|
||||||
\ . ale#go#EnvString(a:buffer)
|
|
||||||
\ . '%e'
|
\ . '%e'
|
||||||
\ . ' --include=' . ale#Escape(ale#util#EscapePCRE(l:filename))
|
\ . ' --include=' . ale#Escape(ale#util#EscapePCRE(l:filename))
|
||||||
\ . (!empty(l:options) ? ' ' . l:options : '') . ' .'
|
\ . (!empty(l:options) ? ' ' . l:options : '') . ' .'
|
||||||
@ -53,6 +51,7 @@ endfunction
|
|||||||
call ale#linter#Define('go', {
|
call ale#linter#Define('go', {
|
||||||
\ 'name': 'gometalinter',
|
\ 'name': 'gometalinter',
|
||||||
\ 'executable': {b -> ale#Var(b, 'go_gometalinter_executable')},
|
\ 'executable': {b -> ale#Var(b, 'go_gometalinter_executable')},
|
||||||
|
\ 'cwd': '%s:h',
|
||||||
\ 'command': function('ale_linters#go#gometalinter#GetCommand'),
|
\ 'command': function('ale_linters#go#gometalinter#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#go#gometalinter#Handler',
|
\ 'callback': 'ale_linters#go#gometalinter#Handler',
|
||||||
\ 'lint_file': 1,
|
\ 'lint_file': 1,
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
call ale#Set('go_gopls_executable', 'gopls')
|
call ale#Set('go_gopls_executable', 'gopls')
|
||||||
call ale#Set('go_gopls_options', '--mode stdio')
|
call ale#Set('go_gopls_options', '--mode stdio')
|
||||||
|
call ale#Set('go_gopls_init_options', {})
|
||||||
|
call ale#Set('go_gopls_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||||
|
|
||||||
function! ale_linters#go#gopls#GetCommand(buffer) abort
|
function! ale_linters#go#gopls#GetCommand(buffer) abort
|
||||||
return ale#go#EnvString(a:buffer)
|
return ale#go#EnvString(a:buffer)
|
||||||
@ -28,7 +30,10 @@ endfunction
|
|||||||
call ale#linter#Define('go', {
|
call ale#linter#Define('go', {
|
||||||
\ 'name': 'gopls',
|
\ 'name': 'gopls',
|
||||||
\ 'lsp': 'stdio',
|
\ 'lsp': 'stdio',
|
||||||
\ 'executable': {b -> ale#Var(b, 'go_gopls_executable')},
|
\ 'executable': {b -> ale#path#FindExecutable(b, 'go_gopls', [
|
||||||
|
\ ale#go#GetGoPathExecutable('bin/gopls'),
|
||||||
|
\ ])},
|
||||||
\ 'command': function('ale_linters#go#gopls#GetCommand'),
|
\ 'command': function('ale_linters#go#gopls#GetCommand'),
|
||||||
\ 'project_root': function('ale_linters#go#gopls#FindProjectRoot'),
|
\ 'project_root': function('ale_linters#go#gopls#FindProjectRoot'),
|
||||||
|
\ 'initialization_options': {b -> ale#Var(b, 'go_gopls_init_options')},
|
||||||
\})
|
\})
|
||||||
|
@ -1,15 +1,11 @@
|
|||||||
" Author: Ben Reedy <https://github.com/breed808>
|
" Author: Ben Reedy <https://github.com/breed808>
|
||||||
" Description: gosimple for Go files
|
" Description: gosimple for Go files
|
||||||
|
|
||||||
function! ale_linters#go#gosimple#GetCommand(buffer) abort
|
|
||||||
return ale#path#BufferCdString(a:buffer) . ' '
|
|
||||||
\ . ale#go#EnvString(a:buffer) . 'gosimple .'
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
call ale#linter#Define('go', {
|
call ale#linter#Define('go', {
|
||||||
\ 'name': 'gosimple',
|
\ 'name': 'gosimple',
|
||||||
\ 'executable': 'gosimple',
|
\ 'executable': 'gosimple',
|
||||||
\ 'command': function('ale_linters#go#gosimple#GetCommand'),
|
\ 'cwd': '%s:h',
|
||||||
|
\ 'command': {b -> ale#go#EnvString(b) . 'gosimple .'},
|
||||||
\ 'callback': 'ale#handlers#go#Handler',
|
\ 'callback': 'ale#handlers#go#Handler',
|
||||||
\ 'output_stream': 'both',
|
\ 'output_stream': 'both',
|
||||||
\ 'lint_file': 1,
|
\ 'lint_file': 1,
|
||||||
|
@ -1,19 +1,23 @@
|
|||||||
" Author: Jelte Fennema <github-public@jeltef.nl>
|
" Author: Jelte Fennema <github-public@jeltef.nl>
|
||||||
" Description: gotype for Go files
|
" Description: gotype for Go files
|
||||||
|
|
||||||
function! ale_linters#go#gotype#GetCommand(buffer) abort
|
function! ale_linters#go#gotype#GetExecutable(buffer) abort
|
||||||
if expand('#' . a:buffer . ':p') =~# '_test\.go$'
|
if expand('#' . a:buffer . ':p') =~# '_test\.go$'
|
||||||
return ''
|
return ''
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return ale#path#BufferCdString(a:buffer) . ' '
|
return 'gotype'
|
||||||
\ . ale#go#EnvString(a:buffer) . 'gotype -e .'
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#go#gotype#GetCommand(buffer) abort
|
||||||
|
return ale#go#EnvString(a:buffer) . 'gotype -e .'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('go', {
|
call ale#linter#Define('go', {
|
||||||
\ 'name': 'gotype',
|
\ 'name': 'gotype',
|
||||||
\ 'output_stream': 'stderr',
|
\ 'output_stream': 'stderr',
|
||||||
\ 'executable': 'gotype',
|
\ 'executable': function('ale_linters#go#gotype#GetExecutable'),
|
||||||
|
\ 'cwd': '%s:h',
|
||||||
\ 'command': function('ale_linters#go#gotype#GetCommand'),
|
\ 'command': function('ale_linters#go#gotype#GetCommand'),
|
||||||
\ 'callback': 'ale#handlers#go#Handler',
|
\ 'callback': 'ale#handlers#go#Handler',
|
||||||
\ 'lint_file': 1,
|
\ 'lint_file': 1,
|
||||||
|
@ -10,8 +10,7 @@ call ale#Set('go_govet_options', '')
|
|||||||
function! ale_linters#go#govet#GetCommand(buffer) abort
|
function! ale_linters#go#govet#GetCommand(buffer) abort
|
||||||
let l:options = ale#Var(a:buffer, 'go_govet_options')
|
let l:options = ale#Var(a:buffer, 'go_govet_options')
|
||||||
|
|
||||||
return ale#path#BufferCdString(a:buffer) . ' '
|
return ale#go#EnvString(a:buffer)
|
||||||
\ . ale#go#EnvString(a:buffer)
|
|
||||||
\ . ale#Var(a:buffer, 'go_go_executable') . ' vet '
|
\ . ale#Var(a:buffer, 'go_go_executable') . ' vet '
|
||||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||||
\ . ' .'
|
\ . ' .'
|
||||||
@ -22,6 +21,7 @@ call ale#linter#Define('go', {
|
|||||||
\ 'aliases': ['go vet'],
|
\ 'aliases': ['go vet'],
|
||||||
\ 'output_stream': 'stderr',
|
\ 'output_stream': 'stderr',
|
||||||
\ 'executable': {b -> ale#Var(b, 'go_go_executable')},
|
\ 'executable': {b -> ale#Var(b, 'go_go_executable')},
|
||||||
|
\ 'cwd': '%s:h',
|
||||||
\ 'command': function('ale_linters#go#govet#GetCommand'),
|
\ 'command': function('ale_linters#go#govet#GetCommand'),
|
||||||
\ 'callback': 'ale#handlers#go#Handler',
|
\ 'callback': 'ale#handlers#go#Handler',
|
||||||
\ 'lint_file': 1,
|
\ 'lint_file': 1,
|
||||||
|
@ -1,32 +1,32 @@
|
|||||||
" Author: Ben Reedy <https://github.com/breed808>
|
" Author: Ben Reedy <https://github.com/breed808>
|
||||||
" Description: staticcheck for Go files
|
" Description: staticcheck for Go files
|
||||||
|
|
||||||
|
call ale#Set('go_staticcheck_executable', 'staticcheck')
|
||||||
call ale#Set('go_staticcheck_options', '')
|
call ale#Set('go_staticcheck_options', '')
|
||||||
call ale#Set('go_staticcheck_lint_package', 0)
|
call ale#Set('go_staticcheck_lint_package', 0)
|
||||||
|
call ale#Set('go_staticcheck_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||||
|
|
||||||
function! ale_linters#go#staticcheck#GetCommand(buffer) abort
|
function! ale_linters#go#staticcheck#GetCommand(buffer) abort
|
||||||
let l:filename = expand('#' . a:buffer . ':t')
|
|
||||||
let l:options = ale#Var(a:buffer, 'go_staticcheck_options')
|
let l:options = ale#Var(a:buffer, 'go_staticcheck_options')
|
||||||
let l:lint_package = ale#Var(a:buffer, 'go_staticcheck_lint_package')
|
let l:lint_package = ale#Var(a:buffer, 'go_staticcheck_lint_package')
|
||||||
let l:env = ale#go#EnvString(a:buffer)
|
let l:env = ale#go#EnvString(a:buffer)
|
||||||
|
|
||||||
" BufferCdString is used so that we can be sure the paths output from
|
|
||||||
" staticcheck can be calculated to absolute paths in the Handler
|
|
||||||
if l:lint_package
|
if l:lint_package
|
||||||
return ale#path#BufferCdString(a:buffer)
|
return l:env . '%e'
|
||||||
\ . l:env . 'staticcheck'
|
|
||||||
\ . (!empty(l:options) ? ' ' . l:options : '') . ' .'
|
\ . (!empty(l:options) ? ' ' . l:options : '') . ' .'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return ale#path#BufferCdString(a:buffer)
|
return l:env . '%e'
|
||||||
\ . l:env . 'staticcheck'
|
|
||||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||||
\ . ' ' . ale#Escape(l:filename)
|
\ . ' %s:t'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('go', {
|
call ale#linter#Define('go', {
|
||||||
\ 'name': 'staticcheck',
|
\ 'name': 'staticcheck',
|
||||||
\ 'executable': 'staticcheck',
|
\ 'executable': {b -> ale#path#FindExecutable(b, 'go_staticcheck', [
|
||||||
|
\ ale#go#GetGoPathExecutable('bin/staticcheck'),
|
||||||
|
\ ])},
|
||||||
|
\ 'cwd': '%s:h',
|
||||||
\ 'command': function('ale_linters#go#staticcheck#GetCommand'),
|
\ 'command': function('ale_linters#go#staticcheck#GetCommand'),
|
||||||
\ 'callback': 'ale#handlers#go#Handler',
|
\ 'callback': 'ale#handlers#go#Handler',
|
||||||
\ 'output_stream': 'both',
|
\ 'output_stream': 'both',
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
call ale#linter#Define('graphql', {
|
call ale#linter#Define('graphql', {
|
||||||
\ 'name': 'eslint',
|
\ 'name': 'eslint',
|
||||||
\ 'executable': function('ale#handlers#eslint#GetExecutable'),
|
\ 'executable': function('ale#handlers#eslint#GetExecutable'),
|
||||||
|
\ 'cwd': function('ale#handlers#eslint#GetCwd'),
|
||||||
\ 'command': function('ale#handlers#eslint#GetCommand'),
|
\ 'command': function('ale#handlers#eslint#GetCommand'),
|
||||||
\ 'callback': 'ale#handlers#eslint#HandleJSON',
|
\ 'callback': 'ale#handlers#eslint#HandleJSON',
|
||||||
\})
|
\})
|
||||||
|
@ -1,15 +1,10 @@
|
|||||||
" Author: Michiel Westerbeek <happylinks@gmail.com>
|
" Author: Michiel Westerbeek <happylinks@gmail.com>
|
||||||
" Description: Linter for GraphQL Schemas
|
" Description: Linter for GraphQL Schemas
|
||||||
|
|
||||||
function! ale_linters#graphql#gqlint#GetCommand(buffer) abort
|
|
||||||
return ale#path#BufferCdString(a:buffer)
|
|
||||||
\ . 'gqlint'
|
|
||||||
\ . ' --reporter=simple %t'
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
call ale#linter#Define('graphql', {
|
call ale#linter#Define('graphql', {
|
||||||
\ 'name': 'gqlint',
|
\ 'name': 'gqlint',
|
||||||
\ 'executable': 'gqlint',
|
\ 'executable': 'gqlint',
|
||||||
\ 'command': function('ale_linters#graphql#gqlint#GetCommand'),
|
\ 'cwd': '%s:h',
|
||||||
|
\ 'command': 'gqlint --reporter=simple %t',
|
||||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||||
\})
|
\})
|
||||||
|
@ -5,7 +5,7 @@ call ale#Set('handlebars_embertemplatelint_executable', 'ember-template-lint')
|
|||||||
call ale#Set('handlebars_embertemplatelint_use_global', get(g:, 'ale_use_global_executables', 0))
|
call ale#Set('handlebars_embertemplatelint_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||||
|
|
||||||
function! ale_linters#handlebars#embertemplatelint#GetExecutable(buffer) abort
|
function! ale_linters#handlebars#embertemplatelint#GetExecutable(buffer) abort
|
||||||
return ale#node#FindExecutable(a:buffer, 'handlebars_embertemplatelint', [
|
return ale#path#FindExecutable(a:buffer, 'handlebars_embertemplatelint', [
|
||||||
\ 'node_modules/.bin/ember-template-lint',
|
\ 'node_modules/.bin/ember-template-lint',
|
||||||
\])
|
\])
|
||||||
endfunction
|
endfunction
|
||||||
|
@ -4,8 +4,7 @@
|
|||||||
call ale#Set('haskell_cabal_ghc_options', '-fno-code -v0')
|
call ale#Set('haskell_cabal_ghc_options', '-fno-code -v0')
|
||||||
|
|
||||||
function! ale_linters#haskell#cabal_ghc#GetCommand(buffer) abort
|
function! ale_linters#haskell#cabal_ghc#GetCommand(buffer) abort
|
||||||
return ale#path#BufferCdString(a:buffer)
|
return 'cabal exec -- ghc '
|
||||||
\ . 'cabal exec -- ghc '
|
|
||||||
\ . ale#Var(a:buffer, 'haskell_cabal_ghc_options')
|
\ . ale#Var(a:buffer, 'haskell_cabal_ghc_options')
|
||||||
\ . ' %t'
|
\ . ' %t'
|
||||||
endfunction
|
endfunction
|
||||||
@ -15,6 +14,7 @@ call ale#linter#Define('haskell', {
|
|||||||
\ 'aliases': ['cabal-ghc'],
|
\ 'aliases': ['cabal-ghc'],
|
||||||
\ 'output_stream': 'stderr',
|
\ 'output_stream': 'stderr',
|
||||||
\ 'executable': 'cabal',
|
\ 'executable': 'cabal',
|
||||||
|
\ 'cwd': '%s:h',
|
||||||
\ 'command': function('ale_linters#haskell#cabal_ghc#GetCommand'),
|
\ 'command': function('ale_linters#haskell#cabal_ghc#GetCommand'),
|
||||||
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
|
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
|
||||||
\})
|
\})
|
||||||
|
63
sources_non_forked/ale/ale_linters/haskell/hls.vim
Normal file
63
sources_non_forked/ale/ale_linters/haskell/hls.vim
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
" Author: Yen3 <yen3rc@gmail.com>
|
||||||
|
" Description: A language server for haskell
|
||||||
|
" The file is based on hie.vim (author: Luxed
|
||||||
|
" <devildead13@gmail.com>). It search more project root files.
|
||||||
|
"
|
||||||
|
call ale#Set('haskell_hls_executable', 'haskell-language-server-wrapper')
|
||||||
|
|
||||||
|
function! ale_linters#haskell#hls#FindRootFile(buffer) abort
|
||||||
|
let l:serach_root_files = [
|
||||||
|
\ 'stack.yaml',
|
||||||
|
\ 'cabal.project',
|
||||||
|
\ 'package.yaml',
|
||||||
|
\ 'hie.yaml'
|
||||||
|
\ ]
|
||||||
|
|
||||||
|
for l:path in ale#path#Upwards(expand('#' . a:buffer . ':p:h'))
|
||||||
|
for l:root_file in l:serach_root_files
|
||||||
|
if filereadable(l:path . l:root_file)
|
||||||
|
return l:path
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#haskell#hls#GetProjectRoot(buffer) abort
|
||||||
|
" Search for the project file first
|
||||||
|
let l:project_file = ale_linters#haskell#hls#FindRootFile(a:buffer)
|
||||||
|
|
||||||
|
" If it's empty, search for the cabal file
|
||||||
|
if empty(l:project_file)
|
||||||
|
" Search all of the paths except for the root filesystem path.
|
||||||
|
let l:paths = join(
|
||||||
|
\ ale#path#Upwards(expand('#' . a:buffer . ':p:h'))[:-2],
|
||||||
|
\ ','
|
||||||
|
\)
|
||||||
|
let l:project_file = globpath(l:paths, '*.cabal')
|
||||||
|
endif
|
||||||
|
|
||||||
|
" If we still can't find one, use the current file.
|
||||||
|
if empty(l:project_file)
|
||||||
|
let l:project_file = expand('#' . a:buffer . ':p')
|
||||||
|
endif
|
||||||
|
|
||||||
|
return fnamemodify(l:project_file, ':h')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#haskell#hls#GetCommand(buffer) abort
|
||||||
|
let l:executable = ale#Var(a:buffer, 'haskell_hls_executable')
|
||||||
|
|
||||||
|
return ale#handlers#haskell_stack#EscapeExecutable(l:executable,
|
||||||
|
\ 'haskell-language-server-wrapper')
|
||||||
|
\ . ' --lsp'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('haskell', {
|
||||||
|
\ 'name': 'hls',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'command': function('ale_linters#haskell#hls#GetCommand'),
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'haskell_hls_executable')},
|
||||||
|
\ 'project_root': function('ale_linters#haskell#hls#GetProjectRoot'),
|
||||||
|
\})
|
@ -4,8 +4,7 @@
|
|||||||
call ale#Set('haskell_stack_ghc_options', '-fno-code -v0')
|
call ale#Set('haskell_stack_ghc_options', '-fno-code -v0')
|
||||||
|
|
||||||
function! ale_linters#haskell#stack_ghc#GetCommand(buffer) abort
|
function! ale_linters#haskell#stack_ghc#GetCommand(buffer) abort
|
||||||
return ale#path#BufferCdString(a:buffer)
|
return ale#handlers#haskell#GetStackExecutable(a:buffer)
|
||||||
\ . ale#handlers#haskell#GetStackExecutable(a:buffer)
|
|
||||||
\ . ' ghc -- '
|
\ . ' ghc -- '
|
||||||
\ . ale#Var(a:buffer, 'haskell_stack_ghc_options')
|
\ . ale#Var(a:buffer, 'haskell_stack_ghc_options')
|
||||||
\ . ' %t'
|
\ . ' %t'
|
||||||
@ -16,6 +15,7 @@ call ale#linter#Define('haskell', {
|
|||||||
\ 'aliases': ['stack-ghc'],
|
\ 'aliases': ['stack-ghc'],
|
||||||
\ 'output_stream': 'stderr',
|
\ 'output_stream': 'stderr',
|
||||||
\ 'executable': function('ale#handlers#haskell#GetStackExecutable'),
|
\ 'executable': function('ale#handlers#haskell#GetStackExecutable'),
|
||||||
|
\ 'cwd': '%s:h',
|
||||||
\ 'command': function('ale_linters#haskell#stack_ghc#GetCommand'),
|
\ 'command': function('ale_linters#haskell#stack_ghc#GetCommand'),
|
||||||
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
|
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
|
||||||
\})
|
\})
|
||||||
|
52
sources_non_forked/ale/ale_linters/html/angular.vim
Normal file
52
sources_non_forked/ale/ale_linters/html/angular.vim
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
" Author: w0rp <devw0rp@gmail.com>
|
||||||
|
" Description: tsserver integration for ALE
|
||||||
|
|
||||||
|
call ale#Set('html_angular_executable', 'ngserver')
|
||||||
|
call ale#Set('html_angular_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||||
|
|
||||||
|
function! ale_linters#html#angular#GetProjectRoot(buffer) abort
|
||||||
|
return ale#path#Dirname(
|
||||||
|
\ ale#path#FindNearestDirectory(a:buffer, 'node_modules')
|
||||||
|
\)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#html#angular#GetExecutable(buffer) abort
|
||||||
|
return ale#path#FindExecutable(a:buffer, 'html_angular', [
|
||||||
|
\ 'node_modules/@angular/language-server/bin/ngserver',
|
||||||
|
\ 'node_modules/@angular/language-server/index.js',
|
||||||
|
\])
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#html#angular#GetCommand(buffer) abort
|
||||||
|
let l:language_service_dir = ale#path#Simplify(
|
||||||
|
\ ale#path#FindNearestDirectory(
|
||||||
|
\ a:buffer,
|
||||||
|
\ 'node_modules/@angular/language-service'
|
||||||
|
\ )
|
||||||
|
\)
|
||||||
|
|
||||||
|
if empty(l:language_service_dir)
|
||||||
|
return ''
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:language_service_dir = fnamemodify(l:language_service_dir, ':h')
|
||||||
|
let l:typescript_dir = ale#path#Simplify(
|
||||||
|
\ fnamemodify(l:language_service_dir, ':h:h')
|
||||||
|
\ . '/typescript'
|
||||||
|
\)
|
||||||
|
let l:executable = ale_linters#html#angular#GetExecutable(a:buffer)
|
||||||
|
|
||||||
|
return ale#node#Executable(a:buffer, l:executable)
|
||||||
|
\ . ' --ngProbeLocations ' . ale#Escape(l:language_service_dir)
|
||||||
|
\ . ' --tsProbeLocations ' . ale#Escape(l:typescript_dir)
|
||||||
|
\ . ' --stdio'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('html', {
|
||||||
|
\ 'name': 'angular',
|
||||||
|
\ 'aliases': ['angular-language-server'],
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': function('ale_linters#html#angular#GetExecutable'),
|
||||||
|
\ 'command': function('ale_linters#html#angular#GetCommand'),
|
||||||
|
\ 'project_root': function('ale_linters#html#angular#GetProjectRoot'),
|
||||||
|
\})
|
@ -24,7 +24,7 @@ endfunction
|
|||||||
|
|
||||||
call ale#linter#Define('html', {
|
call ale#linter#Define('html', {
|
||||||
\ 'name': 'htmlhint',
|
\ 'name': 'htmlhint',
|
||||||
\ 'executable': {b -> ale#node#FindExecutable(b, 'html_htmlhint', [
|
\ 'executable': {b -> ale#path#FindExecutable(b, 'html_htmlhint', [
|
||||||
\ 'node_modules/.bin/htmlhint',
|
\ 'node_modules/.bin/htmlhint',
|
||||||
\ ])},
|
\ ])},
|
||||||
\ 'command': function('ale_linters#html#htmlhint#GetCommand'),
|
\ 'command': function('ale_linters#html#htmlhint#GetCommand'),
|
||||||
|
@ -5,7 +5,7 @@ call ale#Set('html_stylelint_options', '')
|
|||||||
call ale#Set('html_stylelint_use_global', 0)
|
call ale#Set('html_stylelint_use_global', 0)
|
||||||
|
|
||||||
function! ale_linters#html#stylelint#GetExecutable(buffer) abort
|
function! ale_linters#html#stylelint#GetExecutable(buffer) abort
|
||||||
return ale#node#FindExecutable(a:buffer, 'html_stylelint', [
|
return ale#path#FindExecutable(a:buffer, 'html_stylelint', [
|
||||||
\ 'node_modules/.bin/stylelint',
|
\ 'node_modules/.bin/stylelint',
|
||||||
\])
|
\])
|
||||||
endfunction
|
endfunction
|
||||||
|
@ -6,7 +6,7 @@ call ale#Set('ink_ls_use_global', get(g:, 'ale_use_global_executables', 0))
|
|||||||
call ale#Set('ink_ls_initialization_options', {})
|
call ale#Set('ink_ls_initialization_options', {})
|
||||||
|
|
||||||
function! ale_linters#ink#ls#GetExecutable(buffer) abort
|
function! ale_linters#ink#ls#GetExecutable(buffer) abort
|
||||||
return ale#node#FindExecutable(a:buffer, 'ink_ls', [
|
return ale#path#FindExecutable(a:buffer, 'ink_ls', [
|
||||||
\ 'ink-language-server',
|
\ 'ink-language-server',
|
||||||
\ 'node_modules/.bin/ink-language-server',
|
\ 'node_modules/.bin/ink-language-server',
|
||||||
\])
|
\])
|
||||||
|
33
sources_non_forked/ale/ale_linters/inko/inko.vim
Normal file
33
sources_non_forked/ale/ale_linters/inko/inko.vim
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
" Author: Yorick Peterse <yorick@yorickpeterse.com>
|
||||||
|
" Description: linting of Inko source code using the Inko compiler
|
||||||
|
|
||||||
|
call ale#Set('inko_inko_executable', 'inko')
|
||||||
|
|
||||||
|
function! ale_linters#inko#inko#GetCommand(buffer) abort
|
||||||
|
let l:include = ''
|
||||||
|
|
||||||
|
" Include the tests source directory, but only for test files.
|
||||||
|
if expand('#' . a:buffer . ':p') =~? '\vtests[/\\]test[/\\]'
|
||||||
|
let l:test_dir = ale#path#FindNearestDirectory(a:buffer, 'tests')
|
||||||
|
|
||||||
|
if isdirectory(l:test_dir)
|
||||||
|
let l:include = '--include ' . ale#Escape(l:test_dir)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
" We use %s instead of %t so the compiler determines the correct module
|
||||||
|
" names for the file being edited. Not doing so may lead to errors in
|
||||||
|
" certain cases.
|
||||||
|
return '%e build --check --format=json'
|
||||||
|
\ . ale#Pad(l:include)
|
||||||
|
\ . ' %s'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('inko', {
|
||||||
|
\ 'name': 'inko',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'inko_inko_executable')},
|
||||||
|
\ 'command': function('ale_linters#inko#inko#GetCommand'),
|
||||||
|
\ 'callback': 'ale#handlers#inko#Handle',
|
||||||
|
\ 'output_stream': 'stderr',
|
||||||
|
\ 'lint_file': 1
|
||||||
|
\})
|
@ -9,7 +9,7 @@ function! ale_linters#java#checkstyle#Handle(buffer, lines) abort
|
|||||||
let l:output = []
|
let l:output = []
|
||||||
|
|
||||||
" modern checkstyle versions
|
" modern checkstyle versions
|
||||||
let l:pattern = '\v\[(WARN|ERROR)\] [a-zA-Z]?:?[^:]+:(\d+):(\d+)?:? (.*) \[(.+)\]$'
|
let l:pattern = '\v\[(WARN|ERROR)\] [a-zA-Z]?:?[^:]+:(\d+):(\d+)?:? (.*) \[(.+)\]'
|
||||||
|
|
||||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||||
call add(l:output, {
|
call add(l:output, {
|
||||||
|
@ -29,28 +29,28 @@ function! ale_linters#java#eclipselsp#JarPath(buffer) abort
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" Search jar file within repository path when manually built using mvn
|
" Search jar file within repository path when manually built using mvn
|
||||||
let l:files = globpath(l:path, '**/'.l:platform.'/**/plugins/org.eclipse.equinox.launcher_\d\.\d\.\d\d\d\.*\.jar', 1, 1)
|
let l:files = globpath(l:path, '**/'.l:platform.'/**/plugins/org.eclipse.equinox.launcher_*\.jar', 1, 1)
|
||||||
|
|
||||||
if len(l:files) >= 1
|
if len(l:files) >= 1
|
||||||
return l:files[0]
|
return l:files[0]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Search jar file within VSCode extensions folder.
|
" Search jar file within VSCode extensions folder.
|
||||||
let l:files = globpath(l:path, '**/'.l:platform.'/plugins/org.eclipse.equinox.launcher_\d\.\d\.\d\d\d\.*\.jar', 1, 1)
|
let l:files = globpath(l:path, '**/'.l:platform.'/plugins/org.eclipse.equinox.launcher_*\.jar', 1, 1)
|
||||||
|
|
||||||
if len(l:files) >= 1
|
if len(l:files) >= 1
|
||||||
return l:files[0]
|
return l:files[0]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Search jar file within unzipped tar.gz file
|
" Search jar file within unzipped tar.gz file
|
||||||
let l:files = globpath(l:path, 'plugins/org.eclipse.equinox.launcher_\d\.\d\.\d\d\d\.*\.jar', 1, 1)
|
let l:files = globpath(l:path, 'plugins/org.eclipse.equinox.launcher_*\.jar', 1, 1)
|
||||||
|
|
||||||
if len(l:files) >= 1
|
if len(l:files) >= 1
|
||||||
return l:files[0]
|
return l:files[0]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Search jar file within system package path
|
" Search jar file within system package path
|
||||||
let l:files = globpath('/usr/share/java/jdtls/plugins', 'org.eclipse.equinox.launcher_\d\.\d\.\d\d\d\.*\.jar', 1, 1)
|
let l:files = globpath('/usr/share/java/jdtls/plugins', 'org.eclipse.equinox.launcher_*\.jar', 1, 1)
|
||||||
|
|
||||||
if len(l:files) >= 1
|
if len(l:files) >= 1
|
||||||
return l:files[0]
|
return l:files[0]
|
||||||
|
@ -9,16 +9,16 @@ call ale#Set('java_javac_classpath', '')
|
|||||||
call ale#Set('java_javac_sourcepath', '')
|
call ale#Set('java_javac_sourcepath', '')
|
||||||
|
|
||||||
function! ale_linters#java#javac#RunWithImportPaths(buffer) abort
|
function! ale_linters#java#javac#RunWithImportPaths(buffer) abort
|
||||||
let l:command = ale#maven#BuildClasspathCommand(a:buffer)
|
let [l:cwd, l:command] = ale#maven#BuildClasspathCommand(a:buffer)
|
||||||
|
|
||||||
" Try to use Gradle if Maven isn't available.
|
" Try to use Gradle if Maven isn't available.
|
||||||
if empty(l:command)
|
if empty(l:command)
|
||||||
let l:command = ale#gradle#BuildClasspathCommand(a:buffer)
|
let [l:cwd, l:command] = ale#gradle#BuildClasspathCommand(a:buffer)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Try to use Ant if Gradle and Maven aren't available
|
" Try to use Ant if Gradle and Maven aren't available
|
||||||
if empty(l:command)
|
if empty(l:command)
|
||||||
let l:command = ale#ant#BuildClasspathCommand(a:buffer)
|
let [l:cwd, l:command] = ale#ant#BuildClasspathCommand(a:buffer)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if empty(l:command)
|
if empty(l:command)
|
||||||
@ -28,7 +28,8 @@ function! ale_linters#java#javac#RunWithImportPaths(buffer) abort
|
|||||||
return ale#command#Run(
|
return ale#command#Run(
|
||||||
\ a:buffer,
|
\ a:buffer,
|
||||||
\ l:command,
|
\ l:command,
|
||||||
\ function('ale_linters#java#javac#GetCommand')
|
\ function('ale_linters#java#javac#GetCommand'),
|
||||||
|
\ {'cwd': l:cwd},
|
||||||
\)
|
\)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@ -110,8 +111,7 @@ function! ale_linters#java#javac#GetCommand(buffer, import_paths, meta) abort
|
|||||||
|
|
||||||
" Always run javac from the directory the file is in, so we can resolve
|
" Always run javac from the directory the file is in, so we can resolve
|
||||||
" relative paths correctly.
|
" relative paths correctly.
|
||||||
return ale#path#BufferCdString(a:buffer)
|
return '%e -Xlint'
|
||||||
\ . '%e -Xlint'
|
|
||||||
\ . ale#Pad(l:cp_option)
|
\ . ale#Pad(l:cp_option)
|
||||||
\ . ale#Pad(l:sp_option)
|
\ . ale#Pad(l:sp_option)
|
||||||
\ . ' -d ' . ale#Escape(l:class_file_directory)
|
\ . ' -d ' . ale#Escape(l:class_file_directory)
|
||||||
@ -132,7 +132,9 @@ function! ale_linters#java#javac#Handle(buffer, lines) abort
|
|||||||
|
|
||||||
for l:match in ale#util#GetMatches(a:lines, [l:pattern, l:col_pattern, l:symbol_pattern])
|
for l:match in ale#util#GetMatches(a:lines, [l:pattern, l:col_pattern, l:symbol_pattern])
|
||||||
if empty(l:match[2]) && empty(l:match[3])
|
if empty(l:match[2]) && empty(l:match[3])
|
||||||
let l:output[-1].col = len(l:match[1])
|
if !empty(l:match[1]) && !empty(l:output)
|
||||||
|
let l:output[-1].col = len(l:match[1])
|
||||||
|
endif
|
||||||
elseif empty(l:match[3])
|
elseif empty(l:match[3])
|
||||||
" Add symbols to 'cannot find symbol' errors.
|
" Add symbols to 'cannot find symbol' errors.
|
||||||
if l:output[-1].text is# 'error: cannot find symbol'
|
if l:output[-1].text is# 'error: cannot find symbol'
|
||||||
@ -154,6 +156,7 @@ endfunction
|
|||||||
call ale#linter#Define('java', {
|
call ale#linter#Define('java', {
|
||||||
\ 'name': 'javac',
|
\ 'name': 'javac',
|
||||||
\ 'executable': {b -> ale#Var(b, 'java_javac_executable')},
|
\ 'executable': {b -> ale#Var(b, 'java_javac_executable')},
|
||||||
|
\ 'cwd': '%s:h',
|
||||||
\ 'command': function('ale_linters#java#javac#RunWithImportPaths'),
|
\ 'command': function('ale_linters#java#javac#RunWithImportPaths'),
|
||||||
\ 'output_stream': 'stderr',
|
\ 'output_stream': 'stderr',
|
||||||
\ 'callback': 'ale_linters#java#javac#Handle',
|
\ 'callback': 'ale_linters#java#javac#Handle',
|
||||||
|
@ -5,6 +5,7 @@ call ale#linter#Define('javascript', {
|
|||||||
\ 'name': 'eslint',
|
\ 'name': 'eslint',
|
||||||
\ 'output_stream': 'both',
|
\ 'output_stream': 'both',
|
||||||
\ 'executable': function('ale#handlers#eslint#GetExecutable'),
|
\ 'executable': function('ale#handlers#eslint#GetExecutable'),
|
||||||
|
\ 'cwd': function('ale#handlers#eslint#GetCwd'),
|
||||||
\ 'command': function('ale#handlers#eslint#GetCommand'),
|
\ 'command': function('ale#handlers#eslint#GetCommand'),
|
||||||
\ 'callback': 'ale#handlers#eslint#HandleJSON',
|
\ 'callback': 'ale#handlers#eslint#HandleJSON',
|
||||||
\})
|
\})
|
||||||
|
@ -22,7 +22,7 @@ function! ale_linters#javascript#flow#GetExecutable(buffer) abort
|
|||||||
return ''
|
return ''
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return ale#node#FindExecutable(a:buffer, 'javascript_flow', [
|
return ale#path#FindExecutable(a:buffer, 'javascript_flow', [
|
||||||
\ 'node_modules/.bin/flow',
|
\ 'node_modules/.bin/flow',
|
||||||
\])
|
\])
|
||||||
endfunction
|
endfunction
|
||||||
|
@ -19,7 +19,7 @@ endfunction
|
|||||||
call ale#linter#Define('javascript', {
|
call ale#linter#Define('javascript', {
|
||||||
\ 'name': 'flow-language-server',
|
\ 'name': 'flow-language-server',
|
||||||
\ 'lsp': 'stdio',
|
\ 'lsp': 'stdio',
|
||||||
\ 'executable': {b -> ale#node#FindExecutable(b, 'javascript_flow_ls', [
|
\ 'executable': {b -> ale#path#FindExecutable(b, 'javascript_flow_ls', [
|
||||||
\ 'node_modules/.bin/flow',
|
\ 'node_modules/.bin/flow',
|
||||||
\ ])},
|
\ ])},
|
||||||
\ 'command': '%e lsp --from ale-lsp',
|
\ 'command': '%e lsp --from ale-lsp',
|
||||||
|
@ -53,7 +53,7 @@ endfunction
|
|||||||
|
|
||||||
call ale#linter#Define('javascript', {
|
call ale#linter#Define('javascript', {
|
||||||
\ 'name': 'jscs',
|
\ 'name': 'jscs',
|
||||||
\ 'executable': {b -> ale#node#FindExecutable(b, 'javascript_jscs', [
|
\ 'executable': {b -> ale#path#FindExecutable(b, 'javascript_jscs', [
|
||||||
\ 'node_modules/.bin/jscs',
|
\ 'node_modules/.bin/jscs',
|
||||||
\ ])},
|
\ ])},
|
||||||
\ 'command': function('ale_linters#javascript#jscs#GetCommand'),
|
\ 'command': function('ale_linters#javascript#jscs#GetCommand'),
|
||||||
|
@ -25,7 +25,7 @@ endfunction
|
|||||||
|
|
||||||
call ale#linter#Define('javascript', {
|
call ale#linter#Define('javascript', {
|
||||||
\ 'name': 'jshint',
|
\ 'name': 'jshint',
|
||||||
\ 'executable': {b -> ale#node#FindExecutable(b, 'javascript_jshint', [
|
\ 'executable': {b -> ale#path#FindExecutable(b, 'javascript_jshint', [
|
||||||
\ 'node_modules/.bin/jshint',
|
\ 'node_modules/.bin/jshint',
|
||||||
\ ])},
|
\ ])},
|
||||||
\ 'command': function('ale_linters#javascript#jshint#GetCommand'),
|
\ 'command': function('ale_linters#javascript#jshint#GetCommand'),
|
||||||
|
@ -6,7 +6,7 @@ call ale#Set('javascript_standard_use_global', get(g:, 'ale_use_global_executabl
|
|||||||
call ale#Set('javascript_standard_options', '')
|
call ale#Set('javascript_standard_options', '')
|
||||||
|
|
||||||
function! ale_linters#javascript#standard#GetExecutable(buffer) abort
|
function! ale_linters#javascript#standard#GetExecutable(buffer) abort
|
||||||
return ale#node#FindExecutable(a:buffer, 'javascript_standard', [
|
return ale#path#FindExecutable(a:buffer, 'javascript_standard', [
|
||||||
\ 'node_modules/standardx/bin/cmd.js',
|
\ 'node_modules/standardx/bin/cmd.js',
|
||||||
\ 'node_modules/standard/bin/cmd.js',
|
\ 'node_modules/standard/bin/cmd.js',
|
||||||
\ 'node_modules/semistandard/bin/cmd.js',
|
\ 'node_modules/semistandard/bin/cmd.js',
|
||||||
|
@ -8,7 +8,7 @@ call ale#Set('javascript_tsserver_use_global', get(g:, 'ale_use_global_executabl
|
|||||||
call ale#linter#Define('javascript', {
|
call ale#linter#Define('javascript', {
|
||||||
\ 'name': 'tsserver',
|
\ 'name': 'tsserver',
|
||||||
\ 'lsp': 'tsserver',
|
\ 'lsp': 'tsserver',
|
||||||
\ 'executable': {b -> ale#node#FindExecutable(b, 'javascript_tsserver', [
|
\ 'executable': {b -> ale#path#FindExecutable(b, 'javascript_tsserver', [
|
||||||
\ 'node_modules/.bin/tsserver',
|
\ 'node_modules/.bin/tsserver',
|
||||||
\ ])},
|
\ ])},
|
||||||
\ 'command': '%e',
|
\ 'command': '%e',
|
||||||
|
@ -1,26 +1,9 @@
|
|||||||
" Author: Daniel Lupu <lupu.daniel.f@gmail.com>
|
" Author: Daniel Lupu <lupu.daniel.f@gmail.com>
|
||||||
" Description: xo for JavaScript files
|
" Description: xo for JavaScript files
|
||||||
|
|
||||||
call ale#Set('javascript_xo_executable', 'xo')
|
|
||||||
call ale#Set('javascript_xo_use_global', get(g:, 'ale_use_global_executables', 0))
|
|
||||||
call ale#Set('javascript_xo_options', '')
|
|
||||||
|
|
||||||
function! ale_linters#javascript#xo#GetExecutable(buffer) abort
|
|
||||||
return ale#node#FindExecutable(a:buffer, 'javascript_xo', [
|
|
||||||
\ 'node_modules/.bin/xo',
|
|
||||||
\])
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale_linters#javascript#xo#GetCommand(buffer) abort
|
|
||||||
return ale#Escape(ale_linters#javascript#xo#GetExecutable(a:buffer))
|
|
||||||
\ . ' ' . ale#Var(a:buffer, 'javascript_xo_options')
|
|
||||||
\ . ' --reporter json --stdin --stdin-filename %s'
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" xo uses eslint and the output format is the same
|
|
||||||
call ale#linter#Define('javascript', {
|
call ale#linter#Define('javascript', {
|
||||||
\ 'name': 'xo',
|
\ 'name': 'xo',
|
||||||
\ 'executable': function('ale_linters#javascript#xo#GetExecutable'),
|
\ 'executable': function('ale#handlers#xo#GetExecutable'),
|
||||||
\ 'command': function('ale_linters#javascript#xo#GetCommand'),
|
\ 'command': function('ale#handlers#xo#GetLintCommand'),
|
||||||
\ 'callback': 'ale#handlers#eslint#HandleJSON',
|
\ 'callback': 'ale#handlers#xo#HandleJSON',
|
||||||
\})
|
\})
|
||||||
|
24
sources_non_forked/ale/ale_linters/json/jq.vim
Normal file
24
sources_non_forked/ale/ale_linters/json/jq.vim
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
" Author: jD91mZM2 <me@krake.one>
|
||||||
|
call ale#Set('json_jq_executable', 'jq')
|
||||||
|
call ale#Set('json_jq_options', '')
|
||||||
|
call ale#Set('json_jq_filters', '.')
|
||||||
|
|
||||||
|
" Matches patterns like the following:
|
||||||
|
" parse error: Expected another key-value pair at line 4, column 3
|
||||||
|
let s:pattern = '^parse error: \(.\+\) at line \(\d\+\), column \(\d\+\)$'
|
||||||
|
|
||||||
|
function! ale_linters#json#jq#Handle(buffer, lines) abort
|
||||||
|
return ale#util#MapMatches(a:lines, s:pattern, {match -> {
|
||||||
|
\ 'text': match[1],
|
||||||
|
\ 'lnum': match[2] + 0,
|
||||||
|
\ 'col': match[3] + 0,
|
||||||
|
\}})
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('json', {
|
||||||
|
\ 'name': 'jq',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'json_jq_executable')},
|
||||||
|
\ 'output_stream': 'stderr',
|
||||||
|
\ 'command': '%e',
|
||||||
|
\ 'callback': 'ale_linters#json#jq#Handle',
|
||||||
|
\})
|
@ -4,7 +4,7 @@ call ale#Set('json_jsonlint_executable', 'jsonlint')
|
|||||||
call ale#Set('json_jsonlint_use_global', get(g:, 'ale_use_global_executables', 0))
|
call ale#Set('json_jsonlint_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||||
|
|
||||||
function! ale_linters#json#jsonlint#GetExecutable(buffer) abort
|
function! ale_linters#json#jsonlint#GetExecutable(buffer) abort
|
||||||
return ale#node#FindExecutable(a:buffer, 'json_jsonlint', [
|
return ale#path#FindExecutable(a:buffer, 'json_jsonlint', [
|
||||||
\ 'node_modules/.bin/jsonlint',
|
\ 'node_modules/.bin/jsonlint',
|
||||||
\ 'node_modules/jsonlint/lib/cli.js',
|
\ 'node_modules/jsonlint/lib/cli.js',
|
||||||
\])
|
\])
|
||||||
|
14
sources_non_forked/ale/ale_linters/json/spectral.vim
Normal file
14
sources_non_forked/ale/ale_linters/json/spectral.vim
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
" Author: t2h5 <https://github.com/t2h5>
|
||||||
|
" Description: Integration of Stoplight Spectral CLI with ALE.
|
||||||
|
|
||||||
|
call ale#Set('json_spectral_executable', 'spectral')
|
||||||
|
call ale#Set('json_spectral_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||||
|
|
||||||
|
call ale#linter#Define('json', {
|
||||||
|
\ 'name': 'spectral',
|
||||||
|
\ 'executable': {b -> ale#path#FindExecutable(b, 'json_spectral', [
|
||||||
|
\ 'node_modules/.bin/spectral',
|
||||||
|
\ ])},
|
||||||
|
\ 'command': '%e lint --ignore-unknown-format -q -f text %t',
|
||||||
|
\ 'callback': 'ale#handlers#spectral#HandleSpectralOutput'
|
||||||
|
\})
|
@ -6,9 +6,9 @@ call ale#Set('julia_executable', 'julia')
|
|||||||
|
|
||||||
function! ale_linters#julia#languageserver#GetCommand(buffer) abort
|
function! ale_linters#julia#languageserver#GetCommand(buffer) abort
|
||||||
let l:julia_executable = ale#Var(a:buffer, 'julia_executable')
|
let l:julia_executable = ale#Var(a:buffer, 'julia_executable')
|
||||||
let l:cmd_string = 'using LanguageServer; server = LanguageServer.LanguageServerInstance(isdefined(Base, :stdin) ? stdin : STDIN, isdefined(Base, :stdout) ? stdout : STDOUT, false); server.runlinter = true; run(server);'
|
let l:cmd_string = 'using LanguageServer; using Pkg; import StaticLint; import SymbolServer; server = LanguageServer.LanguageServerInstance(isdefined(Base, :stdin) ? stdin : STDIN, isdefined(Base, :stdout) ? stdout : STDOUT, dirname(Pkg.Types.Context().env.project_file)); server.runlinter = true; run(server);'
|
||||||
|
|
||||||
return ale#Escape(l:julia_executable) . ' --startup-file=no --history-file=no -e ' . ale#Escape(l:cmd_string)
|
return ale#Escape(l:julia_executable) . ' --project=@. --startup-file=no --history-file=no -e ' . ale#Escape(l:cmd_string)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('julia', {
|
call ale#linter#Define('julia', {
|
||||||
|
@ -15,20 +15,15 @@ function! ale_linters#kotlin#kotlinc#RunWithImportPaths(buffer) abort
|
|||||||
let l:command = ''
|
let l:command = ''
|
||||||
|
|
||||||
" exec maven/gradle only if classpath is not set
|
" exec maven/gradle only if classpath is not set
|
||||||
if ale#Var(a:buffer, 'kotlin_kotlinc_classpath') isnot# ''
|
if !empty(ale#Var(a:buffer, 'kotlin_kotlinc_classpath'))
|
||||||
return ale_linters#kotlin#kotlinc#GetCommand(a:buffer, [], {})
|
return ale_linters#kotlin#kotlinc#GetCommand(a:buffer, [], {})
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let l:pom_path = ale#path#FindNearestFile(a:buffer, 'pom.xml')
|
let [l:cwd, l:command] = ale#maven#BuildClasspathCommand(a:buffer)
|
||||||
|
|
||||||
if !empty(l:pom_path) && executable('mvn')
|
|
||||||
let l:command = ale#path#CdString(fnamemodify(l:pom_path, ':h'))
|
|
||||||
\ . 'mvn dependency:build-classpath'
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Try to use Gradle if Maven isn't available.
|
" Try to use Gradle if Maven isn't available.
|
||||||
if empty(l:command)
|
if empty(l:command)
|
||||||
let l:command = ale#gradle#BuildClasspathCommand(a:buffer)
|
let [l:cwd, l:command] = ale#gradle#BuildClasspathCommand(a:buffer)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if empty(l:command)
|
if empty(l:command)
|
||||||
@ -38,7 +33,8 @@ function! ale_linters#kotlin#kotlinc#RunWithImportPaths(buffer) abort
|
|||||||
return ale#command#Run(
|
return ale#command#Run(
|
||||||
\ a:buffer,
|
\ a:buffer,
|
||||||
\ l:command,
|
\ l:command,
|
||||||
\ function('ale_linters#kotlin#kotlinc#GetCommand')
|
\ function('ale_linters#kotlin#kotlinc#GetCommand'),
|
||||||
|
\ {'cwd': l:cwd},
|
||||||
\)
|
\)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ endfunction
|
|||||||
|
|
||||||
call ale#linter#Define('less', {
|
call ale#linter#Define('less', {
|
||||||
\ 'name': 'lessc',
|
\ 'name': 'lessc',
|
||||||
\ 'executable': {b -> ale#node#FindExecutable(b, 'less_lessc', [
|
\ 'executable': {b -> ale#path#FindExecutable(b, 'less_lessc', [
|
||||||
\ 'node_modules/.bin/lessc',
|
\ 'node_modules/.bin/lessc',
|
||||||
\ ])},
|
\ ])},
|
||||||
\ 'command': function('ale_linters#less#lessc#GetCommand'),
|
\ 'command': function('ale_linters#less#lessc#GetCommand'),
|
||||||
|
@ -12,7 +12,7 @@ endfunction
|
|||||||
|
|
||||||
call ale#linter#Define('less', {
|
call ale#linter#Define('less', {
|
||||||
\ 'name': 'stylelint',
|
\ 'name': 'stylelint',
|
||||||
\ 'executable': {b -> ale#node#FindExecutable(b, 'less_stylelint', [
|
\ 'executable': {b -> ale#path#FindExecutable(b, 'less_stylelint', [
|
||||||
\ 'node_modules/.bin/stylelint',
|
\ 'node_modules/.bin/stylelint',
|
||||||
\ ])},
|
\ ])},
|
||||||
\ 'command': function('ale_linters#less#stylelint#GetCommand'),
|
\ 'command': function('ale_linters#less#stylelint#GetCommand'),
|
||||||
|
@ -39,7 +39,7 @@ endfunction
|
|||||||
call ale#linter#Define('markdown', {
|
call ale#linter#Define('markdown', {
|
||||||
\ 'name': 'remark_lint',
|
\ 'name': 'remark_lint',
|
||||||
\ 'aliases': ['remark-lint'],
|
\ 'aliases': ['remark-lint'],
|
||||||
\ 'executable': {b -> ale#node#FindExecutable(b, 'markdown_remark_lint', [
|
\ 'executable': {b -> ale#path#FindExecutable(b, 'markdown_remark_lint', [
|
||||||
\ 'node_modules/.bin/remark',
|
\ 'node_modules/.bin/remark',
|
||||||
\ ])},
|
\ ])},
|
||||||
\ 'command': function('ale_linters#markdown#remark_lint#GetCommand'),
|
\ 'command': function('ale_linters#markdown#remark_lint#GetCommand'),
|
||||||
|
@ -1,9 +1,24 @@
|
|||||||
" Author: chew-z https://github.com/chew-z
|
" Author: chew-z https://github.com/chew-z
|
||||||
" Description: vale for Markdown files
|
" Description: vale for Markdown files
|
||||||
|
|
||||||
|
call ale#Set('markdown_vale_executable', 'vale')
|
||||||
|
call ale#Set('markdown_vale_input_file', '%t')
|
||||||
|
call ale#Set('markdown_vale_options', '')
|
||||||
|
|
||||||
|
function! ale_linters#markdown#vale#GetCommand(buffer) abort
|
||||||
|
let l:executable = ale#Var(a:buffer, 'markdown_vale_executable')
|
||||||
|
let l:input_file = ale#Var(a:buffer, 'markdown_vale_input_file')
|
||||||
|
|
||||||
|
" Defaults to `vale --output=JSON %t`
|
||||||
|
return ale#Escape(l:executable)
|
||||||
|
\ . ' --output=JSON '
|
||||||
|
\ . ale#Var(a:buffer, 'markdown_vale_options')
|
||||||
|
\ . ' ' . l:input_file
|
||||||
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('markdown', {
|
call ale#linter#Define('markdown', {
|
||||||
\ 'name': 'vale',
|
\ 'name': 'vale',
|
||||||
\ 'executable': 'vale',
|
\ 'executable': {b -> ale#Var(b, 'markdown_vale_executable')},
|
||||||
\ 'command': 'vale --output=JSON %t',
|
\ 'command': function('ale_linters#markdown#vale#GetCommand'),
|
||||||
\ 'callback': 'ale#handlers#vale#Handle',
|
\ 'callback': 'ale#handlers#vale#Handle',
|
||||||
\})
|
\})
|
||||||
|
@ -5,12 +5,9 @@ call ale#Set('mercury_mmc_executable', 'mmc')
|
|||||||
call ale#Set('mercury_mmc_options', '--make --output-compile-error-lines 100')
|
call ale#Set('mercury_mmc_options', '--make --output-compile-error-lines 100')
|
||||||
|
|
||||||
function! ale_linters#mercury#mmc#GetCommand(buffer) abort
|
function! ale_linters#mercury#mmc#GetCommand(buffer) abort
|
||||||
let l:module_name = expand('#' . a:buffer . ':t:r')
|
return '%e --errorcheck-only '
|
||||||
|
|
||||||
return ale#path#BufferCdString(a:buffer)
|
|
||||||
\ . '%e --errorcheck-only '
|
|
||||||
\ . ale#Var(a:buffer, 'mercury_mmc_options')
|
\ . ale#Var(a:buffer, 'mercury_mmc_options')
|
||||||
\ . ' ' . l:module_name
|
\ . ' %s:t:r'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#mercury#mmc#Handle(buffer, lines) abort
|
function! ale_linters#mercury#mmc#Handle(buffer, lines) abort
|
||||||
@ -34,6 +31,7 @@ call ale#linter#Define('mercury', {
|
|||||||
\ 'name': 'mmc',
|
\ 'name': 'mmc',
|
||||||
\ 'output_stream': 'stderr',
|
\ 'output_stream': 'stderr',
|
||||||
\ 'executable': {b -> ale#Var(b, 'mercury_mmc_executable')},
|
\ 'executable': {b -> ale#Var(b, 'mercury_mmc_executable')},
|
||||||
|
\ 'cwd': '%s:h',
|
||||||
\ 'command': function('ale_linters#mercury#mmc#GetCommand'),
|
\ 'command': function('ale_linters#mercury#mmc#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#mercury#mmc#Handle',
|
\ 'callback': 'ale_linters#mercury#mmc#Handle',
|
||||||
\ 'lint_file': 1,
|
\ 'lint_file': 1,
|
||||||
|
@ -1,18 +1,51 @@
|
|||||||
" Author: Alistair Bill <@alibabzo>
|
" Author: Alistair Bill <@alibabzo>
|
||||||
|
" Author: Maximilian Bosch <maximilian@mbosch.me>
|
||||||
" Description: nix-instantiate linter for nix files
|
" Description: nix-instantiate linter for nix files
|
||||||
|
|
||||||
|
function! ale_linters#nix#nix#Command(buffer, output, meta) abort
|
||||||
|
let l:version = a:output[0][22:]
|
||||||
|
|
||||||
|
if l:version =~# '^\(2.4\|3\).*'
|
||||||
|
return 'nix-instantiate --log-format internal-json --parse -'
|
||||||
|
else
|
||||||
|
return 'nix-instantiate --parse -'
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#nix#nix#Handle(buffer, lines) abort
|
function! ale_linters#nix#nix#Handle(buffer, lines) abort
|
||||||
let l:pattern = '^\(.\+\): \(.\+\), at .*:\(\d\+\):\(\d\+\)$'
|
|
||||||
let l:output = []
|
let l:output = []
|
||||||
|
|
||||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
if empty(a:lines)
|
||||||
call add(l:output, {
|
return l:output
|
||||||
\ 'lnum': l:match[3] + 0,
|
endif
|
||||||
\ 'col': l:match[4] + 0,
|
|
||||||
\ 'text': l:match[1] . ': ' . l:match[2],
|
if a:lines[0] =~# '^@nix .*'
|
||||||
\ 'type': l:match[1] =~# '^error' ? 'E' : 'W',
|
for l:line in a:lines
|
||||||
\})
|
if l:line =~# '^@nix .*'
|
||||||
endfor
|
let l:result = json_decode(strpart(l:line, 4))
|
||||||
|
|
||||||
|
if has_key(l:result, 'column')
|
||||||
|
call add(l:output, {
|
||||||
|
\ 'type': 'E',
|
||||||
|
\ 'lnum': l:result.line,
|
||||||
|
\ 'col': l:result.column,
|
||||||
|
\ 'text': l:result.raw_msg
|
||||||
|
\})
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
else
|
||||||
|
let l:pattern = '^\(.\+\): \(.\+\) at .*:\(\d\+\):\(\d\+\)$'
|
||||||
|
|
||||||
|
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||||
|
call add(l:output, {
|
||||||
|
\ 'lnum': l:match[3] + 0,
|
||||||
|
\ 'col': l:match[4] + 0,
|
||||||
|
\ 'text': l:match[1] . ': ' . substitute(l:match[2], ',$', '', ''),
|
||||||
|
\ 'type': l:match[1] =~# '^error' ? 'E' : 'W',
|
||||||
|
\})
|
||||||
|
endfor
|
||||||
|
endif
|
||||||
|
|
||||||
return l:output
|
return l:output
|
||||||
endfunction
|
endfunction
|
||||||
@ -21,6 +54,10 @@ call ale#linter#Define('nix', {
|
|||||||
\ 'name': 'nix',
|
\ 'name': 'nix',
|
||||||
\ 'output_stream': 'stderr',
|
\ 'output_stream': 'stderr',
|
||||||
\ 'executable': 'nix-instantiate',
|
\ 'executable': 'nix-instantiate',
|
||||||
\ 'command': 'nix-instantiate --parse -',
|
\ 'command': {buffer -> ale#command#Run(
|
||||||
|
\ buffer,
|
||||||
|
\ 'nix-instantiate --version',
|
||||||
|
\ function('ale_linters#nix#nix#Command')
|
||||||
|
\ )},
|
||||||
\ 'callback': 'ale_linters#nix#nix#Handle',
|
\ 'callback': 'ale_linters#nix#nix#Handle',
|
||||||
\})
|
\})
|
||||||
|
16
sources_non_forked/ale/ale_linters/nix/rnix_lsp.vim
Normal file
16
sources_non_forked/ale/ale_linters/nix/rnix_lsp.vim
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
" Author: jD91mZM2 <me@krake.one>
|
||||||
|
" Description: rnix-lsp language client
|
||||||
|
|
||||||
|
function! ale_linters#nix#rnix_lsp#GetProjectRoot(buffer) abort
|
||||||
|
" rnix-lsp does not yet use the project root, so getting it right is not
|
||||||
|
" important
|
||||||
|
return fnamemodify(a:buffer, ':h')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('nix', {
|
||||||
|
\ 'name': 'rnix_lsp',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': 'rnix-lsp',
|
||||||
|
\ 'command': '%e',
|
||||||
|
\ 'project_root': function('ale_linters#nix#rnix_lsp#GetProjectRoot'),
|
||||||
|
\})
|
13
sources_non_forked/ale/ale_linters/ocaml/ocamllsp.vim
Normal file
13
sources_non_forked/ale/ale_linters/ocaml/ocamllsp.vim
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
" Author: Risto Stevcev <me@risto.codes>
|
||||||
|
" Description: The official language server for OCaml
|
||||||
|
|
||||||
|
call ale#Set('ocaml_ocamllsp_use_opam', 1)
|
||||||
|
|
||||||
|
call ale#linter#Define('ocaml', {
|
||||||
|
\ 'name': 'ocamllsp',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': function('ale#handlers#ocamllsp#GetExecutable'),
|
||||||
|
\ 'command': function('ale#handlers#ocamllsp#GetCommand'),
|
||||||
|
\ 'language': function('ale#handlers#ocamllsp#GetLanguage'),
|
||||||
|
\ 'project_root': function('ale#handlers#ocamllsp#GetProjectRoot'),
|
||||||
|
\})
|
17
sources_non_forked/ale/ale_linters/ocamlinterface/merlin.vim
Normal file
17
sources_non_forked/ale/ale_linters/ocamlinterface/merlin.vim
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
" Author: Andrey Popp -- @andreypopp
|
||||||
|
" Description: Report errors in OCaml code with Merlin
|
||||||
|
|
||||||
|
if !exists('g:merlin')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
function! ale_linters#ocamlinterface#merlin#Handle(buffer, lines) abort
|
||||||
|
return merlin#ErrorLocList()
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('ocamlinterface', {
|
||||||
|
\ 'name': 'merlin',
|
||||||
|
\ 'executable': 'ocamlmerlin',
|
||||||
|
\ 'command': 'true',
|
||||||
|
\ 'callback': 'ale_linters#ocamlinterface#merlin#Handle',
|
||||||
|
\})
|
@ -0,0 +1,13 @@
|
|||||||
|
" Author: Risto Stevcev <me@risto.codes>
|
||||||
|
" Description: The official language server for OCaml
|
||||||
|
|
||||||
|
call ale#Set('ocaml_ocamllsp_use_opam', 1)
|
||||||
|
|
||||||
|
call ale#linter#Define('ocamlinterface', {
|
||||||
|
\ 'name': 'ocamllsp',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': function('ale#handlers#ocamllsp#GetExecutable'),
|
||||||
|
\ 'command': function('ale#handlers#ocamllsp#GetCommand'),
|
||||||
|
\ 'language': function('ale#handlers#ocamllsp#GetLanguage'),
|
||||||
|
\ 'project_root': function('ale#handlers#ocamllsp#GetProjectRoot'),
|
||||||
|
\})
|
58
sources_non_forked/ale/ale_linters/openapi/ibm_validator.vim
Normal file
58
sources_non_forked/ale/ale_linters/openapi/ibm_validator.vim
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
" Author: Horacio Sanson <hsanson@gmail.com>
|
||||||
|
|
||||||
|
call ale#Set('openapi_ibm_validator_executable', 'lint-openapi')
|
||||||
|
call ale#Set('openapi_ibm_validator_options', '')
|
||||||
|
|
||||||
|
function! ale_linters#openapi#ibm_validator#GetCommand(buffer) abort
|
||||||
|
return '%e' . ale#Pad(ale#Var(a:buffer, 'openapi_ibm_validator_options'))
|
||||||
|
\ . ' %t'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#openapi#ibm_validator#Handle(buffer, lines) abort
|
||||||
|
let l:output = []
|
||||||
|
let l:type = 'E'
|
||||||
|
let l:message = ''
|
||||||
|
let l:nr = -1
|
||||||
|
|
||||||
|
for l:line in a:lines
|
||||||
|
let l:match = matchlist(l:line, '^errors$')
|
||||||
|
|
||||||
|
if !empty(l:match)
|
||||||
|
let l:type = 'E'
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:match = matchlist(l:line, '^warnings$')
|
||||||
|
|
||||||
|
if !empty(l:match)
|
||||||
|
let l:type = 'W'
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:match = matchlist(l:line, '^ *Message : *\(.\+\)$')
|
||||||
|
|
||||||
|
if !empty(l:match)
|
||||||
|
let l:message = l:match[1]
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:match = matchlist(l:line, '^ *Line *: *\(\d\+\)$')
|
||||||
|
|
||||||
|
if !empty(l:match)
|
||||||
|
let l:nr = l:match[1]
|
||||||
|
|
||||||
|
call add(l:output, {
|
||||||
|
\ 'lnum': l:nr + 0,
|
||||||
|
\ 'col': 0,
|
||||||
|
\ 'text': l:message,
|
||||||
|
\ 'type': l:type,
|
||||||
|
\})
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:output
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('openapi', {
|
||||||
|
\ 'name': 'ibm_validator',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'openapi_ibm_validator_executable')},
|
||||||
|
\ 'command': function('ale_linters#openapi#ibm_validator#GetCommand'),
|
||||||
|
\ 'callback': 'ale_linters#openapi#ibm_validator#Handle',
|
||||||
|
\})
|
9
sources_non_forked/ale/ale_linters/openapi/yamllint.vim
Normal file
9
sources_non_forked/ale/ale_linters/openapi/yamllint.vim
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
call ale#Set('yaml_yamllint_executable', 'yamllint')
|
||||||
|
call ale#Set('yaml_yamllint_options', '')
|
||||||
|
|
||||||
|
call ale#linter#Define('openapi', {
|
||||||
|
\ 'name': 'yamllint',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'yaml_yamllint_executable')},
|
||||||
|
\ 'command': function('ale#handlers#yamllint#GetCommand'),
|
||||||
|
\ 'callback': 'ale#handlers#yamllint#Handle',
|
||||||
|
\})
|
@ -88,7 +88,7 @@ function! ale_linters#perl6#perl6#Handle(buffer, lines) abort
|
|||||||
|
|
||||||
try
|
try
|
||||||
let l:json = json_decode(join(a:lines, ''))
|
let l:json = json_decode(join(a:lines, ''))
|
||||||
catch /E474/
|
catch /E474\|E491/
|
||||||
call add(l:output, {
|
call add(l:output, {
|
||||||
\ 'lnum': '1',
|
\ 'lnum': '1',
|
||||||
\ 'text': 'Received output in the default Perl6 error format. See :ALEDetail for details',
|
\ 'text': 'Received output in the default Perl6 error format. See :ALEDetail for details',
|
||||||
|
@ -18,15 +18,15 @@ function! ale_linters#php#intelephense#GetProjectRoot(buffer) abort
|
|||||||
return !empty(l:git_path) ? fnamemodify(l:git_path, ':h:h') : ''
|
return !empty(l:git_path) ? fnamemodify(l:git_path, ':h:h') : ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#php#intelephense#GetInitializationOptions() abort
|
function! ale_linters#php#intelephense#GetInitializationOptions(buffer) abort
|
||||||
return ale#Get('php_intelephense_config')
|
return ale#Var(a:buffer, 'php_intelephense_config')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('php', {
|
call ale#linter#Define('php', {
|
||||||
\ 'name': 'intelephense',
|
\ 'name': 'intelephense',
|
||||||
\ 'lsp': 'stdio',
|
\ 'lsp': 'stdio',
|
||||||
\ 'initialization_options': function('ale_linters#php#intelephense#GetInitializationOptions'),
|
\ 'initialization_options': function('ale_linters#php#intelephense#GetInitializationOptions'),
|
||||||
\ 'executable': {b -> ale#node#FindExecutable(b, 'php_intelephense', [])},
|
\ 'executable': {b -> ale#path#FindExecutable(b, 'php_intelephense', [])},
|
||||||
\ 'command': '%e --stdio',
|
\ 'command': '%e --stdio',
|
||||||
\ 'project_root': function('ale_linters#php#intelephense#GetProjectRoot'),
|
\ 'project_root': function('ale_linters#php#intelephense#GetProjectRoot'),
|
||||||
\})
|
\})
|
||||||
|
@ -19,7 +19,7 @@ endfunction
|
|||||||
call ale#linter#Define('php', {
|
call ale#linter#Define('php', {
|
||||||
\ 'name': 'langserver',
|
\ 'name': 'langserver',
|
||||||
\ 'lsp': 'stdio',
|
\ 'lsp': 'stdio',
|
||||||
\ 'executable': {b -> ale#node#FindExecutable(b, 'php_langserver', [
|
\ 'executable': {b -> ale#path#FindExecutable(b, 'php_langserver', [
|
||||||
\ 'vendor/bin/php-language-server.php',
|
\ 'vendor/bin/php-language-server.php',
|
||||||
\ ])},
|
\ ])},
|
||||||
\ 'command': 'php %e',
|
\ 'command': 'php %e',
|
||||||
|
@ -39,7 +39,7 @@ function! ale_linters#php#phan#Handle(buffer, lines) abort
|
|||||||
let l:pattern = '^Phan error: \(\w\+\): \(.\+\) in \(.\+\) on line \(\d\+\)$'
|
let l:pattern = '^Phan error: \(\w\+\): \(.\+\) in \(.\+\) on line \(\d\+\)$'
|
||||||
else
|
else
|
||||||
" /path/to/some-filename.php:18 ERRORTYPE message
|
" /path/to/some-filename.php:18 ERRORTYPE message
|
||||||
let l:pattern = '^.*:\(\d\+\)\s\(\w\+\)\s\(.\+\)$'
|
let l:pattern = '^\(.*\):\(\d\+\)\s\(\w\+\)\s\(.\+\)$'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let l:output = []
|
let l:output = []
|
||||||
@ -49,13 +49,15 @@ function! ale_linters#php#phan#Handle(buffer, lines) abort
|
|||||||
let l:dict = {
|
let l:dict = {
|
||||||
\ 'lnum': l:match[4] + 0,
|
\ 'lnum': l:match[4] + 0,
|
||||||
\ 'text': l:match[2],
|
\ 'text': l:match[2],
|
||||||
|
\ 'filename': l:match[3],
|
||||||
\ 'type': 'W',
|
\ 'type': 'W',
|
||||||
\}
|
\}
|
||||||
else
|
else
|
||||||
let l:dict = {
|
let l:dict = {
|
||||||
\ 'lnum': l:match[1] + 0,
|
\ 'lnum': l:match[2] + 0,
|
||||||
\ 'text': l:match[3],
|
\ 'text': l:match[4],
|
||||||
\ 'type': 'W',
|
\ 'type': 'W',
|
||||||
|
\ 'filename': l:match[1],
|
||||||
\}
|
\}
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -13,8 +13,7 @@ function! ale_linters#php#phpcs#GetCommand(buffer) abort
|
|||||||
\ ? '--standard=' . ale#Escape(l:standard)
|
\ ? '--standard=' . ale#Escape(l:standard)
|
||||||
\ : ''
|
\ : ''
|
||||||
|
|
||||||
return ale#path#BufferCdString(a:buffer)
|
return '%e -s --report=emacs --stdin-path=%s'
|
||||||
\ . '%e -s --report=emacs --stdin-path=%s'
|
|
||||||
\ . ale#Pad(l:standard_option)
|
\ . ale#Pad(l:standard_option)
|
||||||
\ . ale#Pad(ale#Var(a:buffer, 'php_phpcs_options'))
|
\ . ale#Pad(ale#Var(a:buffer, 'php_phpcs_options'))
|
||||||
endfunction
|
endfunction
|
||||||
@ -45,10 +44,11 @@ endfunction
|
|||||||
|
|
||||||
call ale#linter#Define('php', {
|
call ale#linter#Define('php', {
|
||||||
\ 'name': 'phpcs',
|
\ 'name': 'phpcs',
|
||||||
\ 'executable': {b -> ale#node#FindExecutable(b, 'php_phpcs', [
|
\ 'executable': {b -> ale#path#FindExecutable(b, 'php_phpcs', [
|
||||||
\ 'vendor/bin/phpcs',
|
\ 'vendor/bin/phpcs',
|
||||||
\ 'phpcs'
|
\ 'phpcs'
|
||||||
\ ])},
|
\ ])},
|
||||||
|
\ 'cwd': '%s:h',
|
||||||
\ 'command': function('ale_linters#php#phpcs#GetCommand'),
|
\ 'command': function('ale_linters#php#phpcs#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#php#phpcs#Handle',
|
\ 'callback': 'ale_linters#php#phpcs#Handle',
|
||||||
\})
|
\})
|
||||||
|
@ -18,7 +18,7 @@ endfunction
|
|||||||
call ale#linter#Define('php', {
|
call ale#linter#Define('php', {
|
||||||
\ 'name': 'psalm',
|
\ 'name': 'psalm',
|
||||||
\ 'lsp': 'stdio',
|
\ 'lsp': 'stdio',
|
||||||
\ 'executable': {b -> ale#node#FindExecutable(b, 'php_psalm', [
|
\ 'executable': {b -> ale#path#FindExecutable(b, 'php_psalm', [
|
||||||
\ 'vendor/bin/psalm',
|
\ 'vendor/bin/psalm',
|
||||||
\ ])},
|
\ ])},
|
||||||
\ 'command': function('ale_linters#php#psalm#GetCommand'),
|
\ 'command': function('ale_linters#php#psalm#GetCommand'),
|
||||||
|
@ -20,7 +20,7 @@ function! ale_linters#php#tlint#GetProjectRoot(buffer) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#php#tlint#GetExecutable(buffer) abort
|
function! ale_linters#php#tlint#GetExecutable(buffer) abort
|
||||||
return ale#node#FindExecutable(a:buffer, 'php_tlint', [
|
return ale#path#FindExecutable(a:buffer, 'php_tlint', [
|
||||||
\ 'vendor/bin/tlint',
|
\ 'vendor/bin/tlint',
|
||||||
\ 'tlint',
|
\ 'tlint',
|
||||||
\])
|
\])
|
||||||
|
@ -35,10 +35,11 @@ function! s:Subst(format, vars) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#prolog#swipl#Handle(buffer, lines) abort
|
function! ale_linters#prolog#swipl#Handle(buffer, lines) abort
|
||||||
let l:pattern = '\v^(ERROR|Warning)+%(:\s*[^:]+:(\d+)%(:(\d+))?)?:\s*(.*)$'
|
|
||||||
let l:output = []
|
let l:output = []
|
||||||
let l:i = 0
|
let l:i = 0
|
||||||
|
|
||||||
|
let l:pattern = '\v^(ERROR|Warning)+%(:\s*[^:]+:(\d+)%(:(\d+))?)?:\s*(.*)$'
|
||||||
|
|
||||||
while l:i < len(a:lines)
|
while l:i < len(a:lines)
|
||||||
let l:match = matchlist(a:lines[l:i], l:pattern)
|
let l:match = matchlist(a:lines[l:i], l:pattern)
|
||||||
|
|
||||||
@ -72,8 +73,17 @@ function! s:GetErrMsg(i, lines, text) abort
|
|||||||
let l:i = a:i + 1
|
let l:i = a:i + 1
|
||||||
let l:text = []
|
let l:text = []
|
||||||
|
|
||||||
while l:i < len(a:lines) && a:lines[l:i] =~# '^\s'
|
let l:pattern = '\v^(ERROR|Warning)?:?(.*)$'
|
||||||
call add(l:text, s:Trim(a:lines[l:i]))
|
|
||||||
|
while l:i < len(a:lines)
|
||||||
|
let l:match = matchlist(a:lines[l:i], l:pattern)
|
||||||
|
|
||||||
|
if empty(l:match) || empty(l:match[2])
|
||||||
|
let l:i += 1
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
|
||||||
|
call add(l:text, s:Trim(l:match[2]))
|
||||||
let l:i += 1
|
let l:i += 1
|
||||||
endwhile
|
endwhile
|
||||||
|
|
||||||
|
24
sources_non_forked/ale/ale_linters/proto/protolint.vim
Normal file
24
sources_non_forked/ale/ale_linters/proto/protolint.vim
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
" Author: Yohei Yoshimuta <yoheimuta@gmail.com>
|
||||||
|
" Description: run the protolint for Protocol Buffer files
|
||||||
|
|
||||||
|
call ale#Set('proto_protolint_executable', 'protolint')
|
||||||
|
call ale#Set('proto_protolint_config', '')
|
||||||
|
|
||||||
|
function! ale_linters#proto#protolint#GetCommand(buffer) abort
|
||||||
|
let l:config = ale#Var(a:buffer, 'proto_protolint_config')
|
||||||
|
|
||||||
|
return '%e lint'
|
||||||
|
\ . (!empty(l:config) ? ' -config_path=' . ale#Escape(l:config) : '')
|
||||||
|
\ . ' -reporter=unix'
|
||||||
|
\ . ' %s'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('proto', {
|
||||||
|
\ 'name': 'protolint',
|
||||||
|
\ 'lint_file': 1,
|
||||||
|
\ 'output_stream': 'stderr',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'proto_protolint_executable')},
|
||||||
|
\ 'command': function('ale_linters#proto#protolint#GetCommand'),
|
||||||
|
\ 'callback': 'ale#handlers#unix#HandleAsError',
|
||||||
|
\})
|
||||||
|
|
@ -47,7 +47,7 @@ endfunction
|
|||||||
|
|
||||||
call ale#linter#Define('pug', {
|
call ale#linter#Define('pug', {
|
||||||
\ 'name': 'puglint',
|
\ 'name': 'puglint',
|
||||||
\ 'executable': {b -> ale#node#FindExecutable(b, 'pug_puglint', [
|
\ 'executable': {b -> ale#path#FindExecutable(b, 'pug_puglint', [
|
||||||
\ 'node_modules/.bin/pug-lint',
|
\ 'node_modules/.bin/pug-lint',
|
||||||
\ ])},
|
\ ])},
|
||||||
\ 'output_stream': 'stderr',
|
\ 'output_stream': 'stderr',
|
||||||
|
@ -6,7 +6,7 @@ call ale#Set('purescript_ls_use_global', get(g:, 'ale_use_global_executables', 0
|
|||||||
call ale#Set('purescript_ls_config', {})
|
call ale#Set('purescript_ls_config', {})
|
||||||
|
|
||||||
function! ale_linters#purescript#ls#GetExecutable(buffer) abort
|
function! ale_linters#purescript#ls#GetExecutable(buffer) abort
|
||||||
return ale#node#FindExecutable(a:buffer, 'purescript_ls', [
|
return ale#path#FindExecutable(a:buffer, 'purescript_ls', [
|
||||||
\ 'node_modules/.bin/purescript-language-server',
|
\ 'node_modules/.bin/purescript-language-server',
|
||||||
\])
|
\])
|
||||||
endfunction
|
endfunction
|
||||||
|
@ -38,30 +38,28 @@ function! ale_linters#python#flake8#RunWithVersionCheck(buffer) abort
|
|||||||
\)
|
\)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#python#flake8#GetCdString(buffer) abort
|
function! ale_linters#python#flake8#GetCwd(buffer) abort
|
||||||
let l:change_directory = ale#Var(a:buffer, 'python_flake8_change_directory')
|
let l:change_directory = ale#Var(a:buffer, 'python_flake8_change_directory')
|
||||||
let l:cd_string = ''
|
let l:cwd = ''
|
||||||
|
|
||||||
if l:change_directory is# 'project'
|
if l:change_directory is# 'project'
|
||||||
let l:project_root = ale#python#FindProjectRootIni(a:buffer)
|
let l:project_root = ale#python#FindProjectRootIni(a:buffer)
|
||||||
|
|
||||||
if !empty(l:project_root)
|
if !empty(l:project_root)
|
||||||
let l:cd_string = ale#path#CdString(l:project_root)
|
let l:cwd = l:project_root
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if (l:change_directory is# 'project' && empty(l:cd_string))
|
if (l:change_directory is# 'project' && empty(l:cwd))
|
||||||
\|| l:change_directory is# 1
|
\|| l:change_directory is# 1
|
||||||
\|| l:change_directory is# 'file'
|
\|| l:change_directory is# 'file'
|
||||||
let l:cd_string = ale#path#BufferCdString(a:buffer)
|
let l:cwd = '%s:h'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return l:cd_string
|
return l:cwd
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#python#flake8#GetCommand(buffer, version) abort
|
function! ale_linters#python#flake8#GetCommand(buffer, version) abort
|
||||||
let l:cd_string = ale_linters#python#flake8#GetCdString(a:buffer)
|
|
||||||
|
|
||||||
let l:executable = ale_linters#python#flake8#GetExecutable(a:buffer)
|
let l:executable = ale_linters#python#flake8#GetExecutable(a:buffer)
|
||||||
|
|
||||||
let l:exec_args = l:executable =~? 'pipenv$'
|
let l:exec_args = l:executable =~? 'pipenv$'
|
||||||
@ -76,8 +74,7 @@ function! ale_linters#python#flake8#GetCommand(buffer, version) abort
|
|||||||
|
|
||||||
let l:options = ale#Var(a:buffer, 'python_flake8_options')
|
let l:options = ale#Var(a:buffer, 'python_flake8_options')
|
||||||
|
|
||||||
return l:cd_string
|
return ale#Escape(l:executable) . l:exec_args
|
||||||
\ . ale#Escape(l:executable) . l:exec_args
|
|
||||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||||
\ . ' --format=default'
|
\ . ' --format=default'
|
||||||
\ . l:display_name_args . ' -'
|
\ . l:display_name_args . ' -'
|
||||||
@ -161,6 +158,7 @@ endfunction
|
|||||||
call ale#linter#Define('python', {
|
call ale#linter#Define('python', {
|
||||||
\ 'name': 'flake8',
|
\ 'name': 'flake8',
|
||||||
\ 'executable': function('ale_linters#python#flake8#GetExecutable'),
|
\ 'executable': function('ale_linters#python#flake8#GetExecutable'),
|
||||||
|
\ 'cwd': function('ale_linters#python#flake8#GetCwd'),
|
||||||
\ 'command': function('ale_linters#python#flake8#RunWithVersionCheck'),
|
\ 'command': function('ale_linters#python#flake8#RunWithVersionCheck'),
|
||||||
\ 'callback': 'ale_linters#python#flake8#Handle',
|
\ 'callback': 'ale_linters#python#flake8#Handle',
|
||||||
\})
|
\})
|
||||||
|
@ -18,7 +18,7 @@ function! ale_linters#python#mypy#GetExecutable(buffer) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" The directory to change to before running mypy
|
" The directory to change to before running mypy
|
||||||
function! s:GetDir(buffer) abort
|
function! ale_linters#python#mypy#GetCwd(buffer) abort
|
||||||
" If we find a directory with "mypy.ini" in it use that,
|
" If we find a directory with "mypy.ini" in it use that,
|
||||||
" else try and find the "python project" root, or failing
|
" else try and find the "python project" root, or failing
|
||||||
" that, run from the same folder as the current file
|
" that, run from the same folder as the current file
|
||||||
@ -36,24 +36,19 @@ function! s:GetDir(buffer) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#python#mypy#GetCommand(buffer) abort
|
function! ale_linters#python#mypy#GetCommand(buffer) abort
|
||||||
let l:dir = s:GetDir(a:buffer)
|
|
||||||
let l:executable = ale_linters#python#mypy#GetExecutable(a:buffer)
|
let l:executable = ale_linters#python#mypy#GetExecutable(a:buffer)
|
||||||
|
|
||||||
let l:exec_args = l:executable =~? 'pipenv$'
|
let l:exec_args = l:executable =~? 'pipenv$'
|
||||||
\ ? ' run mypy'
|
\ ? ' run mypy'
|
||||||
\ : ''
|
\ : ''
|
||||||
|
|
||||||
" We have to always switch to an explicit directory for a command so
|
return '%e' . l:exec_args
|
||||||
" we can know with certainty the base path for the 'filename' keys below.
|
\ . ale#Pad(ale#Var(a:buffer, 'python_mypy_options'))
|
||||||
return ale#path#CdString(l:dir)
|
\ . ' --show-column-numbers'
|
||||||
\ . ale#Escape(l:executable) . l:exec_args
|
|
||||||
\ . ' --show-column-numbers '
|
|
||||||
\ . ale#Var(a:buffer, 'python_mypy_options')
|
|
||||||
\ . ' --shadow-file %s %t %s'
|
\ . ' --shadow-file %s %t %s'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#python#mypy#Handle(buffer, lines) abort
|
function! ale_linters#python#mypy#Handle(buffer, lines) abort
|
||||||
let l:dir = s:GetDir(a:buffer)
|
let l:dir = ale_linters#python#mypy#GetCwd(a:buffer)
|
||||||
" Look for lines like the following:
|
" Look for lines like the following:
|
||||||
"
|
"
|
||||||
" file.py:4: error: No library stub file for module 'django.db'
|
" file.py:4: error: No library stub file for module 'django.db'
|
||||||
@ -95,6 +90,7 @@ endfunction
|
|||||||
call ale#linter#Define('python', {
|
call ale#linter#Define('python', {
|
||||||
\ 'name': 'mypy',
|
\ 'name': 'mypy',
|
||||||
\ 'executable': function('ale_linters#python#mypy#GetExecutable'),
|
\ 'executable': function('ale_linters#python#mypy#GetExecutable'),
|
||||||
|
\ 'cwd': function('ale_linters#python#mypy#GetCwd'),
|
||||||
\ 'command': function('ale_linters#python#mypy#GetCommand'),
|
\ 'command': function('ale_linters#python#mypy#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#python#mypy#Handle',
|
\ 'callback': 'ale_linters#python#mypy#Handle',
|
||||||
\ 'output_stream': 'both'
|
\ 'output_stream': 'both'
|
||||||
|
@ -21,8 +21,7 @@ function! ale_linters#python#pydocstyle#GetCommand(buffer) abort
|
|||||||
\ ? ' run pydocstyle'
|
\ ? ' run pydocstyle'
|
||||||
\ : ''
|
\ : ''
|
||||||
|
|
||||||
return ale#path#BufferCdString(a:buffer)
|
return ale#Escape(l:executable) . l:exec_args
|
||||||
\ . ale#Escape(l:executable) . l:exec_args
|
|
||||||
\ . ale#Pad(ale#Var(a:buffer, 'python_pydocstyle_options'))
|
\ . ale#Pad(ale#Var(a:buffer, 'python_pydocstyle_options'))
|
||||||
\ . ' %s:t'
|
\ . ' %s:t'
|
||||||
endfunction
|
endfunction
|
||||||
@ -66,6 +65,7 @@ endfunction
|
|||||||
call ale#linter#Define('python', {
|
call ale#linter#Define('python', {
|
||||||
\ 'name': 'pydocstyle',
|
\ 'name': 'pydocstyle',
|
||||||
\ 'executable': function('ale_linters#python#pydocstyle#GetExecutable'),
|
\ 'executable': function('ale_linters#python#pydocstyle#GetExecutable'),
|
||||||
|
\ 'cwd': '%s:h',
|
||||||
\ 'command': function('ale_linters#python#pydocstyle#GetCommand'),
|
\ 'command': function('ale_linters#python#pydocstyle#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#python#pydocstyle#Handle',
|
\ 'callback': 'ale_linters#python#pydocstyle#Handle',
|
||||||
\})
|
\})
|
||||||
|
@ -16,19 +16,20 @@ function! ale_linters#python#pylama#GetExecutable(buffer) abort
|
|||||||
return ale#python#FindExecutable(a:buffer, 'python_pylama', ['pylama'])
|
return ale#python#FindExecutable(a:buffer, 'python_pylama', ['pylama'])
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#python#pylama#GetCommand(buffer) abort
|
function! ale_linters#python#pylama#GetCwd(buffer) abort
|
||||||
let l:cd_string = ''
|
|
||||||
|
|
||||||
if ale#Var(a:buffer, 'python_pylama_change_directory')
|
if ale#Var(a:buffer, 'python_pylama_change_directory')
|
||||||
" Pylama loads its configuration from the current directory only, and
|
" Pylama loads its configuration from the current directory only, and
|
||||||
" applies file masks using paths relative to the current directory.
|
" applies file masks using paths relative to the current directory.
|
||||||
" Run from project root, if found, otherwise buffer dir.
|
" Run from project root, if found, otherwise buffer dir.
|
||||||
let l:project_root = ale#python#FindProjectRoot(a:buffer)
|
let l:project_root = ale#python#FindProjectRoot(a:buffer)
|
||||||
let l:cd_string = l:project_root isnot# ''
|
|
||||||
\ ? ale#path#CdString(l:project_root)
|
return !empty(l:project_root) ? l:project_root : '%s:h'
|
||||||
\ : ale#path#BufferCdString(a:buffer)
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
return ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#python#pylama#GetCommand(buffer) abort
|
||||||
let l:executable = ale_linters#python#pylama#GetExecutable(a:buffer)
|
let l:executable = ale_linters#python#pylama#GetExecutable(a:buffer)
|
||||||
let l:exec_args = l:executable =~? 'pipenv$'
|
let l:exec_args = l:executable =~? 'pipenv$'
|
||||||
\ ? ' run pylama'
|
\ ? ' run pylama'
|
||||||
@ -37,8 +38,7 @@ function! ale_linters#python#pylama#GetCommand(buffer) abort
|
|||||||
" Note: Using %t to lint changes would be preferable, but many pylama
|
" Note: Using %t to lint changes would be preferable, but many pylama
|
||||||
" checks use surrounding paths (e.g. C0103 module name, E0402 relative
|
" checks use surrounding paths (e.g. C0103 module name, E0402 relative
|
||||||
" import beyond top, etc.). Neither is ideal.
|
" import beyond top, etc.). Neither is ideal.
|
||||||
return l:cd_string
|
return ale#Escape(l:executable) . l:exec_args
|
||||||
\ . ale#Escape(l:executable) . l:exec_args
|
|
||||||
\ . ale#Pad(ale#Var(a:buffer, 'python_pylama_options'))
|
\ . ale#Pad(ale#Var(a:buffer, 'python_pylama_options'))
|
||||||
\ . ' %s'
|
\ . ' %s'
|
||||||
endfunction
|
endfunction
|
||||||
@ -86,6 +86,7 @@ endfunction
|
|||||||
call ale#linter#Define('python', {
|
call ale#linter#Define('python', {
|
||||||
\ 'name': 'pylama',
|
\ 'name': 'pylama',
|
||||||
\ 'executable': function('ale_linters#python#pylama#GetExecutable'),
|
\ 'executable': function('ale_linters#python#pylama#GetExecutable'),
|
||||||
|
\ 'cwd': function('ale_linters#python#pylama#GetCwd'),
|
||||||
\ 'command': function('ale_linters#python#pylama#GetCommand'),
|
\ 'command': function('ale_linters#python#pylama#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#python#pylama#Handle',
|
\ 'callback': 'ale_linters#python#pylama#Handle',
|
||||||
\ 'lint_file': 1,
|
\ 'lint_file': 1,
|
||||||
|
@ -17,27 +17,26 @@ function! ale_linters#python#pylint#GetExecutable(buffer) abort
|
|||||||
return ale#python#FindExecutable(a:buffer, 'python_pylint', ['pylint'])
|
return ale#python#FindExecutable(a:buffer, 'python_pylint', ['pylint'])
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#python#pylint#GetCommand(buffer, version) abort
|
function! ale_linters#python#pylint#GetCwd(buffer) abort
|
||||||
let l:cd_string = ''
|
|
||||||
|
|
||||||
if ale#Var(a:buffer, 'python_pylint_change_directory')
|
if ale#Var(a:buffer, 'python_pylint_change_directory')
|
||||||
" pylint only checks for pylintrc in the packages above its current
|
" pylint only checks for pylintrc in the packages above its current
|
||||||
" directory before falling back to user and global pylintrc.
|
" directory before falling back to user and global pylintrc.
|
||||||
" Run from project root, if found, otherwise buffer dir.
|
" Run from project root, if found, otherwise buffer dir.
|
||||||
let l:project_root = ale#python#FindProjectRoot(a:buffer)
|
let l:project_root = ale#python#FindProjectRoot(a:buffer)
|
||||||
let l:cd_string = l:project_root isnot# ''
|
|
||||||
\ ? ale#path#CdString(l:project_root)
|
return !empty(l:project_root) ? l:project_root : '%s:h'
|
||||||
\ : ale#path#BufferCdString(a:buffer)
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let l:executable = ale_linters#python#pylint#GetExecutable(a:buffer)
|
return ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#python#pylint#GetCommand(buffer, version) abort
|
||||||
|
let l:executable = ale_linters#python#pylint#GetExecutable(a:buffer)
|
||||||
let l:exec_args = l:executable =~? 'pipenv$'
|
let l:exec_args = l:executable =~? 'pipenv$'
|
||||||
\ ? ' run pylint'
|
\ ? ' run pylint'
|
||||||
\ : ''
|
\ : ''
|
||||||
|
|
||||||
return l:cd_string
|
return ale#Escape(l:executable) . l:exec_args
|
||||||
\ . ale#Escape(l:executable) . l:exec_args
|
|
||||||
\ . ale#Pad(ale#Var(a:buffer, 'python_pylint_options'))
|
\ . ale#Pad(ale#Var(a:buffer, 'python_pylint_options'))
|
||||||
\ . ' --output-format text --msg-template="{path}:{line}:{column}: {msg_id} ({symbol}) {msg}" --reports n'
|
\ . ' --output-format text --msg-template="{path}:{line}:{column}: {msg_id} ({symbol}) {msg}" --reports n'
|
||||||
\ . (ale#semver#GTE(a:version, [2, 4, 0]) ? ' --from-stdin' : '')
|
\ . (ale#semver#GTE(a:version, [2, 4, 0]) ? ' --from-stdin' : '')
|
||||||
@ -104,6 +103,7 @@ call ale#linter#Define('python', {
|
|||||||
\ '%e --version',
|
\ '%e --version',
|
||||||
\ {buffer, version -> !ale#semver#GTE(version, [2, 4, 0])},
|
\ {buffer, version -> !ale#semver#GTE(version, [2, 4, 0])},
|
||||||
\ )},
|
\ )},
|
||||||
|
\ 'cwd': function('ale_linters#python#pylint#GetCwd'),
|
||||||
\ 'command': {buffer -> ale#semver#RunWithVersionCheck(
|
\ 'command': {buffer -> ale#semver#RunWithVersionCheck(
|
||||||
\ buffer,
|
\ buffer,
|
||||||
\ ale#Var(buffer, 'python_pylint_executable'),
|
\ ale#Var(buffer, 'python_pylint_executable'),
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
" Description: A language server for Python
|
" Description: A language server for Python
|
||||||
|
|
||||||
call ale#Set('python_pyls_executable', 'pyls')
|
call ale#Set('python_pyls_executable', 'pyls')
|
||||||
|
call ale#Set('python_pyls_options', '')
|
||||||
call ale#Set('python_pyls_use_global', get(g:, 'ale_use_global_executables', 0))
|
call ale#Set('python_pyls_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||||
call ale#Set('python_pyls_auto_pipenv', 0)
|
call ale#Set('python_pyls_auto_pipenv', 0)
|
||||||
call ale#Set('python_pyls_config', {})
|
call ale#Set('python_pyls_config', {})
|
||||||
@ -22,7 +23,7 @@ function! ale_linters#python#pyls#GetCommand(buffer) abort
|
|||||||
\ ? ' run pyls'
|
\ ? ' run pyls'
|
||||||
\ : ''
|
\ : ''
|
||||||
|
|
||||||
return ale#Escape(l:executable) . l:exec_args
|
return ale#Escape(l:executable) . l:exec_args . ale#Pad(ale#Var(a:buffer, 'python_pyls_options'))
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('python', {
|
call ale#linter#Define('python', {
|
||||||
|
@ -6,7 +6,6 @@ call ale#Set('python_vulture_options', '')
|
|||||||
call ale#Set('python_vulture_use_global', get(g:, 'ale_use_global_executables', 0))
|
call ale#Set('python_vulture_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||||
call ale#Set('python_vulture_change_directory', 1)
|
call ale#Set('python_vulture_change_directory', 1)
|
||||||
|
|
||||||
|
|
||||||
" The directory to change to before running vulture
|
" The directory to change to before running vulture
|
||||||
function! s:GetDir(buffer) abort
|
function! s:GetDir(buffer) abort
|
||||||
let l:project_root = ale#python#FindProjectRoot(a:buffer)
|
let l:project_root = ale#python#FindProjectRoot(a:buffer)
|
||||||
@ -16,29 +15,28 @@ function! s:GetDir(buffer) abort
|
|||||||
\ : expand('#' . a:buffer . ':p:h')
|
\ : expand('#' . a:buffer . ':p:h')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
function! ale_linters#python#vulture#GetExecutable(buffer) abort
|
function! ale_linters#python#vulture#GetExecutable(buffer) abort
|
||||||
return ale#python#FindExecutable(a:buffer, 'python_vulture', ['vulture'])
|
return ale#python#FindExecutable(a:buffer, 'python_vulture', ['vulture'])
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#python#vulture#GetCwd(buffer) abort
|
||||||
|
if !ale#Var(a:buffer, 'python_vulture_change_directory')
|
||||||
|
return ''
|
||||||
|
endif
|
||||||
|
|
||||||
|
return s:GetDir(a:buffer)
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#python#vulture#GetCommand(buffer) abort
|
function! ale_linters#python#vulture#GetCommand(buffer) abort
|
||||||
let l:change_dir = ale#Var(a:buffer, 'python_vulture_change_directory')
|
|
||||||
\ ? ale#path#CdString(s:GetDir(a:buffer))
|
|
||||||
\ : ''
|
|
||||||
|
|
||||||
let l:executable = ale_linters#python#vulture#GetExecutable(a:buffer)
|
let l:executable = ale_linters#python#vulture#GetExecutable(a:buffer)
|
||||||
|
|
||||||
let l:exec_args = l:executable =~? 'pipenv$'
|
let l:exec_args = l:executable =~? 'pipenv$'
|
||||||
\ ? ' run vulture'
|
\ ? ' run vulture'
|
||||||
\ : ''
|
\ : ''
|
||||||
|
|
||||||
let l:lint_dest = ale#Var(a:buffer, 'python_vulture_change_directory')
|
let l:lint_dest = ale#Var(a:buffer, 'python_vulture_change_directory')
|
||||||
\ ? ' .'
|
\ ? ' .'
|
||||||
\ : ' %s'
|
\ : ' %s'
|
||||||
|
|
||||||
return l:change_dir
|
return ale#Escape(l:executable) . l:exec_args
|
||||||
\ . ale#Escape(l:executable) . l:exec_args
|
|
||||||
\ . ' '
|
\ . ' '
|
||||||
\ . ale#Var(a:buffer, 'python_vulture_options')
|
\ . ale#Var(a:buffer, 'python_vulture_options')
|
||||||
\ . l:lint_dest
|
\ . l:lint_dest
|
||||||
@ -74,6 +72,7 @@ endfunction
|
|||||||
call ale#linter#Define('python', {
|
call ale#linter#Define('python', {
|
||||||
\ 'name': 'vulture',
|
\ 'name': 'vulture',
|
||||||
\ 'executable': function('ale_linters#python#vulture#GetExecutable'),
|
\ 'executable': function('ale_linters#python#vulture#GetExecutable'),
|
||||||
|
\ 'cwd': function('ale_linters#python#vulture#GetCwd'),
|
||||||
\ 'command': function('ale_linters#python#vulture#GetCommand'),
|
\ 'command': function('ale_linters#python#vulture#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#python#vulture#Handle',
|
\ 'callback': 'ale_linters#python#vulture#Handle',
|
||||||
\ 'lint_file': 1,
|
\ 'lint_file': 1,
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
" Author: Michel Lang <michellang@gmail.com>, w0rp <devw0rp@gmail.com>,
|
" Author: Michel Lang <michellang@gmail.com>, w0rp <devw0rp@gmail.com>,
|
||||||
" Fenner Macrae <fmacrae.dev@gmail.com>
|
" Fenner Macrae <fmacrae.dev@gmail.com>,
|
||||||
|
" ourigen <https://github.com/ourigen>
|
||||||
" Description: This file adds support for checking R code with lintr.
|
" Description: This file adds support for checking R code with lintr.
|
||||||
|
|
||||||
let g:ale_r_lintr_options = get(g:, 'ale_r_lintr_options', 'with_defaults()')
|
let g:ale_r_lintr_options = get(g:, 'ale_r_lintr_options', 'with_defaults()')
|
||||||
@ -21,14 +22,13 @@ function! ale_linters#r#lintr#GetCommand(buffer) abort
|
|||||||
let l:cmd_string = 'suppressPackageStartupMessages(library(lintr));'
|
let l:cmd_string = 'suppressPackageStartupMessages(library(lintr));'
|
||||||
\ . l:lint_cmd
|
\ . l:lint_cmd
|
||||||
|
|
||||||
return ale#path#BufferCdString(a:buffer)
|
return 'Rscript --no-save --no-restore --no-site-file --no-init-file -e ' . ale#Escape(l:cmd_string) . ' %t'
|
||||||
\ . 'Rscript --vanilla -e '
|
|
||||||
\ . ale#Escape(l:cmd_string) . ' %t'
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('r', {
|
call ale#linter#Define('r', {
|
||||||
\ 'name': 'lintr',
|
\ 'name': 'lintr',
|
||||||
\ 'executable': 'Rscript',
|
\ 'executable': 'Rscript',
|
||||||
|
\ 'cwd': '%s:h',
|
||||||
\ 'command': function('ale_linters#r#lintr#GetCommand'),
|
\ 'command': function('ale_linters#r#lintr#GetCommand'),
|
||||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
||||||
\ 'output_stream': 'both',
|
\ 'output_stream': 'both',
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
" Author: John Nduli https://github.com/jnduli
|
" Author: John Nduli https://github.com/jnduli
|
||||||
" Description: Rstcheck for reStructuredText files
|
" Description: Rstcheck for reStructuredText files
|
||||||
"
|
|
||||||
|
|
||||||
function! ale_linters#rst#rstcheck#Handle(buffer, lines) abort
|
function! ale_linters#rst#rstcheck#Handle(buffer, lines) abort
|
||||||
" matches: 'bad_rst.rst:1: (SEVERE/4) Title overline & underline
|
" matches: 'bad_rst.rst:1: (SEVERE/4) Title overline & underline
|
||||||
@ -22,17 +21,11 @@ function! ale_linters#rst#rstcheck#Handle(buffer, lines) abort
|
|||||||
return l:output
|
return l:output
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#rst#rstcheck#GetCommand(buffer) abort
|
|
||||||
return ale#path#BufferCdString(a:buffer)
|
|
||||||
\ . 'rstcheck'
|
|
||||||
\ . ' %t'
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
|
|
||||||
call ale#linter#Define('rst', {
|
call ale#linter#Define('rst', {
|
||||||
\ 'name': 'rstcheck',
|
\ 'name': 'rstcheck',
|
||||||
\ 'executable': 'rstcheck',
|
\ 'executable': 'rstcheck',
|
||||||
\ 'command': function('ale_linters#rst#rstcheck#GetCommand'),
|
\ 'cwd': '%s:h',
|
||||||
|
\ 'command': 'rstcheck %t',
|
||||||
\ 'callback': 'ale_linters#rst#rstcheck#Handle',
|
\ 'callback': 'ale_linters#rst#rstcheck#Handle',
|
||||||
\ 'output_stream': 'both',
|
\ 'output_stream': 'both',
|
||||||
\})
|
\})
|
||||||
|
@ -1,14 +1,17 @@
|
|||||||
call ale#Set('ruby_sorbet_executable', 'srb')
|
call ale#Set('ruby_sorbet_executable', 'srb')
|
||||||
call ale#Set('ruby_sorbet_options', '')
|
call ale#Set('ruby_sorbet_options', '')
|
||||||
|
call ale#Set('ruby_sorbet_enable_watchman', 0)
|
||||||
|
|
||||||
function! ale_linters#ruby#sorbet#GetCommand(buffer) abort
|
function! ale_linters#ruby#sorbet#GetCommand(buffer) abort
|
||||||
let l:executable = ale#Var(a:buffer, 'ruby_sorbet_executable')
|
let l:executable = ale#Var(a:buffer, 'ruby_sorbet_executable')
|
||||||
let l:options = ale#Var(a:buffer, 'ruby_sorbet_options')
|
let l:options = ale#Var(a:buffer, 'ruby_sorbet_options')
|
||||||
|
let l:enable_watchman = ale#Var(a:buffer, 'ruby_sorbet_enable_watchman')
|
||||||
|
|
||||||
return ale#ruby#EscapeExecutable(l:executable, 'srb')
|
return ale#ruby#EscapeExecutable(l:executable, 'srb')
|
||||||
\ . ' tc'
|
\ . ' tc'
|
||||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||||
\ . ' --lsp --disable-watchman'
|
\ . ' --lsp'
|
||||||
|
\ . (l:enable_watchman ? '' : ' --disable-watchman')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('ruby', {
|
call ale#linter#Define('ruby', {
|
||||||
|
@ -17,7 +17,7 @@ endfunction
|
|||||||
call ale#linter#Define('rust', {
|
call ale#linter#Define('rust', {
|
||||||
\ 'name': 'analyzer',
|
\ 'name': 'analyzer',
|
||||||
\ 'lsp': 'stdio',
|
\ 'lsp': 'stdio',
|
||||||
\ 'lsp_config': {b -> ale#Var(b, 'rust_analyzer_config')},
|
\ 'initialization_options': {b -> ale#Var(b, 'rust_analyzer_config')},
|
||||||
\ 'executable': {b -> ale#Var(b, 'rust_analyzer_executable')},
|
\ 'executable': {b -> ale#Var(b, 'rust_analyzer_executable')},
|
||||||
\ 'command': function('ale_linters#rust#analyzer#GetCommand'),
|
\ 'command': function('ale_linters#rust#analyzer#GetCommand'),
|
||||||
\ 'project_root': function('ale_linters#rust#analyzer#GetProjectRoot'),
|
\ 'project_root': function('ale_linters#rust#analyzer#GetProjectRoot'),
|
||||||
|
@ -23,6 +23,19 @@ function! ale_linters#rust#cargo#GetCargoExecutable(bufnr) abort
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#rust#cargo#GetCwd(buffer) abort
|
||||||
|
if ale#Var(a:buffer, 'rust_cargo_avoid_whole_workspace')
|
||||||
|
let l:nearest_cargo = ale#path#FindNearestFile(a:buffer, 'Cargo.toml')
|
||||||
|
let l:nearest_cargo_dir = fnamemodify(l:nearest_cargo, ':h')
|
||||||
|
|
||||||
|
if l:nearest_cargo_dir isnot# '.'
|
||||||
|
return l:nearest_cargo_dir
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
return ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#rust#cargo#GetCommand(buffer, version) abort
|
function! ale_linters#rust#cargo#GetCommand(buffer, version) abort
|
||||||
let l:use_check = ale#Var(a:buffer, 'rust_cargo_use_check')
|
let l:use_check = ale#Var(a:buffer, 'rust_cargo_use_check')
|
||||||
\ && ale#semver#GTE(a:version, [0, 17, 0])
|
\ && ale#semver#GTE(a:version, [0, 17, 0])
|
||||||
@ -42,18 +55,6 @@ function! ale_linters#rust#cargo#GetCommand(buffer, version) abort
|
|||||||
let l:include_features = ' --features ' . ale#Escape(l:include_features)
|
let l:include_features = ' --features ' . ale#Escape(l:include_features)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let l:avoid_whole_workspace = ale#Var(a:buffer, 'rust_cargo_avoid_whole_workspace')
|
|
||||||
let l:nearest_cargo_prefix = ''
|
|
||||||
|
|
||||||
if l:avoid_whole_workspace
|
|
||||||
let l:nearest_cargo = ale#path#FindNearestFile(a:buffer, 'Cargo.toml')
|
|
||||||
let l:nearest_cargo_dir = fnamemodify(l:nearest_cargo, ':h')
|
|
||||||
|
|
||||||
if l:nearest_cargo_dir isnot# '.'
|
|
||||||
let l:nearest_cargo_prefix = 'cd '. ale#Escape(l:nearest_cargo_dir) .' && '
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
let l:default_feature_behavior = ale#Var(a:buffer, 'rust_cargo_default_feature_behavior')
|
let l:default_feature_behavior = ale#Var(a:buffer, 'rust_cargo_default_feature_behavior')
|
||||||
|
|
||||||
if l:default_feature_behavior is# 'all'
|
if l:default_feature_behavior is# 'all'
|
||||||
@ -81,7 +82,7 @@ function! ale_linters#rust#cargo#GetCommand(buffer, version) abort
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return l:nearest_cargo_prefix . 'cargo '
|
return 'cargo '
|
||||||
\ . l:subcommand
|
\ . l:subcommand
|
||||||
\ . (l:use_all_targets ? ' --all-targets' : '')
|
\ . (l:use_all_targets ? ' --all-targets' : '')
|
||||||
\ . (l:use_examples ? ' --examples' : '')
|
\ . (l:use_examples ? ' --examples' : '')
|
||||||
@ -96,6 +97,7 @@ endfunction
|
|||||||
call ale#linter#Define('rust', {
|
call ale#linter#Define('rust', {
|
||||||
\ 'name': 'cargo',
|
\ 'name': 'cargo',
|
||||||
\ 'executable': function('ale_linters#rust#cargo#GetCargoExecutable'),
|
\ 'executable': function('ale_linters#rust#cargo#GetCargoExecutable'),
|
||||||
|
\ 'cwd': function('ale_linters#rust#cargo#GetCwd'),
|
||||||
\ 'command': {buffer -> ale#semver#RunWithVersionCheck(
|
\ 'command': {buffer -> ale#semver#RunWithVersionCheck(
|
||||||
\ buffer,
|
\ buffer,
|
||||||
\ ale_linters#rust#cargo#GetCargoExecutable(buffer),
|
\ ale_linters#rust#cargo#GetCargoExecutable(buffer),
|
||||||
|
33
sources_non_forked/ale/ale_linters/salt/salt_lint.vim
Normal file
33
sources_non_forked/ale/ale_linters/salt/salt_lint.vim
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
" Author: Benjamin BINIER <poulpatine@gmail.com>
|
||||||
|
" Description: salt-lint, saltstack linter
|
||||||
|
|
||||||
|
call ale#Set('salt_salt_lint_executable', 'salt-lint')
|
||||||
|
call ale#Set('salt_salt_lint_options', '')
|
||||||
|
|
||||||
|
function! ale_linters#salt#salt_lint#GetCommand(buffer) abort
|
||||||
|
return '%e' . ale#Pad(ale#Var(a:buffer, 'salt_salt_lint_options'))
|
||||||
|
\ . ' --json'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#salt#salt_lint#Handle(buffer, lines) abort
|
||||||
|
let l:output = []
|
||||||
|
|
||||||
|
for l:error in ale#util#FuzzyJSONDecode(a:lines, [])
|
||||||
|
call add(l:output, {
|
||||||
|
\ 'lnum': l:error.linenumber + 0,
|
||||||
|
\ 'code': l:error.id + 0,
|
||||||
|
\ 'text': l:error.message,
|
||||||
|
\ 'type': l:error.severity is# 'HIGH' ? 'E' : 'W',
|
||||||
|
\})
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:output
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('salt', {
|
||||||
|
\ 'name': 'salt_lint',
|
||||||
|
\ 'aliases': ['salt-lint'],
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'salt_salt_lint_executable')},
|
||||||
|
\ 'command': function('ale_linters#salt#salt_lint#GetCommand'),
|
||||||
|
\ 'callback': 'ale_linters#salt#salt_lint#Handle'
|
||||||
|
\})
|
@ -5,7 +5,7 @@ call ale#Set('sass_sasslint_options', '')
|
|||||||
call ale#Set('sass_sasslint_use_global', get(g:, 'ale_use_global_executables', 0))
|
call ale#Set('sass_sasslint_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||||
|
|
||||||
function! ale_linters#sass#sasslint#GetExecutable(buffer) abort
|
function! ale_linters#sass#sasslint#GetExecutable(buffer) abort
|
||||||
return ale#node#FindExecutable(a:buffer, 'sass_sasslint', [
|
return ale#path#FindExecutable(a:buffer, 'sass_sasslint', [
|
||||||
\ 'node_modules/sass-lint/bin/sass-lint.js',
|
\ 'node_modules/sass-lint/bin/sass-lint.js',
|
||||||
\ 'node_modules/.bin/sass-lint',
|
\ 'node_modules/.bin/sass-lint',
|
||||||
\])
|
\])
|
||||||
|
@ -5,7 +5,7 @@ call ale#Set('sass_stylelint_use_global', get(g:, 'ale_use_global_executables',
|
|||||||
|
|
||||||
call ale#linter#Define('sass', {
|
call ale#linter#Define('sass', {
|
||||||
\ 'name': 'stylelint',
|
\ 'name': 'stylelint',
|
||||||
\ 'executable': {b -> ale#node#FindExecutable(b, 'sass_stylelint', [
|
\ 'executable': {b -> ale#path#FindExecutable(b, 'sass_stylelint', [
|
||||||
\ 'node_modules/.bin/stylelint',
|
\ 'node_modules/.bin/stylelint',
|
||||||
\ ])},
|
\ ])},
|
||||||
\ 'command': '%e --stdin-filename %s',
|
\ 'command': '%e --stdin-filename %s',
|
||||||
|
@ -5,7 +5,7 @@ call ale#Set('scss_sasslint_options', '')
|
|||||||
call ale#Set('scss_sasslint_use_global', get(g:, 'ale_use_global_executables', 0))
|
call ale#Set('scss_sasslint_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||||
|
|
||||||
function! ale_linters#scss#sasslint#GetExecutable(buffer) abort
|
function! ale_linters#scss#sasslint#GetExecutable(buffer) abort
|
||||||
return ale#node#FindExecutable(a:buffer, 'scss_sasslint', [
|
return ale#path#FindExecutable(a:buffer, 'scss_sasslint', [
|
||||||
\ 'node_modules/sass-lint/bin/sass-lint.js',
|
\ 'node_modules/sass-lint/bin/sass-lint.js',
|
||||||
\ 'node_modules/.bin/sass-lint',
|
\ 'node_modules/.bin/sass-lint',
|
||||||
\])
|
\])
|
||||||
|
@ -11,7 +11,7 @@ endfunction
|
|||||||
|
|
||||||
call ale#linter#Define('scss', {
|
call ale#linter#Define('scss', {
|
||||||
\ 'name': 'stylelint',
|
\ 'name': 'stylelint',
|
||||||
\ 'executable': {b -> ale#node#FindExecutable(b, 'scss_stylelint', [
|
\ 'executable': {b -> ale#path#FindExecutable(b, 'scss_stylelint', [
|
||||||
\ 'node_modules/.bin/stylelint',
|
\ 'node_modules/.bin/stylelint',
|
||||||
\ ])},
|
\ ])},
|
||||||
\ 'command': function('ale_linters#scss#stylelint#GetCommand'),
|
\ 'command': function('ale_linters#scss#stylelint#GetCommand'),
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user