Compare commits

..

2 Commits

Author SHA1 Message Date
Felix Maurer f0fa137721
Fix end line number when it exceeds the file (#4130)
If the end of the error exceeds the file, set it to the last line,
similarly as it is done with the beginning of the error.
2022-04-01 10:42:40 +01:00
yoshi1123 7e2342ab52
Fix :ALEImport column position
Fix :ALEImport column position so it works with more language servers.

Co-authored-by: w0rp <devw0rp@gmail.com>
2022-03-20 13:21:21 +00:00
170 changed files with 445 additions and 2744 deletions

View File

@ -40,9 +40,7 @@ Are you having trouble configuring ALE? Try asking for help on [Stack Exchange](
2. Then this happened. 2. Then this happened.
### :ALEInfo ### :ALEInfo
<details>
<summary>Expand</summary> <!-- Paste the output of :ALEInfo here. Try :ALEInfoToClipboard -->
<!-- Paste the output of :ALEInfo here. Try :ALEInfoToClipboard --> <!-- Make sure to run :ALEInfo from the buffer where the bug occurred. -->
<!-- Make sure to run :ALEInfo from the buffer where the bug occurred. --> <!-- Read the output. You might figure out what went wrong yourself. -->
<!-- Read the output. You might figure out what went wrong yourself. -->
</details>

View File

@ -29,7 +29,8 @@ jobs:
- '--vim-80-only' - '--vim-80-only'
- '--vim-82-only' - '--vim-82-only'
- '--neovim-02-only' - '--neovim-02-only'
- '--neovim-07-only' - '--neovim-04-only'
- '--neovim-05-only'
- '--linters-only' - '--linters-only'
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2

View File

@ -1,9 +1,10 @@
FROM testbed/vim:20 FROM testbed/vim:20
RUN install_vim -tag v8.0.0027 -build \ RUN install_vim -tag v8.0.0027 -build \
-tag v8.2.4693 -build \ -tag v8.2.2401 -build \
-tag neovim:v0.2.0 -build \ -tag neovim:v0.2.0 -build \
-tag neovim:v0.7.0 -build -tag neovim:v0.4.4 -build \
-tag neovim:v0.5.0 -build
ENV PACKAGES="\ ENV PACKAGES="\
bash \ bash \
@ -24,4 +25,4 @@ RUN git clone https://github.com/junegunn/vader.vim vader && \
ARG GIT_VERSION ARG GIT_VERSION
LABEL Version=${GIT_VERSION} LABEL Version=${GIT_VERSION}
LABEL Name=denseanalysis/ale LABEL Name=w0rp/ale

View File

@ -1,4 +1,4 @@
# Asynchronous Lint Engine [![GitHub Build Status](https://github.com/dense-analysis/ale/workflows/CI/badge.svg)](https://github.com/dense-analysis/ale/actions?query=event%3Apush+workflow%3ACI+branch%3Amaster++) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/r0ef1xu8xjmik58d/branch/master?svg=true)](https://ci.appveyor.com/project/dense-analysis/ale) [![Join the Dense Analysis Discord server](https://img.shields.io/badge/chat-Discord-5865F2)](https://discord.gg/5zFD6pQxDk) # Asynchronous Lint Engine [![GitHub Build Status](https://github.com/dense-analysis/ale/workflows/CI/badge.svg)](https://github.com/dense-analysis/ale/actions?query=event%3Apush+workflow%3ACI+branch%3Amaster++) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/r0ef1xu8xjmik58d/branch/master?svg=true)](https://ci.appveyor.com/project/dense-analysis/ale) [![Join the chat at https://gitter.im/vim-ale/Lobby](https://badges.gitter.im/vim-ale/Lobby.svg)](https://gitter.im/vim-ale/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
![ALE Logo by Mark Grealish - https://www.bhalash.com/](https://user-images.githubusercontent.com/3518142/59195920-2c339500-8b85-11e9-9c22-f6b7f69637b8.jpg) ![ALE Logo by Mark Grealish - https://www.bhalash.com/](https://user-images.githubusercontent.com/3518142/59195920-2c339500-8b85-11e9-9c22-f6b7f69637b8.jpg)
@ -359,7 +359,7 @@ See the Vundle documentation for more information.
<a name="installation-with-vim-plug"></a> <a name="installation-with-vim-plug"></a>
### 3.iv. Installation with Vim-Plug ### 3.iiii. Installation with Vim-Plug
You can install this plugin using [Vim-Plug](https://github.com/junegunn/vim-plug) You can install this plugin using [Vim-Plug](https://github.com/junegunn/vim-plug)
by adding the GitHub path for this repository to your `~/.vimrc`: by adding the GitHub path for this repository to your `~/.vimrc`:
@ -386,8 +386,8 @@ If you are interested in the general direction of the project, check out the
[wiki home page](https://github.com/dense-analysis/ale/wiki). The wiki includes [wiki home page](https://github.com/dense-analysis/ale/wiki). The wiki includes
a Roadmap for the future, and more. a Roadmap for the future, and more.
If you'd liked to discuss ALE and more check out the Dense Analysis Discord If you'd liked to discuss the project more directly, check out the `#vim-ale` channel
server here: https://discord.gg/5zFD6pQxDk on Libera Chat. Web chat is available [here](https://web.libera.chat/#vim-ale).
<a name="faq"></a> <a name="faq"></a>
@ -931,14 +931,14 @@ If the terminal supports Unicode, you might try setting the value like below, to
make it look nicer. make it look nicer.
```vim ```vim
let g:ale_floating_window_border = ['│', '─', '╭', '╮', '╯', '╰', '│', '─'] let g:ale_floating_window_border = ['│', '─', '╭', '╮', '╯', '╰']
``` ```
Since vim's default uses nice unicode characters when possible, you can trick Since vim's default uses nice unicode characters when possible, you can trick
ale into using that default with ale into using that default with
```vim ```vim
let g:ale_floating_window_border = repeat([''], 8) let g:ale_floating_window_border = repeat([''], 6)
``` ```
<a name="faq-vim-lsp"></a> <a name="faq-vim-lsp"></a>

View File

@ -18,30 +18,9 @@ function! ale_linters#ansible#ansible_lint#Handle(buffer, version, lines) abort
endif endif
endfor endfor
let l:version_group = ale#semver#GTE(a:version, [6, 0, 0]) ? '>=6.0.0' : let l:version_group = ale#semver#GTE(a:version, [5, 0, 0]) ? '>=5.0.0' : '<5.0.0'
\ ale#semver#GTE(a:version, [5, 0, 0]) ? '>=5.0.0' :
\ '<5.0.0'
let l:output = [] let l:output = []
if '>=6.0.0' is# l:version_group
let l:error_codes = { 'blocker': 'E', 'critical': 'E', 'major': 'W', 'minor': 'W', 'info': 'I' }
let l:linter_issues = json_decode(join(a:lines, ''))
for l:issue in l:linter_issues
if ale#path#IsBufferPath(a:buffer, l:issue.location.path)
call add(l:output, {
\ 'lnum': exists('l:issue.location.lines.begin.column') ? l:issue.location.lines.begin.line :
\ l:issue.location.lines.begin,
\ 'col': exists('l:issue.location.lines.begin.column') ? l:issue.location.lines.begin.column : 0,
\ 'text': l:issue.check_name,
\ 'detail': l:issue.description,
\ 'code': l:issue.severity,
\ 'type': l:error_codes[l:issue.severity],
\})
endif
endfor
endif
if '>=5.0.0' is# l:version_group if '>=5.0.0' is# l:version_group
" Matches patterns line the following: " Matches patterns line the following:
" test.yml:3:148: syntax-check 'var' is not a valid attribute for a Play " test.yml:3:148: syntax-check 'var' is not a valid attribute for a Play
@ -94,13 +73,10 @@ endfunction
function! ale_linters#ansible#ansible_lint#GetCommand(buffer, version) abort function! ale_linters#ansible#ansible_lint#GetCommand(buffer, version) abort
let l:commands = { let l:commands = {
\ '>=6.0.0': '%e --nocolor -f json -x yaml %s',
\ '>=5.0.0': '%e --nocolor --parseable-severity -x yaml %s', \ '>=5.0.0': '%e --nocolor --parseable-severity -x yaml %s',
\ '<5.0.0': '%e --nocolor -p %t' \ '<5.0.0': '%e --nocolor -p %t'
\} \}
let l:command = ale#semver#GTE(a:version, [6, 0]) ? l:commands['>=6.0.0'] : let l:command = ale#semver#GTE(a:version, [5, 0]) ? l:commands['>=5.0.0'] : l:commands['<5.0.0']
\ ale#semver#GTE(a:version, [5, 0]) ? l:commands['>=5.0.0'] :
\ l:commands['<5.0.0']
return l:command return l:command
endfunction endfunction

View File

@ -9,9 +9,8 @@ function! ale_linters#awk#gawk#GetCommand(buffer) abort
" gawk from attempting to execute the body of the script " gawk from attempting to execute the body of the script
" it is linting. " it is linting.
return '%e --source ' . ale#Escape('BEGIN { exit } END { exit 1 }') return '%e --source ' . ale#Escape('BEGIN { exit } END { exit 1 }')
\ . ' --lint'
\ . ale#Pad(ale#Var(a:buffer, 'awk_gawk_options')) \ . ale#Pad(ale#Var(a:buffer, 'awk_gawk_options'))
\ . ' -f %t /dev/null' \ . ' -f %t --lint /dev/null'
endfunction endfunction
call ale#linter#Define('awk', { call ale#linter#Define('awk', {

View File

@ -1,37 +0,0 @@
" Author: 0xHyoga <0xHyoga@gmx.com>
" Description: Report starknet-compile errors in cairo code
call ale#Set('cairo_starknet_executable', 'starknet-compile')
call ale#Set('cairo_starknet_options', '')
function! ale_linters#cairo#starknet#Handle(buffer, lines) abort
" Error always on the first line
" e.g ex01.cairo:20:6: Could not find module 'contracts.utils.ex00_base'. Searched in the following paths:
let l:pattern = '\v\.cairo:(\d+):(\d+):+ (.*)'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'lnum': str2nr(l:match[1]),
\ 'col': str2nr(l:match[2]),
\ 'type': 'E',
\ 'text': l:match[3],
\})
endfor
return l:output
endfunction
function! ale_linters#cairo#starknet#GetCommand(buffer) abort
let l:executable = ale#Var(a:buffer, 'cairo_starknet_executable')
return l:executable . ale#Pad(ale#Var(a:buffer, 'cairo_starknet_options')) . ' %s'
endfunction
call ale#linter#Define('cairo', {
\ 'name': 'starknet',
\ 'executable': {b -> ale#Var(b, 'cairo_starknet_executable')},
\ 'command': function('ale_linters#cairo#starknet#GetCommand'),
\ 'callback': 'ale_linters#cairo#starknet#Handle',
\ 'output_stream': 'stderr',
\})

View File

@ -1,16 +0,0 @@
" Author: Dalius Dobravolskas <dalius.dobravolskas@gmail.com>
" Description: VSCode css language server
function! ale_linters#css#vscodecss#GetProjectRoot(buffer) abort
let l:git_path = ale#path#FindNearestDirectory(a:buffer, '.git')
return !empty(l:git_path) ? fnamemodify(l:git_path, ':h:h') : ''
endfunction
call ale#linter#Define('css', {
\ 'name': 'vscodecss',
\ 'lsp': 'stdio',
\ 'executable': 'vscode-css-language-server',
\ 'command': '%e --stdio',
\ 'project_root': function('ale_linters#css#vscodecss#GetProjectRoot'),
\})

View File

@ -4,16 +4,15 @@
call ale#Set('dart_analyze_executable', 'dart') call ale#Set('dart_analyze_executable', 'dart')
function! ale_linters#dart#dart_analyze#Handle(buffer, lines) abort function! ale_linters#dart#dart_analyze#Handle(buffer, lines) abort
let l:pattern = '\v([a-z]+) - (.+):(\d+):(\d+) - (.+) - (.+)$' let l:pattern = '\v^ ([a-z]+) - (.+):(\d+):(\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)
let [l:type, l:filename, l:lnum, l:col, l:message, l:code] = l:match[1:6]
call add(l:output, { call add(l:output, {
\ 'type': l:type is# 'error' ? 'E' : l:type is# 'info' ? 'I' : 'W', \ 'type': l:match[1] is# 'error' ? 'E' : 'W',
\ 'text': l:code . ': ' . l:message, \ 'text': l:match[6] . ': ' . l:match[5],
\ 'lnum': str2nr(l:lnum), \ 'lnum': str2nr(l:match[3]),
\ 'col': str2nr(l:col), \ 'col': str2nr(l:match[4]),
\}) \})
endfor endfor
@ -23,7 +22,7 @@ endfunction
call ale#linter#Define('dart', { call ale#linter#Define('dart', {
\ 'name': 'dart_analyze', \ 'name': 'dart_analyze',
\ 'executable': {b -> ale#Var(b, 'dart_analyze_executable')}, \ 'executable': {b -> ale#Var(b, 'dart_analyze_executable')},
\ 'command': '%e analyze --fatal-infos %s', \ 'command': '%e analyze %s',
\ 'callback': 'ale_linters#dart#dart_analyze#Handle', \ 'callback': 'ale_linters#dart#dart_analyze#Handle',
\ 'lint_file': 1, \ 'lint_file': 1,
\}) \})

View File

@ -24,7 +24,7 @@ function! ale_linters#go#golangci_lint#GetCommand(buffer) abort
endfunction endfunction
function! ale_linters#go#golangci_lint#GetMatches(lines) abort function! ale_linters#go#golangci_lint#GetMatches(lines) abort
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):?(\d+)?:?:?:?\s\*?(.+)\s+\((.+)\)$' let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):?(\d+)?:?:?:?\s\*?(.+)$'
return ale#util#GetMatches(a:lines, l:pattern) return ale#util#GetMatches(a:lines, l:pattern)
endfunction endfunction
@ -34,20 +34,14 @@ function! ale_linters#go#golangci_lint#Handler(buffer, lines) abort
let l:output = [] let l:output = []
for l:match in ale_linters#go#golangci_lint#GetMatches(a:lines) for l:match in ale_linters#go#golangci_lint#GetMatches(a:lines)
if l:match[5] is# 'typecheck'
let l:msg_type = 'E'
else
let l:msg_type = 'W'
endif
" l:match[1] will already be an absolute path, output from " l:match[1] will already be an absolute path, output from
" golangci_lint " golangci_lint
call add(l:output, { call add(l:output, {
\ 'filename': ale#path#GetAbsPath(l:dir, l:match[1]), \ 'filename': ale#path#GetAbsPath(l:dir, l:match[1]),
\ 'lnum': l:match[2] + 0, \ 'lnum': l:match[2] + 0,
\ 'col': l:match[3] + 0, \ 'col': l:match[3] + 0,
\ 'type': l:msg_type, \ 'type': 'E',
\ 'text': l:match[4] . ' (' . l:match[5] . ')', \ 'text': l:match[4],
\}) \})
endfor endfor

View File

@ -11,17 +11,10 @@ function! ale_linters#handlebars#embertemplatelint#GetExecutable(buffer) abort
endfunction endfunction
function! ale_linters#handlebars#embertemplatelint#GetCommand(buffer, version) abort function! ale_linters#handlebars#embertemplatelint#GetCommand(buffer, version) abort
if ale#semver#GTE(a:version, [4, 0, 0]) " Reading from stdin was introduced in ember-template-lint@1.6.0
" --json was removed in favor of --format=json in ember-template-lint@4.0.0 return ale#semver#GTE(a:version, [1, 6, 0])
return '%e --format=json --filename %s' \ ? '%e --json --filename %s'
endif \ : '%e --json %t'
if ale#semver#GTE(a:version, [1, 6, 0])
" Reading from stdin was introduced in ember-template-lint@1.6.0
return '%e --json --filename %s'
endif
return '%e --json %t'
endfunction endfunction
function! ale_linters#handlebars#embertemplatelint#GetCommandWithVersionCheck(buffer) abort function! ale_linters#handlebars#embertemplatelint#GetCommandWithVersionCheck(buffer) abort

View File

@ -1,16 +0,0 @@
" Author: Dalius Dobravolskas <dalius.dobravolskas@gmail.com>
" Description: VSCode html language server
function! ale_linters#html#vscodehtml#GetProjectRoot(buffer) abort
let l:git_path = ale#path#FindNearestDirectory(a:buffer, '.git')
return !empty(l:git_path) ? fnamemodify(l:git_path, ':h:h') : ''
endfunction
call ale#linter#Define('html', {
\ 'name': 'vscodehtml',
\ 'lsp': 'stdio',
\ 'executable': 'vscode-html-language-server',
\ 'command': '%e --stdio',
\ 'project_root': function('ale_linters#html#vscodehtml#GetProjectRoot'),
\})

View File

@ -1,16 +0,0 @@
" Author: Dalius Dobravolskas <dalius.dobravolskas@gmail.com>
" Description: VSCode json language server
function! ale_linters#json#vscodejson#GetProjectRoot(buffer) abort
let l:git_path = ale#path#FindNearestDirectory(a:buffer, '.git')
return !empty(l:git_path) ? fnamemodify(l:git_path, ':h:h') : ''
endfunction
call ale#linter#Define('json', {
\ 'name': 'vscodejson',
\ 'lsp': 'stdio',
\ 'executable': 'vscode-json-language-server',
\ 'command': '%e --stdio',
\ 'project_root': function('ale_linters#json#vscodejson#GetProjectRoot'),
\})

View File

@ -1,46 +0,0 @@
call ale#Set('lua_selene_executable', 'selene')
call ale#Set('lua_selene_options', '')
function! ale_linters#lua#selene#GetCommand(buffer) abort
return '%e' . ale#Pad(ale#Var(a:buffer, 'lua_selene_options'))
\ . ' --display-style=json -'
endfunction
function! ale_linters#lua#selene#Handle(buffer, lines) abort
let l:output = []
for l:line in a:lines
" as of version 0.17.0, selene has no way to suppress summary
" information when outputting json, so stop processing when we hit it
" (PR for this here: https://github.com/Kampfkarren/selene/pull/356)
if l:line is# 'Results:'
break
endif
let l:json = json_decode(l:line)
let l:lint = {
\ 'lnum': l:json.primary_label.span.start_line + 1,
\ 'end_lnum': l:json.primary_label.span.end_line + 1,
\ 'col': l:json.primary_label.span.start_column + 1,
\ 'end_col': l:json.primary_label.span.end_column,
\ 'text': l:json.message,
\ 'code': l:json.code,
\ 'type': l:json.severity is# 'Warning' ? 'W' : 'E',
\}
if has_key(l:json, 'notes') && len(l:json.notes) > 0
let l:lint.detail = l:lint.text . "\n\n" . join(l:json.notes, "\n")
endif
call add(l:output, l:lint)
endfor
return l:output
endfunction
call ale#linter#Define('lua', {
\ 'name': 'selene',
\ 'executable': {b -> ale#Var(b, 'lua_selene_executable')},
\ 'command': function('ale_linters#lua#selene#GetCommand'),
\ 'callback': 'ale_linters#lua#selene#Handle',
\})

View File

@ -1,24 +0,0 @@
" Description: SCA2D linter for OpenSCAD files
call ale#Set('openscad_sca2d_executable', 'sca2d')
call ale#Set('openscad_sca2d_options', '')
function! ale_linters#openscad#sca2d#GetExecutable(buffer) abort
return ale#Var(a:buffer, 'openscad_sca2d_executable')
endfunction
function! ale_linters#openscad#sca2d#GetCommand(buffer) abort
let l:executable = ale_linters#openscad#sca2d#GetExecutable(a:buffer)
let l:options = ale#Var(a:buffer, 'openscad_sca2d_options')
return ale#Escape(l:executable) . ale#Pad(l:options) . ' %s'
endfunction
call ale#linter#Define('openscad', {
\ 'name': 'SCA2D',
\ 'aliases': ['sca2d'],
\ 'executable': function('ale_linters#openscad#sca2d#GetExecutable'),
\ 'command': function('ale_linters#openscad#sca2d#GetCommand'),
\ 'callback': 'ale#handlers#openscad#SCA2D_callback',
\ 'lint_file': 1,
\ })

View File

@ -1,23 +0,0 @@
" Author: Alex McKinney <alexmckinney01@gmail.com>
" Description: Run buf lint.
call ale#Set('proto_buf_lint_executable', 'buf')
call ale#Set('proto_buf_lint_config', '')
function! ale_linters#proto#buf_lint#GetCommand(buffer) abort
let l:config = ale#Var(a:buffer, 'proto_buf_lint_config')
return '%e lint'
\ . (!empty(l:config) ? ' --config=' . ale#Escape(l:config) : '')
\ . ' %s#include_package_files=true'
endfunction
call ale#linter#Define('proto', {
\ 'name': 'buf_lint',
\ 'aliases': ['buf-lint'],
\ 'lint_file': 1,
\ 'output_stream': 'stdout',
\ 'executable': {b -> ale#Var(b, 'proto_buf_lint_executable')},
\ 'command': function('ale_linters#proto#buf_lint#GetCommand'),
\ 'callback': 'ale#handlers#unix#HandleAsError',
\})

View File

@ -22,22 +22,6 @@ 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#RunWithVersionCheck(buffer) abort
let l:executable = ale_linters#python#pylama#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry$'
\ ? ' run pylama'
\ : ''
let l:command = ale#Escape(l:executable) . l:exec_args . ' --version'
return ale#semver#RunWithVersionCheck(
\ a:buffer,
\ l:executable,
\ l:command,
\ function('ale_linters#python#pylama#GetCommand'),
\)
endfunction
function! ale_linters#python#pylama#GetCwd(buffer) abort function! ale_linters#python#pylama#GetCwd(buffer) abort
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
@ -51,33 +35,27 @@ function! ale_linters#python#pylama#GetCwd(buffer) abort
return '' return ''
endfunction endfunction
function! ale_linters#python#pylama#GetCommand(buffer, version) abort 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\|poetry$' let l:exec_args = l:executable =~? 'pipenv\|poetry$'
\ ? ' run pylama' \ ? ' run pylama'
\ : '' \ : ''
" json format is added in version 8.1.4
" https://github.com/klen/pylama/blob/develop/Changelog
let l:format_json_args = ale#semver#GTE(a:version, [8, 1, 4])
\ ? ' --format json'
\ : ''
" 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 ale#Escape(l:executable) . l:exec_args return 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'))
\ . l:format_json_args
\ . ' %s' \ . ' %s'
endfunction endfunction
function! ale_linters#python#pylama#Handle(buffer, version, lines) abort function! ale_linters#python#pylama#Handle(buffer, lines) abort
if empty(a:lines) if empty(a:lines)
return [] return []
endif endif
let l:output = ale#python#HandleTraceback(a:lines, 1) let l:output = ale#python#HandleTraceback(a:lines, 1)
let l:pattern = '\v^.{-}:([0-9]+):([0-9]+): +%(([A-Z][0-9]+):? +)?(.*)$'
" First letter of error code is a pylint-compatible message type " First letter of error code is a pylint-compatible message type
" http://pylint.pycqa.org/en/latest/user_guide/output.html#source-code-analysis-section " http://pylint.pycqa.org/en/latest/user_guide/output.html#source-code-analysis-section
@ -97,41 +75,16 @@ function! ale_linters#python#pylama#Handle(buffer, version, lines) abort
\ 'D': 'style', \ 'D': 'style',
\} \}
if ale#semver#GTE(a:version, [8, 1, 4]) for l:match in ale#util#GetMatches(a:lines, l:pattern)
try call add(l:output, {
let l:errors = json_decode(join(a:lines, '')) \ 'lnum': str2nr(l:match[1]),
catch \ 'col': str2nr(l:match[2]),
return l:output \ 'code': l:match[3],
endtry \ 'type': get(l:pylint_type_to_ale_type, l:match[3][0], 'W'),
\ 'sub_type': get(l:pylint_type_to_ale_sub_type, l:match[3][0], ''),
if empty(l:errors) \ 'text': l:match[4],
return l:output \})
endif endfor
for l:error in l:errors
call add(l:output, {
\ 'lnum': l:error['lnum'],
\ 'col': l:error['col'],
\ 'code': l:error['number'],
\ 'type': get(l:pylint_type_to_ale_type, l:error['etype'], 'W'),
\ 'sub_type': get(l:pylint_type_to_ale_sub_type, l:error['etype'], ''),
\ 'text': printf('%s [%s]', l:error['message'], l:error['source']),
\})
endfor
else
let l:pattern = '\v^.{-}:([0-9]+):([0-9]+): +%(([A-Z][0-9]+):? +)?(.*)$'
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'lnum': str2nr(l:match[1]),
\ 'col': str2nr(l:match[2]),
\ 'code': l:match[3],
\ 'type': get(l:pylint_type_to_ale_type, l:match[3][0], 'W'),
\ 'sub_type': get(l:pylint_type_to_ale_sub_type, l:match[3][0], ''),
\ 'text': l:match[4],
\})
endfor
endif
return l:output return l:output
endfunction endfunction
@ -140,15 +93,7 @@ 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'), \ 'cwd': function('ale_linters#python#pylama#GetCwd'),
\ 'command': function('ale_linters#python#pylama#RunWithVersionCheck'), \ 'command': function('ale_linters#python#pylama#GetCommand'),
\ 'callback': {buffer, lines -> ale#semver#RunWithVersionCheck( \ 'callback': 'ale_linters#python#pylama#Handle',
\ buffer,
\ ale_linters#python#pylama#GetExecutable(buffer),
\ '%e --version',
\ {buffer, version -> ale_linters#python#pylama#Handle(
\ buffer,
\ l:version,
\ lines)},
\ )},
\ 'lint_file': 1, \ 'lint_file': 1,
\}) \})

View File

@ -1,4 +0,0 @@
scriptencoding utf-8
" Description: cspell support for rego files.
call ale#handlers#cspell#DefineLinter('rego')

View File

@ -1,56 +0,0 @@
" Description: opa check for rego files
call ale#Set('rego_opacheck_executable', 'opa')
call ale#Set('rego_opacheck_options', '')
function! ale_linters#rego#opacheck#GetExecutable(buffer) abort
return ale#Var(a:buffer, 'rego_opacheck_executable')
endfunction
function! ale_linters#rego#opacheck#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'rego_opacheck_options')
return ale#Escape(ale_linters#rego#opacheck#GetExecutable(a:buffer))
\ . ' check %s --format json '
\ . (!empty(l:options) ? ' ' . l:options : '')
endfunction
function! ale_linters#rego#opacheck#Handle(buffer, lines) abort
let l:output = []
let l:errors = ale#util#FuzzyJSONDecode(a:lines, {'errors': []})
let l:dir = expand('#' . a:buffer . ':p:h')
let l:file = expand('#' . a:buffer . ':p')
for l:error in l:errors['errors']
if has_key(l:error, 'location')
call add(l:output, {
\ 'filename': ale#path#GetAbsPath(l:dir, l:error['location']['file']),
\ 'lnum': l:error['location']['row'],
\ 'col': l:error['location']['col'],
\ 'text': l:error['message'],
\ 'code': l:error['code'],
\ 'type': 'E',
\})
else
call add(l:output, {
\ 'filename': l:file,
\ 'lnum': 0,
\ 'col': 0,
\ 'text': l:error['message'],
\ 'code': l:error['code'],
\ 'type': 'E',
\})
endif
endfor
return l:output
endfunction
call ale#linter#Define('rego', {
\ 'name': 'opacheck',
\ 'output_stream': 'both',
\ 'executable': function('ale_linters#rego#opacheck#GetExecutable'),
\ 'command': function('ale_linters#rego#opacheck#GetCommand'),
\ 'callback': 'ale_linters#rego#opacheck#Handle',
\})

View File

@ -9,21 +9,9 @@ function! ale_linters#rust#analyzer#GetCommand(buffer) abort
endfunction endfunction
function! ale_linters#rust#analyzer#GetProjectRoot(buffer) abort function! ale_linters#rust#analyzer#GetProjectRoot(buffer) abort
" Try to find nearest Cargo.toml for cargo projects
let l:cargo_file = ale#path#FindNearestFile(a:buffer, 'Cargo.toml') let l:cargo_file = ale#path#FindNearestFile(a:buffer, 'Cargo.toml')
if !empty(l:cargo_file) return !empty(l:cargo_file) ? fnamemodify(l:cargo_file, ':h') : ''
return fnamemodify(l:cargo_file, ':h')
endif
" Try to find nearest rust-project.json for non-cargo projects
let l:rust_project = ale#path#FindNearestFile(a:buffer, 'rust-project.json')
if !empty(l:rust_project)
return fnamemodify(l:rust_project, ':h')
endif
return ''
endfunction endfunction
call ale#linter#Define('rust', { call ale#linter#Define('rust', {

View File

@ -21,13 +21,7 @@ function! ale_linters#terraform#terraform#GetType(severity) abort
endfunction endfunction
function! ale_linters#terraform#terraform#GetDetail(error) abort function! ale_linters#terraform#terraform#GetDetail(error) abort
let l:detail = get(a:error, 'detail', '') return get(a:error, 'detail', get(a:error, 'summary', ''))
if strlen(l:detail) > 0
return l:detail
else
return get(a:error, 'summary', '')
endif
endfunction endfunction
function! ale_linters#terraform#terraform#Handle(buffer, lines) abort function! ale_linters#terraform#terraform#Handle(buffer, lines) abort

View File

@ -1,11 +0,0 @@
" Author: bretello <bretello@distruzione.org>
call ale#Set('yaml_actionlint_executable', 'actionlint')
call ale#Set('yaml_actionlint_options', '')
call ale#linter#Define('yaml', {
\ 'name': 'actionlint',
\ 'executable': {b -> ale#Var(b, 'yaml_actionlint_executable')},
\ 'command': function('ale#handlers#actionlint#GetCommand'),
\ 'callback': 'ale#handlers#actionlint#Handle',
\})

View File

@ -457,7 +457,7 @@ function! s:ExecuteGetCodeFix(linter, range, MenuCallback) abort
let [l:end_line, l:end_column] = getpos("'>")[1:2] let [l:end_line, l:end_column] = getpos("'>")[1:2]
endif endif
let l:column = max([min([l:column, len(getline(l:line))]), 1]) let l:column = min([l:column, len(getline(l:line))])
let l:end_column = min([l:end_column, len(getline(l:end_line))]) let l:end_column = min([l:end_column, len(getline(l:end_line))])
let l:Callback = function( let l:Callback = function(

View File

@ -133,13 +133,11 @@ let s:should_complete_map = {
\ 'typescript': '\v[a-zA-Z$_][a-zA-Z$_0-9]*$|\.$|''$|"$', \ 'typescript': '\v[a-zA-Z$_][a-zA-Z$_0-9]*$|\.$|''$|"$',
\ 'rust': '\v[a-zA-Z$_][a-zA-Z$_0-9]*$|\.$|::$', \ 'rust': '\v[a-zA-Z$_][a-zA-Z$_0-9]*$|\.$|::$',
\ 'cpp': '\v[a-zA-Z$_][a-zA-Z$_0-9]*$|\.$|::$|-\>$', \ 'cpp': '\v[a-zA-Z$_][a-zA-Z$_0-9]*$|\.$|::$|-\>$',
\ 'c': '\v[a-zA-Z$_][a-zA-Z$_0-9]*$|\.$|-\>$',
\} \}
" Regular expressions for finding the start column to replace with completion. " Regular expressions for finding the start column to replace with completion.
let s:omni_start_map = { let s:omni_start_map = {
\ '<default>': '\v[a-zA-Z$_][a-zA-Z$_0-9]*$', \ '<default>': '\v[a-zA-Z$_][a-zA-Z$_0-9]*$',
\ 'racket': '\k\+',
\} \}
" A map of exact characters for triggering LSP completions. Do not forget to " A map of exact characters for triggering LSP completions. Do not forget to
@ -149,7 +147,6 @@ let s:trigger_character_map = {
\ 'typescript': ['.', '''', '"'], \ 'typescript': ['.', '''', '"'],
\ 'rust': ['.', '::'], \ 'rust': ['.', '::'],
\ 'cpp': ['.', '::', '->'], \ 'cpp': ['.', '::', '->'],
\ 'c': ['.', '->'],
\} \}
function! s:GetFiletypeValue(map, filetype) abort function! s:GetFiletypeValue(map, filetype) abort
@ -584,7 +581,7 @@ function! ale#completion#ParseLSPCompletions(response) abort
continue continue
endif endif
if get(l:item, 'insertTextFormat', s:LSP_INSERT_TEXT_FORMAT_PLAIN) is s:LSP_INSERT_TEXT_FORMAT_PLAIN if get(l:item, 'insertTextFormat') is s:LSP_INSERT_TEXT_FORMAT_PLAIN
\&& type(get(l:item, 'textEdit')) is v:t_dict \&& type(get(l:item, 'textEdit')) is v:t_dict
let l:text = l:item.textEdit.newText let l:text = l:item.textEdit.newText
elseif type(get(l:item, 'insertText')) is v:t_string elseif type(get(l:item, 'insertText')) is v:t_string
@ -779,8 +776,7 @@ function! s:OnReady(linter, lsp_details) abort
if a:linter.lsp is# 'tsserver' if a:linter.lsp is# 'tsserver'
if get(g:, 'ale_completion_tsserver_autoimport') is 1 if get(g:, 'ale_completion_tsserver_autoimport') is 1
" no-custom-checks execute 'echom `g:ale_completion_tsserver_autoimport` is deprecated. Use `g:ale_completion_autoimport` instead.'''
echom '`g:ale_completion_tsserver_autoimport` is deprecated. Use `g:ale_completion_autoimport` instead.'
endif endif
let l:message = ale#lsp#tsserver_message#Completions( let l:message = ale#lsp#tsserver_message#Completions(

View File

@ -10,21 +10,12 @@ let g:ale_echo_msg_format = get(g:, 'ale_echo_msg_format', '%code: %%s')
let s:cursor_timer = -1 let s:cursor_timer = -1
" A wrapper for echon so we can test messages we echo in Vader tests.
function! ale#cursor#Echom(message) abort
" no-custom-checks
exec "norm! :echom a:message\n"
endfunction
function! ale#cursor#TruncatedEcho(original_message) abort function! ale#cursor#TruncatedEcho(original_message) abort
let l:message = a:original_message let l:message = a:original_message
" Change tabs to spaces. " Change tabs to spaces.
let l:message = substitute(l:message, "\t", ' ', 'g') let l:message = substitute(l:message, "\t", ' ', 'g')
" Remove any newlines in the message. " Remove any newlines in the message.
let l:message = substitute(l:message, "\n", '', 'g') let l:message = substitute(l:message, "\n", '', 'g')
" Convert indentation groups into single spaces for better legibility when
" put on a single line
let l:message = substitute(l:message, ' \+', ' ', 'g')
" We need to remember the setting for shortmess and reset it again. " We need to remember the setting for shortmess and reset it again.
let l:shortmess_options = &l:shortmess let l:shortmess_options = &l:shortmess
@ -36,7 +27,7 @@ function! ale#cursor#TruncatedEcho(original_message) abort
silent! setlocal shortmess+=T silent! setlocal shortmess+=T
try try
call ale#cursor#Echom(l:message) exec "norm! :echomsg l:message\n"
catch /^Vim\%((\a\+)\)\=:E523/ catch /^Vim\%((\a\+)\)\=:E523/
" Fallback into manual truncate (#1987) " Fallback into manual truncate (#1987)
let l:winwidth = winwidth(0) let l:winwidth = winwidth(0)
@ -96,9 +87,7 @@ function! ale#cursor#EchoCursorWarning(...) abort
elseif get(l:info, 'echoed') elseif get(l:info, 'echoed')
" We'll only clear the echoed message when moving off errors once, " We'll only clear the echoed message when moving off errors once,
" so we don't continually clear the echo line. " so we don't continually clear the echo line.
" execute 'echo'
" no-custom-checks
echo
let l:info.echoed = 0 let l:info.echoed = 0
endif endif
endif endif
@ -161,8 +150,7 @@ function! s:ShowCursorDetailForItem(loc, options) abort
" Clear the echo message if we manually displayed details. " Clear the echo message if we manually displayed details.
if !l:stay_here if !l:stay_here
" no-custom-checks execute 'echo'
echo
endif endif
endif endif
endfunction endfunction

View File

@ -62,8 +62,7 @@ let s:global_variable_list = [
\] \]
function! s:Echo(message) abort function! s:Echo(message) abort
" no-custom-checks execute 'echo a:message'
echo a:message
endfunction endfunction
function! s:GetLinterVariables(filetype, exclude_linter_names) abort function! s:GetLinterVariables(filetype, exclude_linter_names) abort

View File

@ -121,12 +121,6 @@ function! s:OnReady(line, column, options, capability, linter, lsp_details) abor
\ a:line, \ a:line,
\ a:column \ a:column
\) \)
elseif a:capability is# 'implementation'
let l:message = ale#lsp#tsserver_message#Implementation(
\ l:buffer,
\ a:line,
\ a:column
\)
endif endif
else else
" Send a message saying the buffer has changed first, or the " Send a message saying the buffer has changed first, or the
@ -140,8 +134,6 @@ function! s:OnReady(line, column, options, capability, linter, lsp_details) abor
let l:message = ale#lsp#message#Definition(l:buffer, a:line, a:column) let l:message = ale#lsp#message#Definition(l:buffer, a:line, a:column)
elseif a:capability is# 'typeDefinition' elseif a:capability is# 'typeDefinition'
let l:message = ale#lsp#message#TypeDefinition(l:buffer, a:line, a:column) let l:message = ale#lsp#message#TypeDefinition(l:buffer, a:line, a:column)
elseif a:capability is# 'implementation'
let l:message = ale#lsp#message#Implementation(l:buffer, a:line, a:column)
else else
" XXX: log here? " XXX: log here?
return return
@ -183,14 +175,6 @@ function! ale#definition#GoToType(options) abort
endfor endfor
endfunction endfunction
function! ale#definition#GoToImpl(options) abort
for l:linter in ale#linter#Get(&filetype)
if !empty(l:linter.lsp)
call s:GoToLSPDefinition(l:linter, a:options, 'implementation')
endif
endfor
endfunction
function! ale#definition#GoToCommandHandler(command, ...) abort function! ale#definition#GoToCommandHandler(command, ...) abort
let l:options = {} let l:options = {}
@ -216,8 +200,6 @@ function! ale#definition#GoToCommandHandler(command, ...) abort
if a:command is# 'type' if a:command is# 'type'
call ale#definition#GoToType(l:options) call ale#definition#GoToType(l:options)
elseif a:command is# 'implementation'
call ale#definition#GoToImpl(l:options)
else else
call ale#definition#GoTo(l:options) call ale#definition#GoTo(l:options)
endif endif

View File

@ -77,8 +77,7 @@ function! ale#fix#ApplyFixes(buffer, output) abort
call remove(g:ale_fix_buffer_data, a:buffer) call remove(g:ale_fix_buffer_data, a:buffer)
if !l:data.ignore_file_changed_errors if !l:data.ignore_file_changed_errors
" no-custom-checks execute 'echoerr ''The file was changed before fixing finished'''
echoerr 'The file was changed before fixing finished'
endif endif
return return
@ -359,8 +358,7 @@ function! ale#fix#Fix(buffer, fixing_flag, ...) abort
\ 'There is no fixer named `%s`. Check :ALEFixSuggest', \ 'There is no fixer named `%s`. Check :ALEFixSuggest',
\ l:function_name, \ l:function_name,
\) \)
" no-custom-checks execute 'echom l:echo_message'
echom l:echo_message
endif endif
return 0 return 0
@ -368,8 +366,7 @@ function! ale#fix#Fix(buffer, fixing_flag, ...) abort
if empty(l:callback_list) if empty(l:callback_list)
if a:fixing_flag is# '' if a:fixing_flag is# ''
" no-custom-checks execute 'echom ''No fixers have been defined. Try :ALEFixSuggest'''
echom 'No fixers have been defined. Try :ALEFixSuggest'
endif endif
return 0 return 0

View File

@ -37,11 +37,6 @@ let s:default_registry = {
\ 'suggested_filetypes': ['python'], \ 'suggested_filetypes': ['python'],
\ 'description': 'Fix PEP8 issues with black.', \ 'description': 'Fix PEP8 issues with black.',
\ }, \ },
\ 'buf-format': {
\ 'function': 'ale#fixers#buf_format#Fix',
\ 'suggested_filetypes': ['proto'],
\ 'description': 'Fix .proto files with buf format.',
\ },
\ 'buildifier': { \ 'buildifier': {
\ 'function': 'ale#fixers#buildifier#Fix', \ 'function': 'ale#fixers#buildifier#Fix',
\ 'suggested_filetypes': ['bzl'], \ 'suggested_filetypes': ['bzl'],
@ -78,11 +73,6 @@ let s:default_registry = {
\ 'suggested_filetypes': ['dhall'], \ 'suggested_filetypes': ['dhall'],
\ 'description': 'Standard code formatter for the Dhall language and removing dead code', \ 'description': 'Standard code formatter for the Dhall language and removing dead code',
\ }, \ },
\ 'dune': {
\ 'function': 'ale#fixers#dune#Fix',
\ 'suggested_filetypes': ['dune'],
\ 'description': 'Fix dune files with dune format',
\ },
\ 'fecs': { \ 'fecs': {
\ 'function': 'ale#fixers#fecs#Fix', \ 'function': 'ale#fixers#fecs#Fix',
\ 'suggested_filetypes': ['javascript', 'css', 'html'], \ 'suggested_filetypes': ['javascript', 'css', 'html'],
@ -141,11 +131,6 @@ let s:default_registry = {
\ 'description': 'Apply prettier-eslint to a file.', \ 'description': 'Apply prettier-eslint to a file.',
\ 'aliases': ['prettier-eslint'], \ 'aliases': ['prettier-eslint'],
\ }, \ },
\ 'pyflyby': {
\ 'function': 'ale#fixers#pyflyby#Fix',
\ 'suggested_filetypes': ['python'],
\ 'description': 'Tidy Python imports with pyflyby.',
\ },
\ 'importjs': { \ 'importjs': {
\ 'function': 'ale#fixers#importjs#Fix', \ 'function': 'ale#fixers#importjs#Fix',
\ 'suggested_filetypes': ['javascript'], \ 'suggested_filetypes': ['javascript'],
@ -221,11 +206,6 @@ let s:default_registry = {
\ 'suggested_filetypes': ['swift'], \ 'suggested_filetypes': ['swift'],
\ 'description': 'Apply SwiftFormat to a file.', \ 'description': 'Apply SwiftFormat to a file.',
\ }, \ },
\ 'syntax_tree': {
\ 'function': 'ale#fixers#syntax_tree#Fix',
\ 'suggested_filetypes': ['ruby'],
\ 'description': 'Fix ruby files with stree write',
\ },
\ 'apple-swift-format': { \ 'apple-swift-format': {
\ 'function': 'ale#fixers#appleswiftformat#Fix', \ 'function': 'ale#fixers#appleswiftformat#Fix',
\ 'suggested_filetypes': ['swift'], \ 'suggested_filetypes': ['swift'],
@ -241,11 +221,6 @@ let s:default_registry = {
\ 'suggested_filetypes': ['php'], \ 'suggested_filetypes': ['php'],
\ 'description': 'Fix PHP files with php-cs-fixer.', \ 'description': 'Fix PHP files with php-cs-fixer.',
\ }, \ },
\ 'pint': {
\ 'function': 'ale#fixers#pint#Fix',
\ 'suggested_filetypes': ['php'],
\ 'description': 'Fix PHP files with Laravel Pint.',
\ },
\ 'astyle': { \ 'astyle': {
\ 'function': 'ale#fixers#astyle#Fix', \ 'function': 'ale#fixers#astyle#Fix',
\ 'suggested_filetypes': ['c', 'cpp'], \ 'suggested_filetypes': ['c', 'cpp'],
@ -456,11 +431,6 @@ let s:default_registry = {
\ 'suggested_filetypes': ['hcl', 'terraform'], \ 'suggested_filetypes': ['hcl', 'terraform'],
\ 'description': 'Fix tf and hcl files with terraform fmt.', \ 'description': 'Fix tf and hcl files with terraform fmt.',
\ }, \ },
\ 'packer': {
\ 'function': 'ale#fixers#packer#Fix',
\ 'suggested_filetypes': ['hcl', 'packer'],
\ 'description': 'Fix Packer HCL files with packer fmt.',
\ },
\ 'crystal': { \ 'crystal': {
\ 'function': 'ale#fixers#crystal#Fix', \ 'function': 'ale#fixers#crystal#Fix',
\ 'suggested_filetypes': ['cr'], \ 'suggested_filetypes': ['cr'],
@ -551,20 +521,10 @@ let s:default_registry = {
\ 'suggested_filetypes': ['pascal'], \ 'suggested_filetypes': ['pascal'],
\ 'description': 'Fix Pascal files with ptop.', \ 'description': 'Fix Pascal files with ptop.',
\ }, \ },
\ 'opafmt': {
\ 'function': 'ale#fixers#opafmt#Fix',
\ 'suggested_filetypes': ['rego'],
\ 'description': 'Fix rego files with opa fmt.',
\ },
\ 'vfmt': { \ 'vfmt': {
\ 'function': 'ale#fixers#vfmt#Fix', \ 'function': 'ale#fixers#vfmt#Fix',
\ 'suggested_filetypes': ['v'], \ 'suggested_filetypes': ['v'],
\ 'description': 'A formatter for V source code.', \ 'description': 'A formatter for V source code.',
\ },
\ 'zigfmt': {
\ 'function': 'ale#fixers#zigfmt#Fix',
\ 'suggested_filetypes': ['zig'],
\ 'description': 'Official formatter for Zig',
\ } \ }
\} \}

View File

@ -1,12 +0,0 @@
" Author: Alex McKinney <alexmckinney01@gmail.com>
" Description: Run buf format.
call ale#Set('proto_buf_format_executable', 'buf')
function! ale#fixers#buf_format#Fix(buffer) abort
let l:executable = ale#Var(a:buffer, 'proto_buf_format_executable')
return {
\ 'command': ale#Escape(l:executable) . ' format %t',
\}
endfunction

View File

@ -1,16 +0,0 @@
" Author: Albert Peschar <albert@peschar.net>
" Description: Fix files with dune format.
call ale#Set('ocaml_dune_executable', 'dune')
call ale#Set('ocaml_dune_options', '')
function! ale#fixers#dune#Fix(buffer) abort
let l:executable = ale#Var(a:buffer, 'ocaml_dune_executable')
let l:options = ale#Var(a:buffer, 'ocaml_dune_options')
return {
\ 'command': ale#Escape(l:executable)
\ . ' format'
\ . (empty(l:options) ? '' : ' ' . l:options),
\}
endfunction

View File

@ -1,15 +0,0 @@
" Description: Fixer for rego files
call ale#Set('opa_fmt_executable', 'opa')
call ale#Set('opa_fmt_options', '')
function! ale#fixers#opafmt#Fix(buffer) abort
let l:executable = ale#Var(a:buffer, 'opa_fmt_executable')
let l:options = ale#Var(a:buffer, 'opa_fmt_options')
return {
\ 'command': ale#Escape(l:executable)
\ . ' fmt'
\ . (empty(l:options) ? '' : ' ' . l:options)
\}
endfunction

View File

@ -1,17 +0,0 @@
" Author: Zhuoyun Wei <wzyboy@wzyboy.org>
" Description: Fixer for Packer HCL files
call ale#Set('packer_fmt_executable', 'packer')
call ale#Set('packer_fmt_options', '')
function! ale#fixers#packer#Fix(buffer) abort
let l:executable = ale#Var(a:buffer, 'packer_fmt_executable')
let l:options = ale#Var(a:buffer, 'packer_fmt_options')
return {
\ 'command': ale#Escape(l:executable)
\ . ' fmt'
\ . (empty(l:options) ? '' : ' ' . l:options)
\ . ' -'
\}
endfunction

View File

@ -1,25 +0,0 @@
" Author: Michael Dyrynda <michael@dyrynda.com.au>
" Description: Fixing files with Laravel Pint.
call ale#Set('php_pint_executable', 'pint')
call ale#Set('php_pint_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('php_pint_options', '')
function! ale#fixers#pint#GetExecutable(buffer) abort
return ale#path#FindExecutable(a:buffer, 'php_pint', [
\ 'vendor/bin/pint',
\ 'pint'
\])
endfunction
function! ale#fixers#pint#Fix(buffer) abort
let l:executable = ale#fixers#pint#GetExecutable(a:buffer)
return {
\ 'command': ale#Escape(l:executable)
\ . ' ' . ale#Var(a:buffer, 'php_pint_options')
\ . ' %t',
\ 'read_temporary_file': 1,
\}
endfunction

View File

@ -1,41 +0,0 @@
" Author: infokiller <joweill@icloud.com>
" Description: Tidy imports using pyflyby's tidy-import script
" https://github.com/deshaw/pyflyby
call ale#Set('python_pyflyby_executable', 'tidy-imports')
call ale#Set('python_pyflyby_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_pyflyby_options', '')
call ale#Set('python_pyflyby_auto_pipenv', 0)
call ale#Set('python_pyflyby_auto_poetry', 0)
function! ale#fixers#pyflyby#GetExecutable(buffer) abort
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_pyflyby_auto_pipenv'))
\ && ale#python#PipenvPresent(a:buffer)
return 'pipenv'
endif
if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_pyflyby_auto_poetry'))
\ && ale#python#PoetryPresent(a:buffer)
return 'poetry'
endif
return ale#python#FindExecutable(a:buffer, 'python_pyflyby', ['tidy-imports'])
endfunction
function! ale#fixers#pyflyby#Fix(buffer) abort
" let l:executable = ale#fixers#pyflyby#GetExecutable(a:buffer)
let l:executable = ale#fixers#pyflyby#GetExecutable(a:buffer)
let l:cmd = [ale#Escape(l:executable)]
if l:executable =~? 'pipenv\|poetry$'
call extend(l:cmd, ['run', 'tidy-imports'])
endif
let l:options = ale#Var(a:buffer, 'python_pyflyby_options')
if !empty(l:options)
call add(l:cmd, l:options)
endif
return {'command': join(l:cmd, ' ')}
endfunction

View File

@ -5,13 +5,27 @@ scriptencoding utf-8
call ale#Set('sh_shfmt_executable', 'shfmt') call ale#Set('sh_shfmt_executable', 'shfmt')
call ale#Set('sh_shfmt_options', '') call ale#Set('sh_shfmt_options', '')
function! s:DefaultOption(buffer) abort
if getbufvar(a:buffer, '&expandtab') == 0
" Tab is used by default
return ''
endif
let l:tabsize = getbufvar(a:buffer, '&shiftwidth')
if l:tabsize == 0
let l:tabsize = getbufvar(a:buffer, '&tabstop')
endif
return ' -i ' . l:tabsize
endfunction
function! ale#fixers#shfmt#Fix(buffer) abort function! ale#fixers#shfmt#Fix(buffer) abort
let l:executable = ale#Var(a:buffer, 'sh_shfmt_executable') let l:executable = ale#Var(a:buffer, 'sh_shfmt_executable')
let l:options = ale#Var(a:buffer, 'sh_shfmt_options') let l:options = ale#Var(a:buffer, 'sh_shfmt_options')
return { return {
\ 'command': ale#Escape(l:executable) \ 'command': ale#Escape(l:executable)
\ . ' -filename=%s' \ . (empty(l:options) ? s:DefaultOption(a:buffer) : ' ' . l:options)
\ . (empty(l:options) ? '' : ' ' . l:options)
\} \}
endfunction endfunction

View File

@ -1,19 +0,0 @@
call ale#Set('ruby_syntax_tree_options', '')
call ale#Set('ruby_syntax_tree_executable', 'stree')
function! ale#fixers#syntax_tree#GetCommand(buffer) abort
let l:executable = ale#Var(a:buffer, 'ruby_syntax_tree_executable')
let l:options = ale#Var(a:buffer, 'ruby_syntax_tree_options')
return ale#ruby#EscapeExecutable(l:executable, 'stree')
\ . ' write'
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' %t'
endfunction
function! ale#fixers#syntax_tree#Fix(buffer) abort
return {
\ 'command': ale#fixers#syntax_tree#GetCommand(a:buffer),
\ 'read_temporary_file': 1,
\}
endfunction

View File

@ -1,14 +0,0 @@
scriptencoding utf-8
" Author: Arash Mousavi <arash-m>
" Description: Official formatter for Zig.
call ale#Set('zig_zigfmt_executable', 'zig')
function! ale#fixers#zigfmt#Fix(buffer) abort
let l:executable = ale#Var(a:buffer, 'zig_zigfmt_executable')
return {
\ 'command': ale#Escape(l:executable) . ' fmt %t',
\ 'read_temporary_file': 1,
\}
endfunction

View File

@ -1,15 +1,13 @@
" Author: Jan-Grimo Sobez <jan-grimo.sobez@phys.chem.ethz.ch> " Author: Jan-Grimo Sobez <jan-grimo.sobez@phys.chem.ethz.ch>
" Author: Kevin Clark <kevin.clark@gmail.com> " Author: Kevin Clark <kevin.clark@gmail.com>
" Author: D. Ben Knoble <ben.knoble+github@gmail.com> " Author: D. Ben Knoble <ben.knoble+github@gmail.com>
" Author: Shaun Duncan <shaun.duncan@gmail.com>
" Description: Floating preview window for showing whatever information in. " Description: Floating preview window for showing whatever information in.
" Precondition: exists('*nvim_open_win') || has('popupwin') " Precondition: exists('*nvim_open_win') || has('popupwin')
function! ale#floating_preview#Show(lines, ...) abort function! ale#floating_preview#Show(lines, ...) abort
if !exists('*nvim_open_win') && !has('popupwin') if !exists('*nvim_open_win') && !has('popupwin')
" no-custom-checks execute 'echom ''Floating windows not supported in this vim instance.'''
echom 'Floating windows not supported in this vim instance.'
return return
endif endif
@ -107,20 +105,18 @@ function! s:NvimPrepareWindowContent(lines) abort
let l:width += 2 let l:width += 2
let l:height += 2 let l:height += 2
let l:left = get(g:ale_floating_window_border, 0, '|') let l:hor = g:ale_floating_window_border[0]
let l:top = get(g:ale_floating_window_border, 1, '-') let l:top = g:ale_floating_window_border[1]
let l:top_left = get(g:ale_floating_window_border, 2, '+') let l:top_left = g:ale_floating_window_border[2]
let l:top_right = get(g:ale_floating_window_border, 3, '+') let l:top_right = g:ale_floating_window_border[3]
let l:bottom_right = get(g:ale_floating_window_border, 4, '+') let l:bottom_right = g:ale_floating_window_border[4]
let l:bottom_left = get(g:ale_floating_window_border, 5, '+') let l:bottom_left = g:ale_floating_window_border[5]
let l:right = get(g:ale_floating_window_border, 6, l:left)
let l:bottom = get(g:ale_floating_window_border, 7, l:top)
let l:lines = [l:top_left . repeat(l:top, l:width - 2) . l:top_right] let l:lines = [l:top_left . repeat(l:top, l:width - 2) . l:top_right]
for l:line in a:lines for l:line in a:lines
let l:line_width = strchars(l:line) let l:line_width = strchars(l:line)
let l:lines = add(l:lines, l:left . l:line . repeat(' ', l:width - l:line_width - 2). l:right) let l:lines = add(l:lines, l:hor . l:line . repeat(' ', l:width - l:line_width - 2). l:hor)
endfor endfor
" Truncate the lines " Truncate the lines
@ -128,24 +124,21 @@ function! s:NvimPrepareWindowContent(lines) abort
let l:lines = l:lines[0:l:max_height] let l:lines = l:lines[0:l:max_height]
endif endif
let l:lines = add(l:lines, l:bottom_left . repeat(l:bottom, l:width - 2) . l:bottom_right) let l:lines = add(l:lines, l:bottom_left . repeat(l:top, l:width - 2) . l:bottom_right)
return [l:lines, l:width, l:height] return [l:lines, l:width, l:height]
endfunction endfunction
function! s:NvimCreate(options) abort function! s:NvimCreate(options) abort
let l:popup_opts = extend({
\ 'relative': 'cursor',
\ 'row': 1,
\ 'col': 0,
\ 'width': 42,
\ 'height': 4,
\ 'style': 'minimal'
\ }, s:GetPopupOpts())
let l:buffer = nvim_create_buf(v:false, v:false) let l:buffer = nvim_create_buf(v:false, v:false)
let l:winid = nvim_open_win(l:buffer, v:false, l:popup_opts) let l:winid = nvim_open_win(l:buffer, v:false, {
\ 'relative': 'cursor',
\ 'row': 1,
\ 'col': 0,
\ 'width': 42,
\ 'height': 4,
\ 'style': 'minimal'
\ })
call nvim_buf_set_option(l:buffer, 'buftype', 'acwrite') call nvim_buf_set_option(l:buffer, 'buftype', 'acwrite')
call nvim_buf_set_option(l:buffer, 'bufhidden', 'delete') call nvim_buf_set_option(l:buffer, 'bufhidden', 'delete')
call nvim_buf_set_option(l:buffer, 'swapfile', v:false) call nvim_buf_set_option(l:buffer, 'swapfile', v:false)
@ -155,8 +148,7 @@ function! s:NvimCreate(options) abort
endfunction endfunction
function! s:VimCreate(options) abort function! s:VimCreate(options) abort
" default options let l:popup_id = popup_create([], {
let l:popup_opts = extend({
\ 'line': 'cursor+1', \ 'line': 'cursor+1',
\ 'col': 'cursor', \ 'col': 'cursor',
\ 'drag': v:true, \ 'drag': v:true,
@ -165,19 +157,17 @@ function! s:VimCreate(options) abort
\ 'padding': [0, 1, 0, 1], \ 'padding': [0, 1, 0, 1],
\ 'border': [], \ 'border': [],
\ 'borderchars': empty(g:ale_floating_window_border) ? [' '] : [ \ 'borderchars': empty(g:ale_floating_window_border) ? [' '] : [
\ get(g:ale_floating_window_border, 1, '-'), \ g:ale_floating_window_border[1],
\ get(g:ale_floating_window_border, 6, '|'), \ g:ale_floating_window_border[0],
\ get(g:ale_floating_window_border, 7, '-'), \ g:ale_floating_window_border[1],
\ get(g:ale_floating_window_border, 0, '|'), \ g:ale_floating_window_border[0],
\ get(g:ale_floating_window_border, 2, '+'), \ g:ale_floating_window_border[2],
\ get(g:ale_floating_window_border, 3, '+'), \ g:ale_floating_window_border[3],
\ get(g:ale_floating_window_border, 4, '+'), \ g:ale_floating_window_border[4],
\ get(g:ale_floating_window_border, 5, '+'), \ g:ale_floating_window_border[5],
\ ], \ ],
\ 'moved': 'any', \ 'moved': 'any',
\ }, s:GetPopupOpts()) \ })
let l:popup_id = popup_create([], l:popup_opts)
call setbufvar(winbufnr(l:popup_id), '&filetype', get(a:options, 'filetype', 'ale-preview')) call setbufvar(winbufnr(l:popup_id), '&filetype', get(a:options, 'filetype', 'ale-preview'))
let w:preview = {'id': l:popup_id} let w:preview = {'id': l:popup_id}
endfunction endfunction
@ -211,21 +201,3 @@ function! s:VimClose() abort
call popup_close(w:preview['id']) call popup_close(w:preview['id'])
unlet w:preview unlet w:preview
endfunction endfunction
" get either the results of a function callback or dictionary for popup overrides
function! s:GetPopupOpts() abort
if exists('g:ale_floating_preview_popup_opts')
let l:ref = g:ale_floating_preview_popup_opts
if type(l:ref) is# v:t_dict
return l:ref
elseif type(l:ref) is# v:t_string
try
return function(l:ref)()
catch /E700/
endtry
endif
endif
return {}
endfunction

View File

@ -1,36 +0,0 @@
function! ale#handlers#actionlint#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'yaml_actionlint_options')
" automatically add --no-color option if not defined
if l:options !~# '--no-color'
let l:options .= ' --no-color'
endif
" automatically add --oneline option if not defined
if l:options !~# '--oneline'
let l:options .= ' --oneline'
endif
return '%e ' . l:options . ' %t'
endfunction
function! ale#handlers#actionlint#Handle(buffer, lines) abort
" Matches patterns line the following:
".github/workflows/main.yml:19:0: could not parse as YAML: yaml: line 19: mapping values are not allowed in this context [yaml-syntax]
let l:pattern = '\v^.*:(\d+):(\d+): (.+) \[(.+)\]$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
let l:item = {
\ 'lnum': l:match[1] + 0,
\ 'col': l:match[2] + 0,
\ 'text': l:match[3],
\ 'code': l:match[4],
\ 'type': 'E',
\}
call add(l:output, l:item)
endfor
return l:output
endfunction

View File

@ -19,16 +19,6 @@ let s:temp_regex_prefix =
\ . substitute(s:temp_dir, '\\', '\\\\', 'g') \ . substitute(s:temp_dir, '\\', '\\\\', 'g')
\ . '\.\{-}' \ . '\.\{-}'
function! s:PanicOutput(lines) abort
return [{
\ 'lnum': 1,
\ 'col': 1,
\ 'text': 'ghc panic!',
\ 'type': 'E',
\ 'detail' : join(a:lines, "\n"),
\}]
endfunction
function! ale#handlers#haskell#HandleGHCFormat(buffer, lines) abort function! ale#handlers#haskell#HandleGHCFormat(buffer, lines) abort
" Look for lines like the following. " Look for lines like the following.
" "
@ -44,14 +34,6 @@ function! ale#handlers#haskell#HandleGHCFormat(buffer, lines) abort
let l:corrected_lines = [] let l:corrected_lines = []
" If ghc panic error, put the whole message in details and exit.
let l:panic_position = match(a:lines,'ghc: panic!')
let l:panic_end = match(a:lines,'Please report this as a GHC bug:')
if l:panic_position >= 0
return s:PanicOutput(a:lines[l:panic_position : l:panic_end])
endif
" Group the lines into smaller lists. " Group the lines into smaller lists.
for l:line in a:lines for l:line in a:lines
if len(matchlist(l:line, l:pattern)) > 0 if len(matchlist(l:line, l:pattern)) > 0

View File

@ -1,73 +0,0 @@
scriptencoding utf-8LE
" Description: This file defines a handler function for linting OpenSCAD files
" with SCA2D
function! ale#handlers#openscad#SCA2D_callback(buffer, lines) abort
" Example output::
" foo.scad:3:1: W2001: Variable `unused` overwritten within scope.
" foo.scad:1:1: F0001: Cannot read file due to syntax error:
" - No terminal matches '}' in the current parser context, at line 1 col 36
let l:filename_re = '^\([^:]*\):'
let l:linenum_re = '\([0-9]*\):'
let l:colnum_re = '\([0-9]*\):'
let l:err_id = '\([IWEFU][0-9]\+\):'
let l:err_msg = '\(.*\)'
let l:pattern = filename_re .
\ linenum_re .
\ colnum_re .
\ ' ' .
\ err_id .
\ ' ' .
\ err_msg
let l:result = []
let l:idx = 0
for l:line in a:lines
let l:matches = matchlist(line, pattern)
if len(matches) > 0
" option: Info, Warning, Error, Fatal, Unknown
if index(['I', 'W'], matches[4][0]) >= 0
let l:type = 'W'
else
let l:type = 'E'
endif
let l:lnum = matches[2]
let l:col = matches[3]
let l:text = matches[5]
" Better locations for some syntax errors
if matches[4][0] is# 'F'
let l:syntax_error_re = '^\(.*\), at line \([0-9]\+\) col \([0-9]\+\)$'
let l:next_line = a:lines[idx+1]
let l:syn_err_matches = matchlist(l:next_line, l:syntax_error_re)
if len(syn_err_matches) > 0
let l:text = l:text . l:syn_err_matches[1]
let l:lnum = l:syn_err_matches[2]
let l:col = l:syn_err_matches[3]
else
let l:text = l:next_line
endif
endif
let l:element = {
\ 'lnum': str2nr(l:lnum),
\ 'col': str2nr(l:col),
\ 'text': l:text,
\ 'detail': l:matches[4] . ': ' . l:text,
\ 'filename': fnamemodify(matches[1], ':p'),
\ 'type': l:type
\ }
call add(l:result, l:element)
endif
let l:idx += 1
endfor
return result
endfun

View File

@ -46,7 +46,7 @@ function! ale#hover#HandleTSServerResponse(conn_id, response) abort
call balloon_show(a:response.body.displayString) call balloon_show(a:response.body.displayString)
elseif get(l:options, 'truncated_echo', 0) elseif get(l:options, 'truncated_echo', 0)
if !empty(a:response.body.displayString) if !empty(a:response.body.displayString)
call ale#cursor#TruncatedEcho(a:response.body.displayString) call ale#cursor#TruncatedEcho(split(a:response.body.displayString, "\n")[0])
endif endif
elseif g:ale_hover_to_floating_preview || g:ale_floating_preview elseif g:ale_hover_to_floating_preview || g:ale_floating_preview
call ale#floating_preview#Show(split(a:response.body.displayString, "\n"), { call ale#floating_preview#Show(split(a:response.body.displayString, "\n"), {
@ -231,11 +231,7 @@ function! ale#hover#HandleLSPResponse(conn_id, response) abort
\&& (l:set_balloons is 1 || l:set_balloons is# 'hover') \&& (l:set_balloons is 1 || l:set_balloons is# 'hover')
call balloon_show(join(l:lines, "\n")) call balloon_show(join(l:lines, "\n"))
elseif get(l:options, 'truncated_echo', 0) elseif get(l:options, 'truncated_echo', 0)
if type(l:lines[0]) is# v:t_list call ale#cursor#TruncatedEcho(l:lines[0])
call ale#cursor#TruncatedEcho(join(l:lines[0], '\n'))
else
call ale#cursor#TruncatedEcho(l:lines[0])
endif
elseif g:ale_hover_to_floating_preview || g:ale_floating_preview elseif g:ale_hover_to_floating_preview || g:ale_floating_preview
call ale#floating_preview#Show(l:lines, { call ale#floating_preview#Show(l:lines, {
\ 'filetype': 'ale-preview.message', \ 'filetype': 'ale-preview.message',
@ -339,10 +335,6 @@ function! ale#hover#ShowTruncatedMessageAtCursor() abort
let l:buffer = bufnr('') let l:buffer = bufnr('')
let l:pos = getpos('.')[0:2] let l:pos = getpos('.')[0:2]
if !getbufvar(l:buffer, 'ale_enabled', 1)
return
endif
if l:pos != s:last_pos if l:pos != s:last_pos
let s:last_pos = l:pos let s:last_pos = l:pos
let [l:info, l:loc] = ale#util#FindItemAtCursor(l:buffer) let [l:info, l:loc] = ale#util#FindItemAtCursor(l:buffer)

View File

@ -187,16 +187,10 @@ function! ale#job#PrepareCommand(buffer, command) abort
\ : a:command \ : a:command
" If a custom shell is specified, use that. " If a custom shell is specified, use that.
if exists('b:ale_shell') if exists('g:ale_shell')
let l:ale_shell = b:ale_shell let l:shell_arguments = get(g:, 'ale_shell_arguments', &shellcmdflag)
elseif exists('g:ale_shell')
let l:ale_shell = g:ale_shell
endif
if exists('l:ale_shell') return split(g:ale_shell) + split(l:shell_arguments) + [l:command]
let l:shell_arguments = get(b:, 'ale_shell_arguments', get(g:, 'ale_shell_arguments', &shellcmdflag))
return split(l:ale_shell) + split(l:shell_arguments) + [l:command]
endif endif
if has('win32') if has('win32')
@ -250,16 +244,10 @@ function! ale#job#Start(command, options) abort
if has_key(a:options, 'out_cb') if has_key(a:options, 'out_cb')
let l:job_options.out_cb = function('s:VimOutputCallback') let l:job_options.out_cb = function('s:VimOutputCallback')
else
" prevent buffering of output and excessive polling in case close_cb is set
let l:job_options.out_cb = {->0}
endif endif
if has_key(a:options, 'err_cb') if has_key(a:options, 'err_cb')
let l:job_options.err_cb = function('s:VimErrorCallback') let l:job_options.err_cb = function('s:VimErrorCallback')
else
" prevent buffering of output and excessive polling in case close_cb is set
let l:job_options.err_cb = {->0}
endif endif
if has_key(a:options, 'exit_cb') if has_key(a:options, 'exit_cb')

View File

@ -19,7 +19,6 @@ let s:default_ale_linter_aliases = {
\ 'rmd': 'r', \ 'rmd': 'r',
\ 'systemverilog': 'verilog', \ 'systemverilog': 'verilog',
\ 'typescriptreact': ['typescript', 'tsx'], \ 'typescriptreact': ['typescript', 'tsx'],
\ 'vader': ['vim', 'vader'],
\ 'verilog_systemverilog': ['verilog_systemverilog', 'verilog'], \ 'verilog_systemverilog': ['verilog_systemverilog', 'verilog'],
\ 'vimwiki': 'markdown', \ 'vimwiki': 'markdown',
\ 'vue': ['vue', 'javascript'], \ 'vue': ['vue', 'javascript'],
@ -46,7 +45,7 @@ let s:default_ale_linters = {
\ 'hack': ['hack'], \ 'hack': ['hack'],
\ 'help': [], \ 'help': [],
\ 'inko': ['inko'], \ 'inko': ['inko'],
\ 'json': ['jsonlint', 'spectral', 'vscodejson'], \ 'json': ['jsonlint', 'spectral'],
\ 'json5': [], \ 'json5': [],
\ 'jsonc': [], \ 'jsonc': [],
\ 'perl': ['perlcritic'], \ 'perl': ['perlcritic'],
@ -55,11 +54,9 @@ let s:default_ale_linters = {
\ 'rust': ['cargo', 'rls'], \ 'rust': ['cargo', 'rls'],
\ 'spec': [], \ 'spec': [],
\ 'text': [], \ 'text': [],
\ 'vader': ['vimls'],
\ 'vue': ['eslint', 'vls'], \ 'vue': ['eslint', 'vls'],
\ 'zsh': ['shell'], \ 'zsh': ['shell'],
\ 'v': ['v'], \ 'v': ['v'],
\ 'yaml': ['spectral', 'yaml-language-server', 'yamllint'],
\} \}
" Testing/debugging helper to unload all linters. " Testing/debugging helper to unload all linters.

View File

@ -44,7 +44,6 @@ function! ale#lsp#Register(executable_or_address, project, init_options) abort
\ 'completion_trigger_characters': [], \ 'completion_trigger_characters': [],
\ 'definition': 0, \ 'definition': 0,
\ 'typeDefinition': 0, \ 'typeDefinition': 0,
\ 'implementation': 0,
\ 'symbol_search': 0, \ 'symbol_search': 0,
\ 'code_actions': 0, \ 'code_actions': 0,
\ 'did_save': 0, \ 'did_save': 0,
@ -260,14 +259,6 @@ function! s:UpdateCapabilities(conn, capabilities) abort
let a:conn.capabilities.typeDefinition = 1 let a:conn.capabilities.typeDefinition = 1
endif endif
if get(a:capabilities, 'implementationProvider') is v:true
let a:conn.capabilities.implementation = 1
endif
if type(get(a:capabilities, 'implementationProvider')) is v:t_dict
let a:conn.capabilities.implementation = 1
endif
if get(a:capabilities, 'workspaceSymbolProvider') is v:true if get(a:capabilities, 'workspaceSymbolProvider') is v:true
let a:conn.capabilities.symbol_search = 1 let a:conn.capabilities.symbol_search = 1
endif endif
@ -388,7 +379,6 @@ function! ale#lsp#MarkConnectionAsTsserver(conn_id) abort
let l:conn.capabilities.completion_trigger_characters = ['.'] let l:conn.capabilities.completion_trigger_characters = ['.']
let l:conn.capabilities.definition = 1 let l:conn.capabilities.definition = 1
let l:conn.capabilities.typeDefinition = 1 let l:conn.capabilities.typeDefinition = 1
let l:conn.capabilities.implementation = 1
let l:conn.capabilities.symbol_search = 1 let l:conn.capabilities.symbol_search = 1
let l:conn.capabilities.rename = 1 let l:conn.capabilities.rename = 1
let l:conn.capabilities.filerename = 1 let l:conn.capabilities.filerename = 1
@ -448,20 +438,11 @@ function! s:SendInitMessage(conn) abort
\ 'typeDefinition': { \ 'typeDefinition': {
\ 'dynamicRegistration': v:false, \ 'dynamicRegistration': v:false,
\ }, \ },
\ 'implementation': {
\ 'dynamicRegistration': v:false,
\ 'linkSupport': v:false,
\ },
\ 'publishDiagnostics': { \ 'publishDiagnostics': {
\ 'relatedInformation': v:true, \ 'relatedInformation': v:true,
\ }, \ },
\ 'codeAction': { \ 'codeAction': {
\ 'dynamicRegistration': v:false, \ 'dynamicRegistration': v:false,
\ 'codeActionLiteralSupport': {
\ 'codeActionKind': {
\ 'valueSet': []
\ }
\ }
\ }, \ },
\ 'rename': { \ 'rename': {
\ 'dynamicRegistration': v:false, \ 'dynamicRegistration': v:false,

View File

@ -139,15 +139,6 @@ function! ale#lsp#message#TypeDefinition(buffer, line, column) abort
\}] \}]
endfunction endfunction
function! ale#lsp#message#Implementation(buffer, line, column) abort
return [0, 'textDocument/implementation', {
\ 'textDocument': {
\ 'uri': ale#util#ToURI(expand('#' . a:buffer . ':p')),
\ },
\ 'position': {'line': a:line - 1, 'character': a:column - 1},
\}]
endfunction
function! ale#lsp#message#References(buffer, line, column) abort function! ale#lsp#message#References(buffer, line, column) abort
return [0, 'textDocument/references', { return [0, 'textDocument/references', {
\ 'textDocument': { \ 'textDocument': {

View File

@ -72,14 +72,6 @@ function! ale#lsp#tsserver_message#TypeDefinition(buffer, line, column) abort
\}] \}]
endfunction endfunction
function! ale#lsp#tsserver_message#Implementation(buffer, line, column) abort
return [0, 'ts@implementation', {
\ 'line': a:line,
\ 'offset': a:column,
\ 'file': expand('#' . a:buffer . ':p'),
\}]
endfunction
function! ale#lsp#tsserver_message#References(buffer, line, column) abort function! ale#lsp#tsserver_message#References(buffer, line, column) abort
return [0, 'ts@references', { return [0, 'ts@references', {
\ 'line': a:line, \ 'line': a:line,

View File

@ -26,7 +26,6 @@ function! ale#python#FindProjectRootIni(buffer) abort
\|| filereadable(l:path . '/tox.ini') \|| filereadable(l:path . '/tox.ini')
\|| filereadable(l:path . '/.pyre_configuration.local') \|| filereadable(l:path . '/.pyre_configuration.local')
\|| filereadable(l:path . '/mypy.ini') \|| filereadable(l:path . '/mypy.ini')
\|| filereadable(l:path . '/.mypy.ini')
\|| filereadable(l:path . '/pycodestyle.cfg') \|| filereadable(l:path . '/pycodestyle.cfg')
\|| filereadable(l:path . '/.flake8') \|| filereadable(l:path . '/.flake8')
\|| filereadable(l:path . '/.flake8rc') \|| filereadable(l:path . '/.flake8rc')

View File

@ -62,34 +62,25 @@ function! ale#test#SetFilename(path) abort
silent! noautocmd execute 'file ' . fnameescape(l:full_path) silent! noautocmd execute 'file ' . fnameescape(l:full_path)
endfunction endfunction
function! RemoveNewerKeys(results) abort function! s:RemoveModule(results) abort
for l:item in a:results for l:item in a:results
if has_key(l:item, 'module') if has_key(l:item, 'module')
call remove(l:item, 'module') call remove(l:item, 'module')
endif endif
if has_key(l:item, 'end_col')
call remove(l:item, 'end_col')
endif
if has_key(l:item, 'end_lnum')
call remove(l:item, 'end_lnum')
endif
endfor endfor
endfunction endfunction
" Return loclist data with only the keys supported by the lowest Vim versions. " Return loclist data without the module string, only in newer Vim versions.
function! ale#test#GetLoclistWithoutNewerKeys() abort function! ale#test#GetLoclistWithoutModule() abort
let l:results = getloclist(0) let l:results = getloclist(0)
call RemoveNewerKeys(l:results) call s:RemoveModule(l:results)
return l:results return l:results
endfunction endfunction
" Return quickfix data with only the keys supported by the lowest Vim versions. function! ale#test#GetQflistWithoutModule() abort
function! ale#test#GetQflistWithoutNewerKeys() abort
let l:results = getqflist() let l:results = getqflist()
call RemoveNewerKeys(l:results) call s:RemoveModule(l:results)
return l:results return l:results
endfunction endfunction

View File

@ -64,8 +64,7 @@ function! ale#toggle#ToggleBuffer(buffer) abort
" Disabling ALE globally removes autocmd events, so we cannot enable " Disabling ALE globally removes autocmd events, so we cannot enable
" linting locally when linting is disabled globally " linting locally when linting is disabled globally
if l:enabled && !g:ale_enabled if l:enabled && !g:ale_enabled
" no-custom-checks execute 'echom ''ALE cannot be enabled locally when disabled globally'''
echom 'ALE cannot be enabled locally when disabled globally'
return return
endif endif

View File

@ -3,8 +3,7 @@
function! s:OpenJDTLink(root, uri, line, column, options, result) abort function! s:OpenJDTLink(root, uri, line, column, options, result) abort
if has_key(a:result, 'error') if has_key(a:result, 'error')
" no-custom-checks execute 'echoerr a:result.error.message'
echoerr a:result.error.message
return return
endif endif
@ -12,8 +11,7 @@ function! s:OpenJDTLink(root, uri, line, column, options, result) abort
let l:contents = a:result['result'] let l:contents = a:result['result']
if type(l:contents) is# type(v:null) if type(l:contents) is# type(v:null)
" no-custom-checks execute 'echoerr ''File content not found'''
echoerr 'File content not found'
endif endif
" disable autocmd when opening buffer " disable autocmd when opening buffer
@ -61,8 +59,7 @@ endfunction
function! s:ReadClassFileContents(uri, result) abort function! s:ReadClassFileContents(uri, result) abort
if has_key(a:result, 'error') if has_key(a:result, 'error')
" no-custom-checks execute 'echoerr a:result.error.message'
echoerr a:result.error.message
return return
endif endif
@ -70,8 +67,7 @@ function! s:ReadClassFileContents(uri, result) abort
let l:contents = a:result['result'] let l:contents = a:result['result']
if type(l:contents) is# type(v:null) if type(l:contents) is# type(v:null)
" no-custom-checks execute 'echoerr ''File content not found'''
echoerr 'File content not found'
endif endif
call setline(1, split(l:contents, '\n')) call setline(1, split(l:contents, '\n'))

View File

@ -25,8 +25,7 @@ function! ale#util#ShowMessage(string, ...) abort
" We have to assume the user is using a monospace font. " We have to assume the user is using a monospace font.
if has('nvim') || (a:string !~? "\n" && len(a:string) < &columns) if has('nvim') || (a:string !~? "\n" && len(a:string) < &columns)
" no-custom-checks execute 'echo a:string'
echo a:string
else else
call ale#preview#Show(split(a:string, "\n"), extend( call ale#preview#Show(split(a:string, "\n"), extend(
\ { \ {

View File

@ -8,21 +8,14 @@ let g:ale_virtualtext_delay = get(g:, 'ale_virtualtext_delay', 10)
let s:cursor_timer = -1 let s:cursor_timer = -1
let s:last_pos = [0, 0, 0] let s:last_pos = [0, 0, 0]
let s:has_virt_text = 0 let s:has_virt_text = 0
let s:emulate_virt = 0
if has('nvim-0.3.2') if has('nvim-0.3.2')
let s:ns_id = nvim_create_namespace('ale') let s:ns_id = nvim_create_namespace('ale')
let s:has_virt_text = 1 let s:has_virt_text = 1
elseif has('textprop') && has('popupwin') elseif has('textprop') && has('popupwin')
call prop_type_add('ale', {})
let s:last_popup = -1
let s:has_virt_text = 1 let s:has_virt_text = 1
let s:emulate_virt = !has('patch-9.0.0214')
if s:emulate_virt
call prop_type_add('ale', {})
let s:last_virt = -1
else
let s:last_virt = 1
endif
endif endif
function! ale#virtualtext#Clear() abort function! ale#virtualtext#Clear() abort
@ -35,13 +28,10 @@ function! ale#virtualtext#Clear() abort
if has('nvim') if has('nvim')
call nvim_buf_clear_highlight(l:buffer, s:ns_id, 0, -1) call nvim_buf_clear_highlight(l:buffer, s:ns_id, 0, -1)
else else
if s:emulate_virt && s:last_virt != -1 if s:last_popup != -1
call prop_remove({'type': 'ale'}) call prop_remove({'type': 'ale'})
call popup_close(s:last_virt) call popup_close(s:last_popup)
let s:last_virt = -1 let s:last_popup = -1
elseif s:last_virt != 1
call prop_remove({'id': s:last_virt})
let s:last_virt = 1
endif endif
endif endif
endfunction endfunction
@ -58,12 +48,12 @@ function! ale#virtualtext#ShowMessage(message, hl_group) abort
if has('nvim') if has('nvim')
call nvim_buf_set_virtual_text(l:buffer, s:ns_id, l:line-1, [[l:msg, a:hl_group]], {}) call nvim_buf_set_virtual_text(l:buffer, s:ns_id, l:line-1, [[l:msg, a:hl_group]], {})
elseif s:emulate_virt else
let l:left_pad = col('$') let l:left_pad = col('$')
call prop_add(l:line, l:left_pad, { call prop_add(l:line, l:left_pad, {
\ 'type': 'ale', \ 'type': 'ale',
\}) \})
let s:last_virt = popup_create(l:msg, { let s:last_popup = popup_create(l:msg, {
\ 'line': -1, \ 'line': -1,
\ 'padding': [0, 0, 0, 1], \ 'padding': [0, 0, 0, 1],
\ 'mask': [[1, 1, 1, 1]], \ 'mask': [[1, 1, 1, 1]],
@ -73,17 +63,6 @@ function! ale#virtualtext#ShowMessage(message, hl_group) abort
\ 'wrap': 0, \ 'wrap': 0,
\ 'zindex': 2 \ 'zindex': 2
\}) \})
else
let type = prop_type_get(a:hl_group)
if type == {}
call prop_type_add(a:hl_group, {'highlight': a:hl_group})
endif
let s:last_virt = prop_add(l:line, 0, {
\ 'type': a:hl_group,
\ 'text': ' ' . l:msg
\})
endif endif
endfunction endfunction

View File

@ -1,15 +0,0 @@
===============================================================================
ALE Cairo Integration *ale-cairo-options*
===============================================================================
starknet *ale-cairo-starknet*
g:ale_cairo_starknet_executable *g:ale_cairo_starknet_executable*
*b:ale_cairo_starknet_executable*
Default: `'starknet-compile'`
Overrides the starknet-compile binary after installing the cairo-language.
For more information read 'https://starknet.io/docs/quickstart.html'

View File

@ -49,18 +49,5 @@ g:ale_css_stylelint_use_global *g:ale_css_stylelint_use_global*
See |ale-integrations-local-executables| See |ale-integrations-local-executables|
===============================================================================
vscodecss *ale-css-vscode*
Website: https://github.com/hrsh7th/vscode-langservers-extracted
Installation
-------------------------------------------------------------------------------
Install VSCode css language server either globally or locally: >
npm install -g vscode-langservers-extracted
<
=============================================================================== ===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View File

@ -98,8 +98,8 @@ should also follow some additional rules designed to prevent mistakes. Some of
these are reported with ALE's `custom-linting-rules` script. See these are reported with ALE's `custom-linting-rules` script. See
|ale-development-tests|. |ale-development-tests|.
* Don't leave stray `:echo` lines in code. Write `" no-custom-checks` above * Don't leave stray `:echo` lines in code. Use `execute 'echo' ...` if you must
the line if you must echo something. echo something.
* For strings use |is#| instead of |==#|, `is?` instead of `==?`, `isnot#` * For strings use |is#| instead of |==#|, `is?` instead of `==?`, `isnot#`
instead of `!=#`, and `isnot?` instead of `!=?`. This is because `'x' ==# 0` instead of `!=#`, and `isnot?` instead of `!=?`. This is because `'x' ==# 0`
returns 1, while `'x' is# 0` returns 0, so you will experience fewer issues returns 1, while `'x' is# 0` returns 0, so you will experience fewer issues
@ -154,9 +154,10 @@ ALE runs tests with the following versions of Vim in the following
environments. environments.
1. Vim 8.0.0027 on Linux via GitHub Actions. 1. Vim 8.0.0027 on Linux via GitHub Actions.
2. Vim 8.2.4693 on Linux via GitHub Actions. 2. Vim 8.2.2401 on Linux via GitHub Actions.
3. NeoVim 0.2.0 on Linux via GitHub Actions. 3. NeoVim 0.2.0 on Linux via GitHub Actions.
4. NeoVim 0.7.0 on Linux via GitHub Actions. 4. NeoVim 0.4.4 on Linux via GitHub Actions.
5. NeoVim 0.5.0 on Linux via GitHub Actions.
6. Vim 8 (stable builds) on Windows via AppVeyor. 6. Vim 8 (stable builds) on Windows via AppVeyor.
If you are developing ALE code on Linux, Mac OSX, or BSD, you can run ALEs If you are developing ALE code on Linux, Mac OSX, or BSD, you can run ALEs

View File

@ -354,7 +354,7 @@ g:ale_go_staticcheck_options *g:ale_go_staticcheck_options*
g:ale_go_staticcheck_lint_package *g:ale_go_staticcheck_lint_package* g:ale_go_staticcheck_lint_package *g:ale_go_staticcheck_lint_package*
*b:ale_go_staticcheck_lint_package* *b:ale_go_staticcheck_lint_package*
Type: |Number| Type: |Number|
Default: `1` Default: `0`
When set to `1`, the whole Go package will be checked instead of only the When set to `1`, the whole Go package will be checked instead of only the
current file. current file.

View File

@ -134,7 +134,7 @@ g:ale_haskell_hlint_options g:ale_haskell_hlint_options
hls *ale-haskell-hls* hls *ale-haskell-hls*
g:ale_haskell_hls_executable *g:ale_haskell_hls_executable* g:ale_haskell_hls_executable *g:ale_haskell_hls_executable*
*b:ale_haskell_hls_executable* *b:ale_haskell_his_executable*
Type: |String| Type: |String|
Default: `'haskell-language-server-wrapper'` Default: `'haskell-language-server-wrapper'`

View File

@ -2,11 +2,6 @@
ALE HCL Integration *ale-hcl-options* ALE HCL Integration *ale-hcl-options*
===============================================================================
packer-fmt *ale-hcl-packer-fmt*
See |ale-packer-fmt-fixer| for information about the available options.
=============================================================================== ===============================================================================
terraform-fmt *ale-hcl-terraform-fmt* terraform-fmt *ale-hcl-terraform-fmt*

View File

@ -164,19 +164,6 @@ g:ale_html_tidy_use_global *g:html_tidy_use_global*
See |ale-integrations-local-executables| See |ale-integrations-local-executables|
===============================================================================
vscodehtml *ale-html-vscode*
Website: https://github.com/hrsh7th/vscode-langservers-extracted
Installation
-------------------------------------------------------------------------------
Install VSCode html language server either globally or locally: >
npm install -g vscode-langservers-extracted
<
=============================================================================== ===============================================================================
write-good *ale-html-write-good* write-good *ale-html-write-good*

View File

@ -153,18 +153,6 @@ g:ale_json_spectral_use_global *g:ale_json_spectral_use_global*
See |ale-integrations-local-executables| See |ale-integrations-local-executables|
===============================================================================
vscodejson *ale-json-vscode*
Website: https://github.com/hrsh7th/vscode-langservers-extracted
Installation
-------------------------------------------------------------------------------
Install VSCode json language server either globally or locally: >
npm install -g vscode-langservers-extracted
<
=============================================================================== ===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View File

@ -76,25 +76,6 @@ g:ale_lua_luafmt_options *g:ale_lua_luafmt_options*
This variable can be set to pass additional options to the luafmt fixer. This variable can be set to pass additional options to the luafmt fixer.
===============================================================================
selene *ale-lua-selene*
g:ale_lua_selene_executable *g:ale_lua_selene_executable*
*b:ale_lua_selene_executable*
Type: |String|
Default: `'selene'`
This variable can be set to use a different executable for selene.
g:ale_lua_selene_options *g:ale_lua_selene_options*
*b:ale_lua_selene_options*
Type: |String|
Default: `''`
This variable can be set to pass additional options to selene.
=============================================================================== ===============================================================================
stylua *ale-lua-stylua* stylua *ale-lua-stylua*

View File

@ -2,26 +2,6 @@
ALE OCaml Integration *ale-ocaml-options* ALE OCaml Integration *ale-ocaml-options*
===============================================================================
dune *ale-ocaml-dune*
Dune is a build system for OCaml projects. The `dune format` command is
supported for automatically formatting `dune` and `dune-project` files.
g:ale_ocaml_dune_executable *g:ale_ocaml_dune_executable*
*b:ale_ocaml_dune_executable*
Type: |String|
Default: `'dune'`
This variable can be set to pass the path to dune.
g:ale_ocaml_dune_options *g:ale_ocaml_dune_options*
*b:ale_ocaml_dune_options*
Type: |String|
Default: `''`
This variable can be set to pass additional options to the dune fixer.
=============================================================================== ===============================================================================
merlin *ale-ocaml-merlin* merlin *ale-ocaml-merlin*

View File

@ -1,25 +0,0 @@
===============================================================================
ALE OpenSCAD Integration *ale-openscad-options*
===============================================================================
sca2d *ale-openscad-sca2d*
g:ale_openscad_sca2d_executable *g:ale_openscad_sca2d_executable*
*b:ale_openscad_sca2d_executable*
Type: |String|
Default: `'sca2d'`
See |ale-integrations-local-executables|
g:ale_openscad_sca2d_options *g:ale_openscad_sca2d_options*
*b:ale_openscad_sca2d_options*
Type: |String|
Default: `''`
This variable can be set to pass options to sca2d.
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View File

@ -1,24 +0,0 @@
===============================================================================
ALE Packer Integration *ale-packer-options*
===============================================================================
packer-fmt-fixer *ale-packer-fmt-fixer*
g:ale_packer_fmt_executable *g:ale_packer_fmt_executable*
*b:ale_packer_fmt_executable*
Type: |String|
Default: `'packer'`
This variable can be changed to use a different executable for packer.
g:ale_packer_fmt_options *g:ale_packer_fmt_options*
*b:ale_packer_fmt_options*
Type: |String|
Default: `''`
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View File

@ -272,33 +272,6 @@ g:ale_php_php_executable *g:ale_php_php_executable*
This variable sets the executable used for php. This variable sets the executable used for php.
===============================================================================
pint *ale-php-pint*
g:ale_php_pint_executable *g:ale_php_pint_executable*
*b:ale_php_pint_executable*
Type: |String|
Default: `'pint'`
This variable sets the executable used for pint.
g:ale_php_pint_options *g:ale_php_pint_options*
*b:ale_php_pint_options*
Type: |String|
Default: `''`
This variable can be set to pass additional options to pint.
g:ale_php_pint_use_global *g:ale_php_pint_use_global*
*b:ale_php_pint_use_global*
Type: |Boolean|
Default: `get(g:, 'ale_use_global_executables', 0)`
See |ale-integrations-local-executables|
=============================================================================== ===============================================================================
tlint *ale-php-tlint* tlint *ale-php-tlint*

View File

@ -8,51 +8,13 @@ Integration Information
To enable `.proto` file linting, update |g:ale_linters| as appropriate: To enable `.proto` file linting, update |g:ale_linters| as appropriate:
> >
" Enable linter for .proto files " Enable linter for .proto files
let g:ale_linters = {'proto': ['buf-lint', 'protoc-gen-lint', 'protolint']} let g:ale_linters = {'proto': ['protoc-gen-lint', 'protolint']}
To enable `.proto` file fixing, update |g:ale_fixers| as appropriate: To enable `.proto` file fixing, update |g:ale_fixers| as appropriate:
> >
" Enable linter for .proto files " Enable linter for .proto files
let b:ale_fixers = {'proto': ['buf-format', 'protolint']} let b:ale_fixers = {'proto': ['protolint']}
< <
===============================================================================
buf-format *ale-proto-buf-format*
The formatter uses `buf`, a fully-featured Protobuf compiler that doesn't depend
on `protoc`. Make sure the `buf` binary is available in the system path, or
set ale_proto_buf_format_executable.
g:ale_proto_buf_format_executable *g:ale_proto_buf_format_executable*
Type: |String|
Default: 'buf'
This variable can be changed to modify the executable used for buf.
===============================================================================
buf-lint *ale-proto-buf-lint*
The linter uses `buf`, a fully-featured Protobuf compiler that doesn't depend
on `protoc`. Make sure the `buf` binary is available in the system path, or
set ale_proto_buf_lint_executable.
g:ale_proto_buf_lint_executable *g:ale_proto_buf_lint_executable*
Type: |String|
Default: 'buf'
This variable can be changed to modify the executable used for buf.
g:ale_proto_buf_lint_config *g:ale_proto_buf_lint_config*
Type: |String|
Default: `''`
A path to a buf configuration file.
The path to the configuration file can be an absolute path or a relative
path. ALE will search for the relative path in parent directories.
=============================================================================== ===============================================================================
protoc-gen-lint *ale-proto-protoc-gen-lint* protoc-gen-lint *ale-proto-protoc-gen-lint*

View File

@ -39,7 +39,6 @@ ALE will look for configuration files with the following filenames. >
tox.ini tox.ini
.pyre_configuration.local .pyre_configuration.local
mypy.ini mypy.ini
.mypy.ini
pycodestyle.cfg pycodestyle.cfg
.flake8 .flake8
.flake8rc .flake8rc
@ -268,8 +267,8 @@ g:ale_python_flake8_change_directory *g:ale_python_flake8_change_directory*
Default: `'project'` Default: `'project'`
If set to `project`, ALE will switch to the project root before checking file. If set to `project`, ALE will switch to the project root before checking file.
If set to `file`, ALE will first switch to the directory containing the If set to `file`, ALE will switch to directory the Python file being
Python file being checked with `flake8` before checking it. checked with `flake8` is in before checking it.
You can turn it off with `off` option if you want to control the directory You can turn it off with `off` option if you want to control the directory
Python is executed from yourself. Python is executed from yourself.
@ -708,52 +707,6 @@ g:ale_python_pyflakes_auto_poetry *g:ale_python_pyflakes_auto_poetry*
if true. This is overridden by a manually-set executable. if true. This is overridden by a manually-set executable.
===============================================================================
pyflyby *ale-python-pyflyby*
g:ale_python_pyflyby_executable *g:ale_python_pyflyby_executable*
*b:ale_python_pyflyby_executable*
Type: |String|
Default: `'tidy-imports'`
See |ale-integrations-local-executables|
g:ale_python_pyflyby_options *g:ale_python_pyflyby_options*
*b:ale_python_pyflyby_options*
Type: |String|
Default: `''`
This variable can be changed to add command-line arguments to the pyflyby
tidy-imports invocation.
g:ale_python_pyflyby_use_global *g:ale_python_pyflyby_use_global*
*b:ale_python_pyflyby_use_global*
Type: |Number|
Default: `get(g:, 'ale_use_global_executables', 0)`
See |ale-integrations-local-executables|
g:ale_python_pyflyby_auto_pipenv *g:ale_python_pyflyby_auto_pipenv*
*b:ale_python_pyflyby_auto_pipenv*
Type: |Number|
Default: `0`
Detect whether the file is inside a pipenv, and set the executable to `pipenv`
if true. This is overridden by a manually-set executable.
g:ale_python_pyflyby_auto_poetry *g:ale_python_pyflyby_auto_poetry*
*b:ale_python_pyflyby_auto_poetry*
Type: |Number|
Default: `0`
Detect whether the file is inside a poetry, and set the executable to `poetry`
if true. This is overridden by a manually-set executable.
=============================================================================== ===============================================================================
pylama *ale-python-pylama* pylama *ale-python-pylama*

View File

@ -1,50 +0,0 @@
===============================================================================
ALE Rego Integration *ale-rego-options*
===============================================================================
cspell *ale-rego-cspell*
See |ale-cspell-options|
===============================================================================
opacheck *ale-rego-opa-check*
g:ale_rego_opacheck_executable *g:rego_opacheck_executable*
*b:rego_opacheck_executable*
Type: |String|
Default: `'opa'`
This variable can be changed to use a different executable for opa.
g:rego_opacheck_options *g:rego_opacheck_options*
*b:rego_opacheck_options*
Type: |String|
Default: `''`
This variable can be changed to pass custom CLI flags to opa check.
===============================================================================
opafmt *ale-rego-opa-fmt-fixer*
g:ale_opa_fmt_executable *g:ale_opa_fmt_executable*
*b:ale_opa_fmt_executable*
Type: |String|
Default: `'opa'`
This variable can be changed to use a different executable for opa.
g:ale_opa_fmt_options *g:ale_opa_fmt_options*
*b:ale_opa_fmt_options*
Type: |String|
Default: `''`
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View File

@ -219,25 +219,5 @@ g:ale_ruby_standardrb_options *g:ale_ruby_standardrb_options*
This variable can be changed to modify flags given to standardrb. This variable can be changed to modify flags given to standardrb.
===============================================================================
syntax_tree *ale-ruby-syntax_tree*
g:ale_ruby_syntax_tree_executable *g:ale_ruby_syntax_tree_executable*
*b:ale_ruby_syntax_tree_executable*
Type: String
Default: `'stree'`
Override the invoked SyntaxTree binary. Set this to `'bundle'` to invoke
`'bundle` `exec` stree'.
g:ale_ruby_syntax_tree_options *g:ale_ruby_syntax_tree_options*
*b:ale_ruby_syntax_tree_options*
Type: |String|
Default: `''`
This variable can be changed to modify flags given to SyntaxTree.
=============================================================================== ===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View File

@ -26,10 +26,8 @@ Integration Information
4. analyzer -- If you have rust-analyzer installed, you might prefer using 4. analyzer -- If you have rust-analyzer installed, you might prefer using
this linter over cargo and rls. rust-analyzer also implements the this linter over cargo and rls. rust-analyzer also implements the
Language Server Protocol for incremental compilation of Rust code, and is Language Server Protocol for incremental compilation of Rust code, and is
the next iteration of rls. rust-analyzer either requires Rust files to be the next iteration of rls. rust-analyzer, like rls, requires Rust files
contained in Cargo projects or requires the project to be described in to be contained in Cargo projects.
the rust-project.json format:
https://rust-analyzer.github.io/manual.html#non-cargo-based-projects
5. rustfmt -- If you have `rustfmt` installed, you can use it as a fixer to 5. rustfmt -- If you have `rustfmt` installed, you can use it as a fixer to
consistently reformat your Rust code. consistently reformat your Rust code.

View File

@ -95,8 +95,6 @@ Notes:
* `flawfinder` * `flawfinder`
* `gcc` (`cc`) * `gcc` (`cc`)
* `uncrustify` * `uncrustify`
* Cairo
* `starknet`
* Chef * Chef
* `cookstyle` * `cookstyle`
* `foodcritic`!! * `foodcritic`!!
@ -116,7 +114,6 @@ Notes:
* `ameba`!! * `ameba`!!
* `crystal`!! * `crystal`!!
* CSS * CSS
* `VSCode CSS language server`
* `cspell` * `cspell`
* `csslint` * `csslint`
* `fecs` * `fecs`
@ -241,10 +238,8 @@ Notes:
* `stack-ghc` * `stack-ghc`
* `stylish-haskell` * `stylish-haskell`
* HCL * HCL
* `packer-fmt`
* `terraform-fmt` * `terraform-fmt`
* HTML * HTML
* `VSCode HTML language server`
* `alex` * `alex`
* `angular` * `angular`
* `cspell` * `cspell`
@ -288,7 +283,6 @@ Notes:
* `tsserver` * `tsserver`
* `xo` * `xo`
* JSON * JSON
* `VSCode JSON language server`
* `cspell` * `cspell`
* `dprint` * `dprint`
* `eslint` * `eslint`
@ -333,7 +327,6 @@ Notes:
* `luac` * `luac`
* `luacheck` * `luacheck`
* `luafmt` * `luafmt`
* `selene`
* `stylua` * `stylua`
* Mail * Mail
* `alex` * `alex`
@ -386,7 +379,6 @@ Notes:
* `clangd` * `clangd`
* `uncrustify` * `uncrustify`
* OCaml * OCaml
* `dune`
* `merlin` (see |ale-ocaml-merlin|) * `merlin` (see |ale-ocaml-merlin|)
* `ocamlformat` * `ocamlformat`
* `ocamllsp` * `ocamllsp`
@ -396,10 +388,6 @@ Notes:
* `ibm_validator` * `ibm_validator`
* `prettier` * `prettier`
* `yamllint` * `yamllint`
* OpenSCAD
* `SCA2D`
* Packer
* `packer-fmt-fixer`
* Pascal * Pascal
* `ptop` * `ptop`
* Pawn * Pawn
@ -422,7 +410,6 @@ Notes:
* `phpcs` * `phpcs`
* `phpmd` * `phpmd`
* `phpstan` * `phpstan`
* `pint`
* `psalm`!! * `psalm`!!
* `tlint` * `tlint`
* PO * PO
@ -443,8 +430,6 @@ Notes:
* Prolog * Prolog
* `swipl` * `swipl`
* proto * proto
* `buf-format`!!
* `buf-lint`!!
* `protoc-gen-lint`!! * `protoc-gen-lint`!!
* `protolint`!! * `protolint`!!
* Pug * Pug
@ -472,7 +457,6 @@ Notes:
* `pycodestyle` * `pycodestyle`
* `pydocstyle` * `pydocstyle`
* `pyflakes` * `pyflakes`
* `pyflyby`
* `pylama`!! * `pylama`!!
* `pylint`!! * `pylint`!!
* `pylsp` * `pylsp`
@ -499,10 +483,6 @@ Notes:
* `ols` * `ols`
* `reason-language-server` * `reason-language-server`
* `refmt` * `refmt`
* Rego
* `cspell`
* `opacheck`
* `opafmt`
* reStructuredText * reStructuredText
* `alex` * `alex`
* `cspell` * `cspell`
@ -529,7 +509,6 @@ Notes:
* `solargraph` * `solargraph`
* `sorbet` * `sorbet`
* `standardrb` * `standardrb`
* `syntax_tree`
* Rust * Rust
* `cargo`!! * `cargo`!!
* `cspell` * `cspell`
@ -663,7 +642,6 @@ Notes:
* XML * XML
* `xmllint` * `xmllint`
* YAML * YAML
* `actionlint`
* `circleci`!! * `circleci`!!
* `prettier` * `prettier`
* `spectral` * `spectral`
@ -676,7 +654,6 @@ Notes:
* Zeek * Zeek
* `zeek`!! * `zeek`!!
* Zig * Zig
* `zigfmt`
* `zls` * `zls`
=============================================================================== ===============================================================================

View File

@ -2,51 +2,6 @@
ALE YAML Integration *ale-yaml-options* ALE YAML Integration *ale-yaml-options*
===============================================================================
actionlint *ale-yaml-actionlint*
Website: https://github.com/rhysd/actionlint
Installation
-------------------------------------------------------------------------------
See installation guide: https://github.com/rhysd/actionlint#quick-start
This linter is disabled by default and must be enabled by setting `g:ale_linters`.
To enable it only for Github Action YAML files a configuration like this is
better:
>
au BufRead,BufNewFile */.github/*/*.y{,a}ml
\ let b:ale_linters = {'yaml': ['actionlint']}
<
Options
-------------------------------------------------------------------------------
g:ale_yaml_actionlint_executable *g:ale_yaml_actionlint_executable*
*b:ale_yaml_actionlint_executable*
Type: |String|
Default: `'actionlint'`
This variable can be set to change the path to actionlint.
g:ale_yaml_actionlint_options *g:ale_yaml_actionlint_options*
*b:ale_yaml_actionlint_options*
Type: |String|
Default: `''`
This variable can be set to add extra options to actionlint executable.
For example, to disable running `shellcheck` and `pyflakes` external commands,
you may want to set:
>
let g:ale_yaml_actionlint_options = '-shellcheck= -pyflakes='
<
Please note that passing `-format` as option is not supported at the moment.
=============================================================================== ===============================================================================
circleci *ale-yaml-circleci* circleci *ale-yaml-circleci*

View File

@ -7,18 +7,6 @@ Integration Information
Currently, the only supported linter for zig is zls. Currently, the only supported linter for zig is zls.
===============================================================================
zigfmt *ale-zig-zigfmt*
g:ale_zig_zigfmt_executable *g:ale_zig_zigfmt_executable*
*b:ale_zig_zigfmt_executable*
Type: |String|
Default: `'zig'`
The executable that will be run for the `zig fmt` fixer.
=============================================================================== ===============================================================================
zls *ale-zig-zls* zls *ale-zig-zls*

View File

@ -17,11 +17,10 @@ CONTENTS *ale-contents*
5.1 Completion........................|ale-completion| 5.1 Completion........................|ale-completion|
5.2 Go To Definition..................|ale-go-to-definition| 5.2 Go To Definition..................|ale-go-to-definition|
5.3 Go To Type Definition.............|ale-go-to-type-definition| 5.3 Go To Type Definition.............|ale-go-to-type-definition|
5.4 Go To Implementation..............|ale-go-to-type-implementation| 5.4 Find References...................|ale-find-references|
5.5 Find References...................|ale-find-references| 5.5 Hovering..........................|ale-hover|
5.6 Hovering..........................|ale-hover| 5.6 Symbol Search.....................|ale-symbol-search|
5.7 Symbol Search.....................|ale-symbol-search| 5.7 Refactoring: Rename, Actions......|ale-refactor|
5.8 Refactoring: Rename, Actions......|ale-refactor|
6. Global Options.......................|ale-options| 6. Global Options.......................|ale-options|
6.1 Highlights........................|ale-highlights| 6.1 Highlights........................|ale-highlights|
7. Linter/Fixer Options.................|ale-integration-options| 7. Linter/Fixer Options.................|ale-integration-options|
@ -638,23 +637,14 @@ documentation for the command for configuring how the location will be
displayed. displayed.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
5.4 Go To Implementation *ale-go-to-implementation* 5.4 Find References *ale-find-references*
ALE supports jumping to the files and locations where symbols are implemented
through any enabled LSP linters. The locations ALE will jump to depend on the
information returned by LSP servers. The |ALEGoToImplementation| command will
jump to the implementation of symbols under the cursor. See the documentation
for the command for configuring how the location will be displayed.
-------------------------------------------------------------------------------
5.5 Find References *ale-find-references*
ALE supports finding references for symbols though any enabled LSP linters ALE supports finding references for symbols though any enabled LSP linters
with the |ALEFindReferences| command. See the documentation for the command with the |ALEFindReferences| command. See the documentation for the command
for a full list of options. for a full list of options.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
5.6 Hovering *ale-hover* 5.5 Hovering *ale-hover*
ALE supports "hover" information for printing brief information about symbols ALE supports "hover" information for printing brief information about symbols
at the cursor taken from LSP linters. The following commands are supported: at the cursor taken from LSP linters. The following commands are supported:
@ -676,8 +666,7 @@ Hover information can be displayed in the preview window instead by setting
When using Neovim or Vim with |popupwin|, if |g:ale_hover_to_floating_preview| When using Neovim or Vim with |popupwin|, if |g:ale_hover_to_floating_preview|
or |g:ale_floating_preview| is set to 1, the hover information will show in a or |g:ale_floating_preview| is set to 1, the hover information will show in a
floating window. The borders of the floating preview window can be customized floating window. And |g:ale_floating_window_border| for the border setting.
by setting |g:ale_floating_window_border|.
For Vim 8.1+ terminals, mouse hovering is disabled by default. Enabling For Vim 8.1+ terminals, mouse hovering is disabled by default. Enabling
|balloonexpr| commands in terminals can cause scrolling issues in terminals, |balloonexpr| commands in terminals can cause scrolling issues in terminals,
@ -697,14 +686,14 @@ Documentation for symbols at the cursor can be retrieved using the
|ALEDocumentation| command. This command is only available for `tsserver`. |ALEDocumentation| command. This command is only available for `tsserver`.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
5.7 Symbol Search *ale-symbol-search* 5.6 Symbol Search *ale-symbol-search*
ALE supports searching for workspace symbols via LSP linters with the ALE supports searching for workspace symbols via LSP linters with the
|ALESymbolSearch| command. See the documentation for the command |ALESymbolSearch| command. See the documentation for the command
for a full list of options. for a full list of options.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
5.8 Refactoring: Rename, Actions *ale-refactor* 5.7 Refactoring: Rename, Actions *ale-refactor*
ALE supports renaming symbols in code such as variables or class names with ALE supports renaming symbols in code such as variables or class names with
the |ALERename| command. the |ALERename| command.
@ -1234,45 +1223,17 @@ g:ale_floating_preview *g:ale_floating_preview*
|g:ale_detail_to_floating_preview| to `1`. |g:ale_detail_to_floating_preview| to `1`.
g:ale_floating_preview_popup_opts *g:ale_floating_preview_popup_opts*
Type: |String| or |Dictionary|
Default: `''`
Either a dictionary of options or the string name of a function that returns a
dictionary of options. This will be used as an argument to |popup_create| for
Vim users or |nvim_open_win| for NeoVim users. Note that in either case, the
resulting dictionary is merged with ALE defaults rather than expliciting overriding
them. This only takes effect if |g:ale_floating_preview| is enabled.
NOTE: for Vim users see |popup_create-arguments|, for NeoVim users see
|nvim_open_win| for argument details
For example, to enhance popups with a title: >
function! CustomOpts() abort {
let [l:info, l:loc] = ale#util#FindItemAtCursor(bufnr(''))
return {'title': ' ALE: ' . (l:loc.linter_name) . ' '}
endfunction
<
g:ale_floating_window_border *g:ale_floating_window_border* g:ale_floating_window_border *g:ale_floating_window_border*
Type: |List| Type: |List|
Default: `['|', '-', '+', '+', '+', '+', '|', '-']` Default: `['|', '-', '+', '+', '+', '+']`
When set to `[]`, window borders are disabled. The elements in the list set When set to `[]`, window borders are disabled. The elements in the list set
the the characters for the left side, top, top-left corner, top-right the horizontal, top, top-left, top-right, bottom-right and bottom-left
corner, bottom-right corner, bottom-left corner, right side, and bottom of border characters, respectively.
the floating window, respectively.
If the terminal supports Unicode, you might try setting the value to If the terminal supports Unicode, you might try setting the value to
` ['│', '─', '╭', '╮', '╯', '╰', '│', '─']`, to make it look nicer. ` ['│', '─', '╭', '╮', '╯', '╰']`, to make it look nicer.
NOTE: For compatibility with previous versions, if the list does not have
elements for the right side and bottom, the left side and top will be used
instead.
g:ale_history_enabled *g:ale_history_enabled* g:ale_history_enabled *g:ale_history_enabled*
@ -1495,9 +1456,9 @@ g:ale_linter_aliases *g:ale_linter_aliases*
\ 'ps1': 'powershell', \ 'ps1': 'powershell',
\ 'rmarkdown': 'r', \ 'rmarkdown': 'r',
\ 'rmd': 'r', \ 'rmd': 'r',
\ 'svelte': ['svelte', 'javascript'],
\ 'systemverilog': 'verilog', \ 'systemverilog': 'verilog',
\ 'typescriptreact': ['typescript', 'tsx'], \ 'typescriptreact': ['typescript', 'tsx'],
\ 'vader': ['vim', 'vader'],
\ 'verilog_systemverilog': ['verilog_systemverilog', 'verilog'], \ 'verilog_systemverilog': ['verilog_systemverilog', 'verilog'],
\ 'vimwiki': 'markdown', \ 'vimwiki': 'markdown',
\ 'vue': ['vue', 'javascript'], \ 'vue': ['vue', 'javascript'],
@ -1642,7 +1603,6 @@ g:ale_linters *g:ale_linters*
\ 'help': [], \ 'help': [],
\ 'inko': ['inko'], \ 'inko': ['inko'],
\ 'json': ['jsonlint', 'spectral'], \ 'json': ['jsonlint', 'spectral'],
\ 'json': ['jsonlint', 'spectral', 'vscodejson'],
\ 'json5': [], \ 'json5': [],
\ 'jsonc': [], \ 'jsonc': [],
\ 'perl': ['perlcritic'], \ 'perl': ['perlcritic'],
@ -1651,11 +1611,9 @@ g:ale_linters *g:ale_linters*
\ 'rust': ['cargo', 'rls'], \ 'rust': ['cargo', 'rls'],
\ 'spec': [], \ 'spec': [],
\ 'text': [], \ 'text': [],
\ 'vader': ['vimls'],
\ 'vue': ['eslint', 'vls'], \ 'vue': ['eslint', 'vls'],
\ 'zsh': ['shell'], \ 'zsh': ['shell'],
\ 'v': ['v'], \ 'v': ['v'],
\ 'yaml': ['spectral', 'yaml-language-server', 'yamllint'],
\} \}
< <
This option can be used to enable only a particular set of linters for a This option can be used to enable only a particular set of linters for a
@ -2135,7 +2093,6 @@ g:ale_sign_priority *g:ale_sign_priority*
g:ale_shell *g:ale_shell* g:ale_shell *g:ale_shell*
*b:ale_shell*
Type: |String| Type: |String|
Default: not set Default: not set
@ -2153,7 +2110,6 @@ g:ale_shell *g:ale_shell*
g:ale_shell_arguments *g:ale_shell_arguments* g:ale_shell_arguments *g:ale_shell_arguments*
*b:ale_shell_arguments*
Type: |String| Type: |String|
Default: not set Default: not set
@ -2798,8 +2754,6 @@ documented in additional help files.
cspell................................|ale-c-cspell| cspell................................|ale-c-cspell|
flawfinder............................|ale-c-flawfinder| flawfinder............................|ale-c-flawfinder|
uncrustify............................|ale-c-uncrustify| uncrustify............................|ale-c-uncrustify|
cairo...................................|ale-cairo-options|
starknet..............................|ale-cairo-starknet|
chef....................................|ale-chef-options| chef....................................|ale-chef-options|
cookstyle.............................|ale-chef-cookstyle| cookstyle.............................|ale-chef-cookstyle|
foodcritic............................|ale-chef-foodcritic| foodcritic............................|ale-chef-foodcritic|
@ -2839,7 +2793,6 @@ documented in additional help files.
fecs..................................|ale-css-fecs| fecs..................................|ale-css-fecs|
prettier..............................|ale-css-prettier| prettier..............................|ale-css-prettier|
stylelint.............................|ale-css-stylelint| stylelint.............................|ale-css-stylelint|
vscodecss.............................|ale-css-vscode|
cuda....................................|ale-cuda-options| cuda....................................|ale-cuda-options|
nvcc..................................|ale-cuda-nvcc| nvcc..................................|ale-cuda-nvcc|
clangd................................|ale-cuda-clangd| clangd................................|ale-cuda-clangd|
@ -2942,7 +2895,6 @@ documented in additional help files.
hie...................................|ale-haskell-hie| hie...................................|ale-haskell-hie|
ormolu................................|ale-haskell-ormolu| ormolu................................|ale-haskell-ormolu|
hcl.....................................|ale-hcl-options| hcl.....................................|ale-hcl-options|
packer-fmt............................|ale-hcl-packer-fmt|
terraform-fmt.........................|ale-hcl-terraform-fmt| terraform-fmt.........................|ale-hcl-terraform-fmt|
help....................................|ale-help-options| help....................................|ale-help-options|
cspell................................|ale-help-cspell| cspell................................|ale-help-cspell|
@ -2955,7 +2907,6 @@ documented in additional help files.
prettier..............................|ale-html-prettier| prettier..............................|ale-html-prettier|
stylelint.............................|ale-html-stylelint| stylelint.............................|ale-html-stylelint|
tidy..................................|ale-html-tidy| tidy..................................|ale-html-tidy|
vscodehtml............................|ale-html-vscode|
write-good............................|ale-html-write-good| write-good............................|ale-html-write-good|
idris...................................|ale-idris-options| idris...................................|ale-idris-options|
idris.................................|ale-idris-idris| idris.................................|ale-idris-idris|
@ -2998,7 +2949,6 @@ documented in additional help files.
jq....................................|ale-json-jq| jq....................................|ale-json-jq|
prettier..............................|ale-json-prettier| prettier..............................|ale-json-prettier|
spectral..............................|ale-json-spectral| spectral..............................|ale-json-spectral|
vscodejson............................|ale-json-vscode|
jsonc...................................|ale-jsonc-options| jsonc...................................|ale-jsonc-options|
eslint................................|ale-jsonc-eslint| eslint................................|ale-jsonc-eslint|
jsonnet.................................|ale-jsonnet-options| jsonnet.................................|ale-jsonnet-options|
@ -3028,7 +2978,6 @@ documented in additional help files.
luac..................................|ale-lua-luac| luac..................................|ale-lua-luac|
luacheck..............................|ale-lua-luacheck| luacheck..............................|ale-lua-luacheck|
luafmt................................|ale-lua-luafmt| luafmt................................|ale-lua-luafmt|
selene................................|ale-lua-selene|
stylua................................|ale-lua-stylua| stylua................................|ale-lua-stylua|
markdown................................|ale-markdown-options| markdown................................|ale-markdown-options|
cspell................................|ale-markdown-cspell| cspell................................|ale-markdown-cspell|
@ -3064,7 +3013,6 @@ documented in additional help files.
clangd................................|ale-objcpp-clangd| clangd................................|ale-objcpp-clangd|
uncrustify............................|ale-objcpp-uncrustify| uncrustify............................|ale-objcpp-uncrustify|
ocaml...................................|ale-ocaml-options| ocaml...................................|ale-ocaml-options|
dune..................................|ale-ocaml-dune|
merlin................................|ale-ocaml-merlin| merlin................................|ale-ocaml-merlin|
ocamllsp..............................|ale-ocaml-ocamllsp| ocamllsp..............................|ale-ocaml-ocamllsp|
ols...................................|ale-ocaml-ols| ols...................................|ale-ocaml-ols|
@ -3074,10 +3022,6 @@ documented in additional help files.
ibm_validator.........................|ale-openapi-ibm-validator| ibm_validator.........................|ale-openapi-ibm-validator|
prettier..............................|ale-openapi-prettier| prettier..............................|ale-openapi-prettier|
yamllint..............................|ale-openapi-yamllint| yamllint..............................|ale-openapi-yamllint|
openscad................................|ale-openscad-options|
sca2d.................................|ale-openscad-sca2d|
packer..................................|ale-packer-options|
packer-fmt-fixer......................|ale-packer-fmt-fixer|
pascal..................................|ale-pascal-options| pascal..................................|ale-pascal-options|
ptop..................................|ale-pascal-ptop| ptop..................................|ale-pascal-ptop|
pawn....................................|ale-pawn-options| pawn....................................|ale-pawn-options|
@ -3099,7 +3043,6 @@ documented in additional help files.
psalm.................................|ale-php-psalm| psalm.................................|ale-php-psalm|
php-cs-fixer..........................|ale-php-php-cs-fixer| php-cs-fixer..........................|ale-php-php-cs-fixer|
php...................................|ale-php-php| php...................................|ale-php-php|
pint..................................|ale-php-pint|
tlint.................................|ale-php-tlint| tlint.................................|ale-php-tlint|
intelephense..........................|ale-php-intelephense| intelephense..........................|ale-php-intelephense|
po......................................|ale-po-options| po......................................|ale-po-options|
@ -3115,8 +3058,6 @@ documented in additional help files.
prolog..................................|ale-prolog-options| prolog..................................|ale-prolog-options|
swipl.................................|ale-prolog-swipl| swipl.................................|ale-prolog-swipl|
proto...................................|ale-proto-options| proto...................................|ale-proto-options|
buf-format............................|ale-proto-buf-format|
buf-lint..............................|ale-proto-buf-lint|
protoc-gen-lint.......................|ale-proto-protoc-gen-lint| protoc-gen-lint.......................|ale-proto-protoc-gen-lint|
protolint.............................|ale-proto-protolint| protolint.............................|ale-proto-protolint|
pug.....................................|ale-pug-options| pug.....................................|ale-pug-options|
@ -3146,7 +3087,6 @@ documented in additional help files.
pycodestyle...........................|ale-python-pycodestyle| pycodestyle...........................|ale-python-pycodestyle|
pydocstyle............................|ale-python-pydocstyle| pydocstyle............................|ale-python-pydocstyle|
pyflakes..............................|ale-python-pyflakes| pyflakes..............................|ale-python-pyflakes|
pyflyby...............................|ale-python-pyflyby|
pylama................................|ale-python-pylama| pylama................................|ale-python-pylama|
pylint................................|ale-python-pylint| pylint................................|ale-python-pylint|
pylsp.................................|ale-python-pylsp| pylsp.................................|ale-python-pylsp|
@ -3167,10 +3107,6 @@ documented in additional help files.
ols...................................|ale-reasonml-ols| ols...................................|ale-reasonml-ols|
reason-language-server................|ale-reasonml-language-server| reason-language-server................|ale-reasonml-language-server|
refmt.................................|ale-reasonml-refmt| refmt.................................|ale-reasonml-refmt|
rego....................................|ale-rego-options|
cspell................................|ale-rego-cspell|
opacheck..............................|ale-rego-opa-check|
opafmt................................|ale-rego-opa-fmt-fixer|
restructuredtext........................|ale-restructuredtext-options| restructuredtext........................|ale-restructuredtext-options|
cspell................................|ale-restructuredtext-cspell| cspell................................|ale-restructuredtext-cspell|
textlint..............................|ale-restructuredtext-textlint| textlint..............................|ale-restructuredtext-textlint|
@ -3190,7 +3126,6 @@ documented in additional help files.
solargraph............................|ale-ruby-solargraph| solargraph............................|ale-ruby-solargraph|
sorbet................................|ale-ruby-sorbet| sorbet................................|ale-ruby-sorbet|
standardrb............................|ale-ruby-standardrb| standardrb............................|ale-ruby-standardrb|
syntax_tree...........................|ale-ruby-syntax_tree|
rust....................................|ale-rust-options| rust....................................|ale-rust-options|
analyzer..............................|ale-rust-analyzer| analyzer..............................|ale-rust-analyzer|
cargo.................................|ale-rust-cargo| cargo.................................|ale-rust-cargo|
@ -3318,7 +3253,6 @@ documented in additional help files.
xml.....................................|ale-xml-options| xml.....................................|ale-xml-options|
xmllint...............................|ale-xml-xmllint| xmllint...............................|ale-xml-xmllint|
yaml....................................|ale-yaml-options| yaml....................................|ale-yaml-options|
actionlint............................|ale-yaml-actionlint|
circleci..............................|ale-yaml-circleci| circleci..............................|ale-yaml-circleci|
prettier..............................|ale-yaml-prettier| prettier..............................|ale-yaml-prettier|
spectral..............................|ale-yaml-spectral| spectral..............................|ale-yaml-spectral|
@ -3331,7 +3265,6 @@ documented in additional help files.
zeek....................................|ale-zeek-options| zeek....................................|ale-zeek-options|
zeek..................................|ale-zeek-zeek| zeek..................................|ale-zeek-zeek|
zig.....................................|ale-zig-options| zig.....................................|ale-zig-options|
zigfmt................................|ale-zig-zigfmt|
zls...................................|ale-zig-zls| zls...................................|ale-zig-zls|
@ -3472,33 +3405,6 @@ ALEGoToTypeDefinition *ALEGoToTypeDefinition*
`<Plug>(ale_go_to_type_definition_in_vsplit)` - `:ALEGoToTypeDefinition -vsplit` `<Plug>(ale_go_to_type_definition_in_vsplit)` - `:ALEGoToTypeDefinition -vsplit`
ALEGoToImplementation *ALEGoToImplementation*
This works similar to |ALEGoToDefinition| but instead jumps to the
implementation of symbol under the cursor. ALE will jump to a definition if
an LSP server provides a location to jump to. Otherwise, ALE will do nothing.
The locations opened in different ways using the following variations.
`:ALEGoToImplementation -tab` - Open the location in a new tab.
`:ALEGoToImplementation -split` - Open the location in a horizontal split.
`:ALEGoToImplementation -vsplit` - Open the location in a vertical split.
The default method used for navigating to a new location can be changed
by modifying |g:ale_default_navigation|.
You can jump back to the position you were at before going to the definition
of something with jump motions like CTRL-O. See |jump-motions|.
The following Plug mappings are defined for this command, which correspond
to the following commands.
`<Plug>(ale_go_to_implementation)` - `:ALEGoToImplementation`
`<Plug>(ale_go_to_implementation_in_tab)` - `:ALEGoToImplementation -tab`
`<Plug>(ale_go_to_implementation_in_split)` - `:ALEGoToImplementation -split`
`<Plug>(ale_go_to_implementation_in_vsplit)` - `:ALEGoToImplementation -vsplit`
ALEHover *ALEHover* ALEHover *ALEHover*
Print brief information about the symbol under the cursor, taken from any Print brief information about the symbol under the cursor, taken from any

View File

@ -24,10 +24,8 @@ endif
if !s:has_features if !s:has_features
" Only output a warning if editing some special files. " Only output a warning if editing some special files.
if index(['', 'gitcommit'], &filetype) == -1 if index(['', 'gitcommit'], &filetype) == -1
" no-custom-checks execute 'echoerr ''ALE requires NeoVim >= 0.2.0 or Vim 8 with +timers +job +channel'''
echoerr 'ALE requires NeoVim >= 0.2.0 or Vim 8 with +timers +job +channel' execute 'echoerr ''Please update your editor appropriately.'''
" no-custom-checks
echoerr 'Please update your editor appropriately.'
endif endif
" Stop here, as it won't work. " Stop here, as it won't work.
@ -152,11 +150,10 @@ let g:ale_hover_to_floating_preview = get(g:, 'ale_hover_to_floating_preview', 0
" Detail uses floating windows in Neovim " Detail uses floating windows in Neovim
let g:ale_detail_to_floating_preview = get(g:, 'ale_detail_to_floating_preview', 0) let g:ale_detail_to_floating_preview = get(g:, 'ale_detail_to_floating_preview', 0)
" Border setting for floating preview windows " Border setting for floating preview windows in Neovim
" The elements in the list set the characters for the left, top, top-left, " The element in the list presents - horizontal, top, top-left, top-right,
" top-right, bottom-right, bottom-left, right, and bottom of the border " bottom-right and bottom-left
" respectively let g:ale_floating_window_border = get(g:, 'ale_floating_window_border', ['|', '-', '+', '+', '+', '+'])
let g:ale_floating_window_border = get(g:, 'ale_floating_window_border', ['|', '-', '+', '+', '+', '+', '|', '-'])
" This flag can be set to 0 to disable warnings for trailing whitespace " This flag can be set to 0 to disable warnings for trailing whitespace
let g:ale_warn_about_trailing_whitespace = get(g:, 'ale_warn_about_trailing_whitespace', 1) let g:ale_warn_about_trailing_whitespace = get(g:, 'ale_warn_about_trailing_whitespace', 1)
@ -253,9 +250,6 @@ command! -bar -nargs=* ALEGoToDefinition :call ale#definition#GoToCommandHandler
" Go to type definition for tsserver and LSP " Go to type definition for tsserver and LSP
command! -bar -nargs=* ALEGoToTypeDefinition :call ale#definition#GoToCommandHandler('type', <f-args>) command! -bar -nargs=* ALEGoToTypeDefinition :call ale#definition#GoToCommandHandler('type', <f-args>)
" Go to implementation for tsserver and LSP
command! -bar -nargs=* ALEGoToImplementation :call ale#definition#GoToCommandHandler('implementation', <f-args>)
" Repeat a previous selection in the preview window " Repeat a previous selection in the preview window
command! -bar ALERepeatSelection :call ale#preview#RepeatSelection() command! -bar ALERepeatSelection :call ale#preview#RepeatSelection()
@ -323,9 +317,6 @@ nnoremap <silent> <Plug>(ale_go_to_type_definition) :ALEGoToTypeDefinition<Retur
nnoremap <silent> <Plug>(ale_go_to_type_definition_in_tab) :ALEGoToTypeDefinition -tab<Return> nnoremap <silent> <Plug>(ale_go_to_type_definition_in_tab) :ALEGoToTypeDefinition -tab<Return>
nnoremap <silent> <Plug>(ale_go_to_type_definition_in_split) :ALEGoToTypeDefinition -split<Return> nnoremap <silent> <Plug>(ale_go_to_type_definition_in_split) :ALEGoToTypeDefinition -split<Return>
nnoremap <silent> <Plug>(ale_go_to_type_definition_in_vsplit) :ALEGoToTypeDefinitionIn -vsplit<Return> nnoremap <silent> <Plug>(ale_go_to_type_definition_in_vsplit) :ALEGoToTypeDefinitionIn -vsplit<Return>
nnoremap <silent> <Plug>(ale_go_to_implementation_in_tab) :ALEGoToImplementation -tab<Return>
nnoremap <silent> <Plug>(ale_go_to_implementation_in_split) :ALEGoToImplementation -split<Return>
nnoremap <silent> <Plug>(ale_go_to_implementation_in_vsplit) :ALEGoToImplementation -vsplit<Return>
nnoremap <silent> <Plug>(ale_find_references) :ALEFindReferences<Return> nnoremap <silent> <Plug>(ale_find_references) :ALEFindReferences<Return>
nnoremap <silent> <Plug>(ale_hover) :ALEHover<Return> nnoremap <silent> <Plug>(ale_hover) :ALEHover<Return>
nnoremap <silent> <Plug>(ale_documentation) :ALEDocumentation<Return> nnoremap <silent> <Plug>(ale_documentation) :ALEDocumentation<Return>

View File

@ -32,7 +32,6 @@ class Source(Base):
'rust': r'(\.|::)\w*$', 'rust': r'(\.|::)\w*$',
'typescript': r'(\.|\'|")\w*$', 'typescript': r'(\.|\'|")\w*$',
'cpp': r'(\.|::|->)\w*$', 'cpp': r'(\.|::|->)\w*$',
'c': r'(\.|->)\w*$',
} }
# Returns an integer for the start position, as with omnifunc. # Returns an integer for the start position, as with omnifunc.

View File

@ -25,7 +25,8 @@ tests='test/*.vader test/*/*.vader test/*/*/*.vader test/*/*/*.vader'
verbose_flag='' verbose_flag=''
quiet_flag='' quiet_flag=''
run_neovim_02_tests=1 run_neovim_02_tests=1
run_neovim_07_tests=1 run_neovim_04_tests=1
run_neovim_05_tests=1
run_vim_80_tests=1 run_vim_80_tests=1
run_vim_82_tests=1 run_vim_82_tests=1
run_linters=1 run_linters=1
@ -44,7 +45,8 @@ while [ $# -ne 0 ]; do
run_vim_80_tests=0 run_vim_80_tests=0
run_vim_82_tests=0 run_vim_82_tests=0
run_neovim_02_tests=0 run_neovim_02_tests=0
run_neovim_07_tests=0 run_neovim_04_tests=0
run_neovim_05_tests=0
run_linters=0 run_linters=0
shift shift
;; ;;
@ -55,14 +57,24 @@ while [ $# -ne 0 ]; do
shift shift
;; ;;
--neovim-02-only) --neovim-02-only)
run_neovim_07_tests=0 run_neovim_04_tests=0
run_neovim_05_tests=0
run_vim_80_tests=0 run_vim_80_tests=0
run_vim_82_tests=0 run_vim_82_tests=0
run_linters=0 run_linters=0
shift shift
;; ;;
--neovim-07-only) --neovim-04-only)
run_neovim_02_tests=0 run_neovim_02_tests=0
run_neovim_05_tests=0
run_vim_80_tests=0
run_vim_82_tests=0
run_linters=0
shift
;;
--neovim-05-only)
run_neovim_02_tests=0
run_neovim_04_tests=0
run_vim_80_tests=0 run_vim_80_tests=0
run_vim_82_tests=0 run_vim_82_tests=0
run_linters=0 run_linters=0
@ -70,20 +82,23 @@ while [ $# -ne 0 ]; do
;; ;;
--vim-only) --vim-only)
run_neovim_02_tests=0 run_neovim_02_tests=0
run_neovim_07_tests=0 run_neovim_04_tests=0
run_neovim_05_tests=0
run_linters=0 run_linters=0
shift shift
;; ;;
--vim-80-only) --vim-80-only)
run_neovim_02_tests=0 run_neovim_02_tests=0
run_neovim_07_tests=0 run_neovim_04_tests=0
run_neovim_05_tests=0
run_vim_82_tests=0 run_vim_82_tests=0
run_linters=0 run_linters=0
shift shift
;; ;;
--vim-82-only) --vim-82-only)
run_neovim_02_tests=0 run_neovim_02_tests=0
run_neovim_07_tests=0 run_neovim_04_tests=0
run_neovim_05_tests=0
run_vim_80_tests=0 run_vim_80_tests=0
run_linters=0 run_linters=0
shift shift
@ -92,14 +107,16 @@ while [ $# -ne 0 ]; do
run_vim_80_tests=0 run_vim_80_tests=0
run_vim_82_tests=0 run_vim_82_tests=0
run_neovim_02_tests=0 run_neovim_02_tests=0
run_neovim_07_tests=0 run_neovim_04_tests=0
run_neovim_05_tests=0
shift shift
;; ;;
--fast) --fast)
run_vim_80_tests=0 run_vim_80_tests=0
run_vim_82_tests=0 run_vim_82_tests=0
run_neovim_02_tests=0 run_neovim_02_tests=0
run_neovim_07_tests=1 run_neovim_04_tests=0
run_neovim_05_tests=1
shift shift
;; ;;
--help) --help)
@ -114,7 +131,8 @@ while [ $# -ne 0 ]; do
echo ' --build-image Run docker image build only.' echo ' --build-image Run docker image build only.'
echo ' --neovim-only Run tests only for NeoVim' echo ' --neovim-only Run tests only for NeoVim'
echo ' --neovim-02-only Run tests only for NeoVim 0.2' echo ' --neovim-02-only Run tests only for NeoVim 0.2'
echo ' --neovim-07-only Run tests only for NeoVim 0.7' echo ' --neovim-04-only Run tests only for NeoVim 0.4'
echo ' --neovim-05-only Run tests only for NeoVim 0.5'
echo ' --vim-only Run tests only for Vim' echo ' --vim-only Run tests only for Vim'
echo ' --vim-80-only Run tests only for Vim 8.0' echo ' --vim-80-only Run tests only for Vim 8.0'
echo ' --vim-82-only Run tests only for Vim 8.2' echo ' --vim-82-only Run tests only for Vim 8.2'
@ -220,7 +238,8 @@ for vim in $(docker run --rm "$DOCKER_RUN_IMAGE" ls /vim-build/bin | grep '^neov
if ( [[ $vim =~ ^vim-v8.0 ]] && ((run_vim_80_tests)) ) \ if ( [[ $vim =~ ^vim-v8.0 ]] && ((run_vim_80_tests)) ) \
|| ( [[ $vim =~ ^vim-v8.2 ]] && ((run_vim_82_tests)) ) \ || ( [[ $vim =~ ^vim-v8.2 ]] && ((run_vim_82_tests)) ) \
|| ( [[ $vim =~ ^neovim-v0.2 ]] && ((run_neovim_02_tests)) ) \ || ( [[ $vim =~ ^neovim-v0.2 ]] && ((run_neovim_02_tests)) ) \
|| ( [[ $vim =~ ^neovim-v0.7 ]] && ((run_neovim_07_tests)) ); then || ( [[ $vim =~ ^neovim-v0.4 ]] && ((run_neovim_04_tests)) ) \
|| ( [[ $vim =~ ^neovim-v0.5 ]] && ((run_neovim_05_tests)) ); then
echo "Starting Vim: $vim..." echo "Starting Vim: $vim..."
file_number=$((file_number+1)) file_number=$((file_number+1))
test/script/run-vader-tests $quiet_flag $verbose_flag "$vim" "$tests" \ test/script/run-vader-tests $quiet_flag $verbose_flag "$vim" "$tests" \

View File

@ -75,7 +75,7 @@ formatting.
* [clangd](https://clang.llvm.org/extra/clangd.html) * [clangd](https://clang.llvm.org/extra/clangd.html)
* [clangtidy](http://clang.llvm.org/extra/clang-tidy/) :floppy_disk: * [clangtidy](http://clang.llvm.org/extra/clang-tidy/) :floppy_disk:
* [cppcheck](http://cppcheck.sourceforge.net) * [cppcheck](http://cppcheck.sourceforge.net)
* [cpplint](https://github.com/cpplint/cpplint) * [cpplint](https://github.com/google/styleguide/tree/gh-pages/cpplint)
* [cquery](https://github.com/cquery-project/cquery) * [cquery](https://github.com/cquery-project/cquery)
* [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell) * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
* [flawfinder](https://www.dwheeler.com/flawfinder/) * [flawfinder](https://www.dwheeler.com/flawfinder/)
@ -104,8 +104,6 @@ formatting.
* [flawfinder](https://www.dwheeler.com/flawfinder/) * [flawfinder](https://www.dwheeler.com/flawfinder/)
* [gcc](https://gcc.gnu.org/) * [gcc](https://gcc.gnu.org/)
* [uncrustify](https://github.com/uncrustify/uncrustify) * [uncrustify](https://github.com/uncrustify/uncrustify)
* Cairo
* [starknet](https://starknet.io/docs)
* Chef * Chef
* [cookstyle](https://docs.chef.io/cookstyle.html) * [cookstyle](https://docs.chef.io/cookstyle.html)
* [foodcritic](http://www.foodcritic.io/) :floppy_disk: * [foodcritic](http://www.foodcritic.io/) :floppy_disk:
@ -125,7 +123,6 @@ formatting.
* [ameba](https://github.com/veelenga/ameba) :floppy_disk: * [ameba](https://github.com/veelenga/ameba) :floppy_disk:
* [crystal](https://crystal-lang.org/) :floppy_disk: * [crystal](https://crystal-lang.org/) :floppy_disk:
* CSS * CSS
* [VSCode CSS language server](https://github.com/hrsh7th/vscode-langservers-extracted)
* [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell) * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
* [csslint](http://csslint.net/) * [csslint](http://csslint.net/)
* [fecs](http://fecs.baidu.com/) * [fecs](http://fecs.baidu.com/)
@ -250,10 +247,8 @@ formatting.
* [stack-ghc](https://haskellstack.org/) * [stack-ghc](https://haskellstack.org/)
* [stylish-haskell](https://github.com/jaspervdj/stylish-haskell) * [stylish-haskell](https://github.com/jaspervdj/stylish-haskell)
* HCL * HCL
* [packer-fmt](https://github.com/hashicorp/packer)
* [terraform-fmt](https://github.com/hashicorp/terraform) * [terraform-fmt](https://github.com/hashicorp/terraform)
* HTML * HTML
* [VSCode HTML language server](https://github.com/hrsh7th/vscode-langservers-extracted)
* [alex](https://github.com/get-alex/alex) * [alex](https://github.com/get-alex/alex)
* [angular](https://www.npmjs.com/package/@angular/language-server) * [angular](https://www.npmjs.com/package/@angular/language-server)
* [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell) * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
@ -297,7 +292,6 @@ formatting.
* [tsserver](https://github.com/Microsoft/TypeScript/wiki/Standalone-Server-%28tsserver%29) * [tsserver](https://github.com/Microsoft/TypeScript/wiki/Standalone-Server-%28tsserver%29)
* [xo](https://github.com/sindresorhus/xo) * [xo](https://github.com/sindresorhus/xo)
* JSON * JSON
* [VSCode JSON language server](https://github.com/hrsh7th/vscode-langservers-extracted)
* [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell) :warning: * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell) :warning:
* [dprint](https://dprint.dev) * [dprint](https://dprint.dev)
* [eslint](http://eslint.org/) :warning: * [eslint](http://eslint.org/) :warning:
@ -342,7 +336,6 @@ formatting.
* [luac](https://www.lua.org/manual/5.1/luac.html) * [luac](https://www.lua.org/manual/5.1/luac.html)
* [luacheck](https://github.com/mpeterv/luacheck) * [luacheck](https://github.com/mpeterv/luacheck)
* [luafmt](https://github.com/trixnz/lua-fmt) * [luafmt](https://github.com/trixnz/lua-fmt)
* [selene](https://github.com/Kampfkarren/selene)
* [stylua](https://github.com/johnnymorganz/stylua) * [stylua](https://github.com/johnnymorganz/stylua)
* Mail * Mail
* [alex](https://github.com/get-alex/alex) * [alex](https://github.com/get-alex/alex)
@ -395,7 +388,6 @@ formatting.
* [clangd](https://clang.llvm.org/extra/clangd.html) * [clangd](https://clang.llvm.org/extra/clangd.html)
* [uncrustify](https://github.com/uncrustify/uncrustify) * [uncrustify](https://github.com/uncrustify/uncrustify)
* OCaml * OCaml
* [dune](https://dune.build/)
* [merlin](https://github.com/the-lambda-church/merlin) see `:help ale-ocaml-merlin` for configuration instructions * [merlin](https://github.com/the-lambda-church/merlin) see `:help ale-ocaml-merlin` for configuration instructions
* [ocamlformat](https://github.com/ocaml-ppx/ocamlformat) * [ocamlformat](https://github.com/ocaml-ppx/ocamlformat)
* [ocamllsp](https://github.com/ocaml/ocaml-lsp) * [ocamllsp](https://github.com/ocaml/ocaml-lsp)
@ -405,10 +397,6 @@ formatting.
* [ibm_validator](https://github.com/IBM/openapi-validator) * [ibm_validator](https://github.com/IBM/openapi-validator)
* [prettier](https://github.com/prettier/prettier) * [prettier](https://github.com/prettier/prettier)
* [yamllint](https://yamllint.readthedocs.io/) * [yamllint](https://yamllint.readthedocs.io/)
* OpenSCAD
* [SCA2D](https://gitlab.com/bath_open_instrumentation_group/sca2d) :floppy_disk:
* Packer (HCL)
* [packer-fmt-fixer](https://github.com/hashicorp/packer)
* Pascal * Pascal
* [ptop](https://www.freepascal.org/tools/ptop.var) * [ptop](https://www.freepascal.org/tools/ptop.var)
* Pawn * Pawn
@ -425,13 +413,12 @@ formatting.
* [langserver](https://github.com/felixfbecker/php-language-server) * [langserver](https://github.com/felixfbecker/php-language-server)
* [phan](https://github.com/phan/phan) see `:help ale-php-phan` to instructions * [phan](https://github.com/phan/phan) see `:help ale-php-phan` to instructions
* [php -l](https://secure.php.net/) * [php -l](https://secure.php.net/)
* [php-cs-fixer](https://cs.symfony.com) * [php-cs-fixer](http://cs.sensiolabs.org/)
* [phpactor](https://github.com/phpactor/phpactor) * [phpactor](https://github.com/phpactor/phpactor)
* [phpcbf](https://github.com/squizlabs/PHP_CodeSniffer) * [phpcbf](https://github.com/squizlabs/PHP_CodeSniffer)
* [phpcs](https://github.com/squizlabs/PHP_CodeSniffer) * [phpcs](https://github.com/squizlabs/PHP_CodeSniffer)
* [phpmd](https://phpmd.org) * [phpmd](https://phpmd.org)
* [phpstan](https://github.com/phpstan/phpstan) * [phpstan](https://github.com/phpstan/phpstan)
* [pint](https://github.com/laravel/pint) :beer:
* [psalm](https://getpsalm.org) :floppy_disk: * [psalm](https://getpsalm.org) :floppy_disk:
* [tlint](https://github.com/tightenco/tlint) * [tlint](https://github.com/tightenco/tlint)
* PO * PO
@ -452,8 +439,6 @@ formatting.
* Prolog * Prolog
* [swipl](https://github.com/SWI-Prolog/swipl-devel) * [swipl](https://github.com/SWI-Prolog/swipl-devel)
* proto * proto
* [buf-format](https://github.com/bufbuild/buf) :floppy_disk:
* [buf-lint](https://github.com/bufbuild/buf) :floppy_disk:
* [protoc-gen-lint](https://github.com/ckaznocha/protoc-gen-lint) :floppy_disk: * [protoc-gen-lint](https://github.com/ckaznocha/protoc-gen-lint) :floppy_disk:
* [protolint](https://github.com/yoheimuta/protolint) :floppy_disk: * [protolint](https://github.com/yoheimuta/protolint) :floppy_disk:
* Pug * Pug
@ -481,7 +466,6 @@ formatting.
* [pycodestyle](https://github.com/PyCQA/pycodestyle) :warning: * [pycodestyle](https://github.com/PyCQA/pycodestyle) :warning:
* [pydocstyle](https://www.pydocstyle.org/) :warning: * [pydocstyle](https://www.pydocstyle.org/) :warning:
* [pyflakes](https://github.com/PyCQA/pyflakes) * [pyflakes](https://github.com/PyCQA/pyflakes)
* [pyflyby](https://github.com/deshaw/pyflyby) :warning:
* [pylama](https://github.com/klen/pylama) :floppy_disk: * [pylama](https://github.com/klen/pylama) :floppy_disk:
* [pylint](https://www.pylint.org/) :floppy_disk: * [pylint](https://www.pylint.org/) :floppy_disk:
* [pylsp](https://github.com/python-lsp/python-lsp-server) :warning: * [pylsp](https://github.com/python-lsp/python-lsp-server) :warning:
@ -508,10 +492,6 @@ formatting.
* [ols](https://github.com/freebroccolo/ocaml-language-server) * [ols](https://github.com/freebroccolo/ocaml-language-server)
* [reason-language-server](https://github.com/jaredly/reason-language-server) * [reason-language-server](https://github.com/jaredly/reason-language-server)
* [refmt](https://github.com/reasonml/reason-cli) * [refmt](https://github.com/reasonml/reason-cli)
* Rego
* [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
* [opacheck](https://www.openpolicyagent.org/docs/latest/cli/#opa-check)
* [opafmt](https://www.openpolicyagent.org/docs/latest/cli/#opa-fmt)
* reStructuredText * reStructuredText
* [alex](https://github.com/get-alex/alex) * [alex](https://github.com/get-alex/alex)
* [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell) * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
@ -538,7 +518,6 @@ formatting.
* [solargraph](https://solargraph.org) * [solargraph](https://solargraph.org)
* [sorbet](https://github.com/sorbet/sorbet) * [sorbet](https://github.com/sorbet/sorbet)
* [standardrb](https://github.com/testdouble/standard) * [standardrb](https://github.com/testdouble/standard)
* [syntax_tree](https://github.com/ruby-syntax-tree/syntax_tree)
* Rust * Rust
* [cargo](https://github.com/rust-lang/cargo) :floppy_disk: (see `:help ale-integration-rust` for configuration instructions) * [cargo](https://github.com/rust-lang/cargo) :floppy_disk: (see `:help ale-integration-rust` for configuration instructions)
* [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell) * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
@ -672,11 +651,10 @@ formatting.
* XML * XML
* [xmllint](http://xmlsoft.org/xmllint.html) * [xmllint](http://xmlsoft.org/xmllint.html)
* YAML * YAML
* [actionlint](https://github.com/rhysd/actionlint) :warning: * [circleci](https://circleci.com/docs/2.0/local-cli) :floppy_disk:
* [circleci](https://circleci.com/docs/2.0/local-cli) :floppy_disk: :warning:
* [prettier](https://github.com/prettier/prettier) * [prettier](https://github.com/prettier/prettier)
* [spectral](https://github.com/stoplightio/spectral) * [spectral](https://github.com/stoplightio/spectral)
* [swaglint](https://github.com/byCedric/swaglint) :warning: * [swaglint](https://github.com/byCedric/swaglint)
* [yaml-language-server](https://github.com/redhat-developer/yaml-language-server) * [yaml-language-server](https://github.com/redhat-developer/yaml-language-server)
* [yamlfix](https://lyz-code.github.io/yamlfix) * [yamlfix](https://lyz-code.github.io/yamlfix)
* [yamllint](https://yamllint.readthedocs.io/) * [yamllint](https://yamllint.readthedocs.io/)
@ -685,5 +663,4 @@ formatting.
* Zeek * Zeek
* [zeek](http://zeek.org) :floppy_disk: * [zeek](http://zeek.org) :floppy_disk:
* Zig * Zig
* [zigfmt](https://github.com/ziglang/zig)
* [zls](https://github.com/zigtools/zls) * [zls](https://github.com/zigtools/zls)

View File

@ -528,38 +528,6 @@ Execute(Should handle completion messages with textEdit objects):
\ }, \ },
\ }) \ })
Execute(Should handle completion messages with textEdit objects and no insertTextFormat key):
let g:ale_completion_autoimport = 0
AssertEqual
\ [
\ {'word': 'next_callback', 'dup': 0, 'menu': 'PlayTimeCallback', 'info': '', 'kind': 'v', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
\ ],
\ ale#completion#ParseLSPCompletions({
\ 'id': 226,
\ 'jsonrpc': '2.0',
\ 'result': {
\ 'isIncomplete': v:false,
\ 'items': [
\ {
\ 'detail': 'PlayTimeCallback',
\ 'filterText': 'next_callback',
\ 'insertText': 'ignoreme',
\ 'kind': 6,
\ 'label': ' next_callback',
\ 'sortText': '3ee19999next_callback',
\ 'textEdit': {
\ 'newText': 'next_callback',
\ 'range': {
\ 'end': {'character': 13, 'line': 12},
\ 'start': {'character': 4, 'line': 12},
\ },
\ },
\ },
\ ],
\ },
\ })
Execute(Should handle completion messages with the deprecated insertText attribute): Execute(Should handle completion messages with the deprecated insertText attribute):
let g:ale_completion_autoimport = 0 let g:ale_completion_autoimport = 0

View File

@ -499,7 +499,7 @@ Execute(ALEFix should fix files on the save event):
\ 'nr': -1, \ 'nr': -1,
\ 'pattern': '', \ 'pattern': '',
\ 'valid': 1, \ 'valid': 1,
\}], ale#test#GetLoclistWithoutNewerKeys() \}], ale#test#GetLoclistWithoutModule()
endif endif
Expect(The buffer should be modified): Expect(The buffer should be modified):
@ -547,7 +547,7 @@ Execute(ALEFix should run the linters with b:ale_lint_on_save = 1):
\ 'nr': -1, \ 'nr': -1,
\ 'pattern': '', \ 'pattern': '',
\ 'valid': 1, \ 'valid': 1,
\}], ale#test#GetLoclistWithoutNewerKeys() \}], ale#test#GetLoclistWithoutModule()
endif endif
Expect(The buffer should be modified): Expect(The buffer should be modified):
@ -579,7 +579,7 @@ Execute(ALEFix should not fix files on :wq):
Assert &modified, 'The was not marked as ''modified''' Assert &modified, 'The was not marked as ''modified'''
" We should not run the linter. " We should not run the linter.
AssertEqual [], ale#test#GetLoclistWithoutNewerKeys() AssertEqual [], ale#test#GetLoclistWithoutModule()
Expect(The buffer should not be modified): Expect(The buffer should not be modified):
a a
@ -619,7 +619,7 @@ Execute(ALEFix should still lint with no linters to be applied):
\ 'nr': -1, \ 'nr': -1,
\ 'pattern': '', \ 'pattern': '',
\ 'valid': 1, \ 'valid': 1,
\}], ale#test#GetLoclistWithoutNewerKeys() \}], ale#test#GetLoclistWithoutModule()
endif endif
Expect(The buffer should be the same): Expect(The buffer should be the same):
@ -655,7 +655,7 @@ Execute(ALEFix should still lint when nothing was fixed on save):
\ 'nr': -1, \ 'nr': -1,
\ 'pattern': '', \ 'pattern': '',
\ 'valid': 1, \ 'valid': 1,
\}], ale#test#GetLoclistWithoutNewerKeys() \}], ale#test#GetLoclistWithoutModule()
endif endif
Expect(The buffer should be the same): Expect(The buffer should be the same):
@ -679,7 +679,7 @@ Execute(ALEFix should not lint the buffer on save if linting on save is disabled
Assert !filereadable(g:test_filename), 'The file should not have been saved' Assert !filereadable(g:test_filename), 'The file should not have been saved'
AssertEqual [], ale#test#GetLoclistWithoutNewerKeys() AssertEqual [], ale#test#GetLoclistWithoutModule()
Expect(The buffer should be the same): Expect(The buffer should be the same):
a a
@ -702,7 +702,7 @@ Execute(ALEFix should not lint the buffer on save if linting on save is disabled
Assert !filereadable(g:test_filename), 'The file should not have been saved' Assert !filereadable(g:test_filename), 'The file should not have been saved'
AssertEqual [], ale#test#GetLoclistWithoutNewerKeys() AssertEqual [], ale#test#GetLoclistWithoutModule()
Expect(The buffer should be the same): Expect(The buffer should be the same):
a a

View File

@ -1,21 +0,0 @@
Before:
Save g:ale_proto_buf_format_executable
" Use an invalid global executable, so we don't match it.
let g:ale_proto_buf_format_executable = 'xxxinvalid'
call ale#test#SetDirectory('/testplugin/test/fixers')
After:
Restore
call ale#test#RestoreDirectory()
Execute(The buf-format callback should return the correct default values):
call ale#test#SetFilename('../test-files/proto/testfile.proto')
AssertEqual
\ {
\ 'command': ale#Escape('xxxinvalid') . ' format %t',
\ },
\ ale#fixers#buf_format#Fix(bufnr(''))

View File

@ -1,36 +0,0 @@
Before:
Save g:ale_ocaml_dune_executable
Save g:ale_ocaml_dune_options
" Use an invalid global executable, so we don't match it.
let g:ale_ocaml_dune_executable = 'xxxinvalid'
let g:ale_ocaml_dune_options = ''
call ale#test#SetDirectory('/testplugin/test/fixers')
After:
Restore
call ale#test#RestoreDirectory()
Execute(The dune callback should return the correct default values):
call ale#test#SetFilename('../test-files/ocaml/testfile.re')
AssertEqual
\ {
\ 'command': ale#Escape('xxxinvalid')
\ . ' format',
\ },
\ ale#fixers#dune#Fix(bufnr(''))
Execute(The dune callback should include custom dune options):
let g:ale_ocaml_dune_options = "--random-option"
call ale#test#SetFilename('../test-files/ocaml/testfile.re')
AssertEqual
\ {
\ 'command': ale#Escape('xxxinvalid')
\ . ' format'
\ . ' ' . g:ale_ocaml_dune_options,
\ },
\ ale#fixers#dune#Fix(bufnr(''))

View File

@ -1,33 +0,0 @@
Before:
Save g:ale_opa_fmt_executable
Save g:ale_opa_fmt_options
" Use an invalid global executable, so we don't match it.
let g:ale_opa_fmt_executable = 'xxxinvalid'
let g:ale_opa_fmt_options = ''
call ale#test#SetDirectory('/testplugin/test/fixers')
After:
Restore
call ale#test#RestoreDirectory()
Execute(The opa fmt callback should return the correct default values):
AssertEqual
\ {
\ 'command': ale#Escape('xxxinvalid') . ' fmt',
\ },
\ ale#fixers#opafmt#Fix(bufnr(''))
Execute(The opa fmt callback should include custom options):
let g:ale_opa_fmt_options = "--list"
AssertEqual
\ {
\ 'command': ale#Escape('xxxinvalid')
\ . ' fmt'
\ . ' ' . g:ale_opa_fmt_options
\ },
\ ale#fixers#opafmt#Fix(bufnr(''))

View File

@ -1,34 +0,0 @@
Before:
Save g:ale_packer_fmt_executable
Save g:ale_packer_fmt_options
" Use an invalid global executable, so we don't match it.
let g:ale_packer_fmt_executable = 'xxxinvalid'
let g:ale_packer_fmt_options = ''
call ale#test#SetDirectory('/testplugin/test/fixers')
After:
Restore
call ale#test#RestoreDirectory()
Execute(The packer fmt callback should return the correct default values):
AssertEqual
\ {
\ 'command': ale#Escape('xxxinvalid') . ' fmt -',
\ },
\ ale#fixers#packer#Fix(bufnr(''))
Execute(The packer fmt callback should include custom options):
let g:ale_packer_fmt_options = "-list=true"
AssertEqual
\ {
\ 'command': ale#Escape('xxxinvalid')
\ . ' fmt'
\ . ' ' . g:ale_packer_fmt_options
\ . ' -',
\ },
\ ale#fixers#packer#Fix(bufnr(''))

View File

@ -1,62 +0,0 @@
Before:
Save g:ale_php_pint_executable
Save g:ale_php_pint_options
let g:ale_php_pint_executable = 'pint'
let g:ale_php_pint_options = ''
call ale#test#SetDirectory('/testplugin/test/fixers')
After:
Restore
call ale#test#RestoreDirectory()
Execute(project with pint should use local by default):
call ale#test#SetFilename('../test-files/php/project-with-pint/test.php')
AssertEqual
\ ale#path#Simplify(g:dir . '/../test-files/php/project-with-pint/vendor/bin/pint'),
\ ale#fixers#pint#GetExecutable(bufnr(''))
Execute(use-global should override local detection):
let g:ale_php_pint_use_global = 1
call ale#test#SetFilename('../test-files/php/project-with-pint/test.php')
AssertEqual
\ 'pint',
\ ale#fixers#pint#GetExecutable(bufnr(''))
Execute(project without pint should use global):
call ale#test#SetFilename('../test-files/php/project-without-pint/test.php')
AssertEqual
\ 'pint',
\ ale#fixers#pint#GetExecutable(bufnr(''))
Execute(The pint callback should return the correct default values):
call ale#test#SetFilename('../test-files/php/project-without-pint/foo/test.php')
AssertEqual
\ {
\ 'read_temporary_file': 1,
\ 'command': ale#Escape('pint')
\ . ' ' . g:ale_php_pint_options
\ . ' %t'
\ },
\ ale#fixers#pint#Fix(bufnr(''))
Execute(The pint callback should include custom pint options):
let g:ale_php_pint_options = '--test'
call ale#test#SetFilename('../test-files/php/project-without-pint/test.php')
AssertEqual
\ {
\ 'command': ale#Escape(g:ale_php_pint_executable)
\ . ' --test %t',
\ 'read_temporary_file': 1,
\ },
\ ale#fixers#pint#Fix(bufnr(''))

View File

@ -1,38 +0,0 @@
Before:
call ale#assert#SetUpFixerTest('python', 'pyflyby')
let b:bin_dir = has('win32') ? 'Scripts' : 'bin'
After:
call ale#assert#TearDownFixerTest()
unlet! b:bin_dir
Execute(The pyflyby callback should return the correct default values):
call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py')
AssertFixer
\ {
\ 'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/tidy-imports')),
\ }
Execute(Pipenv is detected when python_pyflyby_auto_pipenv is set):
let g:ale_python_pyflyby_auto_pipenv = 1
call ale#test#SetFilename('../test-files/python/pipenv/whatever.py')
AssertFixer
\ {
\ 'command': ale#Escape('pipenv') . ' run tidy-imports'
\ }
Execute(Poetry is detected when python_pyflyby_auto_poetry is set):
let g:ale_python_pyflyby_auto_poetry = 1
call ale#test#SetFilename('../test-files/python/poetry/whatever.py')
GivenCommandOutput ['VERSION 5.7.0']
AssertFixer
\ {
\ 'command': ale#Escape('poetry') . ' run tidy-imports'
\ }

View File

@ -14,6 +14,39 @@ Execute(The shfmt callback should return 'shfmt' as default command):
\ ale#fixers#shfmt#Fix(bufnr('')).command =~# '^' . ale#Escape('shfmt'), \ ale#fixers#shfmt#Fix(bufnr('')).command =~# '^' . ale#Escape('shfmt'),
\ "Default command name is expected to be 'shfmt'" \ "Default command name is expected to be 'shfmt'"
Execute(The shfmt callback should return the command with no option as default when noexpandtab is set):
let g:ale_sh_shfmt_executable = 'shfmt'
let g:ale_sh_shfmt_options = ''
setlocal noexpandtab
AssertEqual
\ {
\ 'command': ale#Escape('shfmt'),
\ },
\ ale#fixers#shfmt#Fix(bufnr(''))
Execute(The shfmt callback should return the command specifying indent width by looking shiftwidth as default):
let g:ale_sh_shfmt_executable = 'shfmt'
let g:ale_sh_shfmt_options = ''
setlocal expandtab
setlocal shiftwidth=4
AssertEqual
\ {
\ 'command': ale#Escape('shfmt') . ' -i 4',
\ },
\ ale#fixers#shfmt#Fix(bufnr(''))
Execute(The shfmt callback should return the command specifying indent width by looking tabstop when shiftwidth is 0 as default):
let g:ale_sh_shfmt_executable = 'shfmt'
let g:ale_sh_shfmt_options = ''
setlocal expandtab
setlocal shiftwidth=0
setlocal tabstop=8
AssertEqual
\ {
\ 'command': ale#Escape('shfmt') . ' -i 8',
\ },
\ ale#fixers#shfmt#Fix(bufnr(''))
Execute(The shfmt executable and options should be configurable): Execute(The shfmt executable and options should be configurable):
let g:ale_sh_shfmt_executable = 'foobar' let g:ale_sh_shfmt_executable = 'foobar'
let g:ale_sh_shfmt_options = '--some-option' let g:ale_sh_shfmt_options = '--some-option'
@ -21,7 +54,6 @@ Execute(The shfmt executable and options should be configurable):
AssertEqual AssertEqual
\ { \ {
\ 'command': ale#Escape('foobar') \ 'command': ale#Escape('foobar')
\ . ' -filename=%s'
\ . ' --some-option', \ . ' --some-option',
\ }, \ },
\ ale#fixers#shfmt#Fix(bufnr('')) \ ale#fixers#shfmt#Fix(bufnr(''))

View File

@ -1,37 +0,0 @@
Before:
Save g:ale_ruby_syntax_tree_executable
Save g:ale_ruby_syntax_tree_options
" Use an invalid global executable, so we don't match it.
let g:ale_ruby_syntax_tree_executable = 'xxxinvalid'
let g:ale_ruby_syntax_tree_options = ''
call ale#test#SetDirectory('/testplugin/test/fixers')
After:
Restore
call ale#test#RestoreDirectory()
Execute(The syntax_tree callback should return the correct default values):
call ale#test#SetFilename('../test-files/ruby/dummy.rb')
AssertEqual
\ {
\ 'read_temporary_file': 1,
\ 'command': ale#Escape(g:ale_ruby_syntax_tree_executable)
\ . ' write %t',
\ },
\ ale#fixers#syntax_tree#Fix(bufnr(''))
Execute(The syntax_tree callback should include custom options):
let g:ale_ruby_syntax_tree_options = '--print-width=100 --plugins=plugin/trailing_comma'
call ale#test#SetFilename('../test-files/ruby/with_config/dummy.rb')
AssertEqual
\ {
\ 'read_temporary_file': 1,
\ 'command': ale#Escape(g:ale_ruby_syntax_tree_executable)
\ . ' write --print-width=100 --plugins=plugin/trailing_comma %t',
\ },
\ ale#fixers#syntax_tree#Fix(bufnr(''))

View File

@ -1,20 +0,0 @@
Before:
call ale#assert#SetUpFixerTest('zig', 'zigfmt')
After:
call ale#assert#TearDownFixerTest()
Execute(The zig callback should return the correct default values):
AssertFixer {
\ 'command': ale#Escape('zig') . ' fmt %t',
\ 'read_temporary_file': 1,
\}
Execute(The zig callback should allow custom zig executables):
let g:ale_zig_zigfmt_executable = 'foo/bar'
AssertFixer {
\ 'command': ale#Escape('foo/bar') . ' fmt %t',
\ 'read_temporary_file': 1,
\}

View File

@ -1,43 +0,0 @@
Before:
runtime! ale/handlers/actionlint.vim
After:
unlet! g:ale_yaml_actionlint_options
call ale#linter#Reset()
Execute(Problems should be parsed correctly for actionlint):
AssertEqual
\ [
\ {
\ 'lnum': 2,
\ 'col': 1,
\ 'type': 'E',
\ 'text': '"jobs" section is missing in workflow',
\ 'code': 'syntax-check',
\ },
\ {
\ 'lnum': 56,
\ 'col': 23,
\ 'type': 'E',
\ 'text': 'property "unknown_input" is not defined in object type {input7: bool; input0: any; input1: any; input2: string; input3: any; input4: any; input5: number; input6: number}',
\ 'code': 'expression',
\ },
\ ],
\ ale#handlers#actionlint#Handle(bufnr(''), [
\ '.codecov.yaml:2:1: "jobs" section is missing in workflow [syntax-check]',
\ 'workflow_call_event.yaml:56:23: property "unknown_input" is not defined in object type {input7: bool; input0: any; input1: any; input2: string; input3: any; input4: any; input5: number; input6: number} [expression]',
\ ])
Execute(Command should always have --no-color and --oneline options):
let g:ale_yaml_actionlint_options = ''
AssertEqual
\ '%e --no-color --oneline %t',
\ ale#handlers#actionlint#GetCommand(bufnr(''))
Execute(Options should be added to command):
let g:ale_yaml_actionlint_options = '-shellcheck= -pyflakes='
AssertEqual
\ '%e -shellcheck= -pyflakes= --no-color --oneline %t',
\ ale#handlers#actionlint#GetCommand(bufnr(''))

View File

@ -19,17 +19,10 @@ Execute(Basic problems should be parsed correctly):
\ 'lnum': 2, \ 'lnum': 2,
\ 'col': 16, \ 'col': 16,
\ }, \ },
\ {
\ 'type': 'I',
\ 'text': 'dead_code: Dead code. Try removing the code, or fixing the code before it so that it can be reached.',
\ 'lnum': 8,
\ 'col': 3,
\ },
\ ], \ ],
\ ale_linters#dart#dart_analyze#Handle(bufnr(''), [ \ ale_linters#dart#dart_analyze#Handle(bufnr(''), [
\ 'Analyzing main.dart...', \ 'Analyzing main.dart...',
\ ' error - main.dart:5:1 - Expected to find ''}'' - expected_token', \ ' error - main.dart:5:1 - Expected to find ''}'' - expected_token',
\ 'warning - main.dart:2:16 - A value of type ''String'' can''t be assigned to a variable of type ''int'' - invalid_assignment', \ ' warning - main.dart:2:16 - A value of type ''String'' can''t be assigned to a variable of type ''int'' - invalid_assignment',
\ ' info - main.dart:8:3 - Dead code. Try removing the code, or fixing the code before it so that it can be reached. - dead_code', \ '1 error and 1 warning found.',
\ '3 issues found.',
\ ]) \ ])

View File

@ -130,48 +130,3 @@ Execute(The ghc handler should handle stack 1.5.1 output):
\ ' 160 | pattern F :: Exp a', \ ' 160 | pattern F :: Exp a',
\ ' | ^^^^^', \ ' | ^^^^^',
\ ]) \ ])
Execute(The ghc handler should handle ghc panic):
let g:detail = [
\ '[15 of 15] Compiling SizedTypes.List',
\ 'ghc: panic! (the ''impossible'' happened)',
\ ' (GHC version 8.10.3:',
\ ' src/SizedTypes/List.hs:(46,19)-(50,0) Specified type does not refine Haskell type for `SizedTypes.List.out` (Plugged Init types new)',
\ ' The Liquid type',
\ ' .',
\ ' GHC.Types.Int -> (SizedTypes.List.List a) -> (_, (SizedTypes.List.List a))',
\ ' .',
\ ' is inconsistent with the Haskell type',
\ ' .',
\ ' forall p a ->',
\ 'p -> SizedTypes.List.List a -> (a, SizedTypes.List.List a)',
\ ' .',
\ ' defined at src/SizedTypes/List.hs:52:1-3',
\ ' .',
\ ' Specifically, the Liquid component',
\ ' .',
\ ' {VV##0 : GHC.Types.Int | VV##0 >= 0}',
\ ' .',
\ ' is inconsistent with the Haskell component',
\ ' .',
\ ' p',
\ ' .',
\ ' ',
\ ' HINT: Use the hole ''_'' instead of the mismatched component (in the Liquid specification)',
\ '',
\ 'Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug',
\ '',
\ ''
\ ]
AssertEqual
\ [
\ {
\ 'lnum': 1,
\ 'col': 1,
\ 'type': 'E',
\ 'text': 'ghc panic!',
\ 'detail': join(g:detail[1:-3], "\n"),
\ },
\ ],
\ ale#handlers#haskell#HandleGHCFormat(bufnr(''), g:detail)
unlet g:detail

View File

@ -13,21 +13,19 @@ Execute (The golangci-lint handler should handle names with spaces):
\ 'C:\something\file with spaces.go', \ 'C:\something\file with spaces.go',
\ '12', \ '12',
\ '3', \ '3',
\ 'expected ''package'', found ''IDENT'' gibberish', \ 'expected ''package'', found ''IDENT'' gibberish (staticcheck)',
\ 'staticcheck',
\ ], \ ],
\ [ \ [
\ 'C:\something\file with spaces.go', \ 'C:\something\file with spaces.go',
\ '37', \ '37',
\ '5', \ '5',
\ 'expected ''package'', found ''IDENT'' gibberish', \ 'expected ''package'', found ''IDENT'' gibberish (golint)',
\ 'golint',
\ ], \ ],
\ ], \ ],
\ map(ale_linters#go#golangci_lint#GetMatches([ \ map(ale_linters#go#golangci_lint#GetMatches([
\ 'C:\something\file with spaces.go:12:3: expected ''package'', found ''IDENT'' gibberish (staticcheck)', \ 'C:\something\file with spaces.go:12:3: expected ''package'', found ''IDENT'' gibberish (staticcheck)',
\ 'C:\something\file with spaces.go:37:5: expected ''package'', found ''IDENT'' gibberish (golint)', \ 'C:\something\file with spaces.go:37:5: expected ''package'', found ''IDENT'' gibberish (golint)',
\ ]), 'v:val[1:5]') \ ]), 'v:val[1:4]')
Execute (The golangci-lint handler should handle paths correctly): Execute (The golangci-lint handler should handle paths correctly):
call ale#test#SetFilename('app/test.go') call ale#test#SetFilename('app/test.go')
@ -40,14 +38,14 @@ Execute (The golangci-lint handler should handle paths correctly):
\ 'lnum': 12, \ 'lnum': 12,
\ 'col': 3, \ 'col': 3,
\ 'text': 'expected ''package'', found ''IDENT'' gibberish (staticcheck)', \ 'text': 'expected ''package'', found ''IDENT'' gibberish (staticcheck)',
\ 'type': 'W', \ 'type': 'E',
\ 'filename': ale#path#Simplify(expand('%:p:h') . '/test.go'), \ 'filename': ale#path#Simplify(expand('%:p:h') . '/test.go'),
\ }, \ },
\ { \ {
\ 'lnum': 37, \ 'lnum': 37,
\ 'col': 5, \ 'col': 5,
\ 'text': 'expected ''package'', found ''IDENT'' gibberish (golint)', \ 'text': 'expected ''package'', found ''IDENT'' gibberish (golint)',
\ 'type': 'W', \ 'type': 'E',
\ 'filename': ale#path#Simplify(expand('%:p:h') . '/test.go'), \ 'filename': ale#path#Simplify(expand('%:p:h') . '/test.go'),
\ }, \ },
\ ], \ ],
@ -55,30 +53,3 @@ Execute (The golangci-lint handler should handle paths correctly):
\ file . ':12:3: expected ''package'', found ''IDENT'' gibberish (staticcheck)', \ file . ':12:3: expected ''package'', found ''IDENT'' gibberish (staticcheck)',
\ file . ':37:5: expected ''package'', found ''IDENT'' gibberish (golint)', \ file . ':37:5: expected ''package'', found ''IDENT'' gibberish (golint)',
\ ]) \ ])
Execute (The golangci-lint handler should handle only typecheck lines as errors):
call ale#test#SetFilename('app/main.go')
let file = ale#path#GetAbsPath(expand('%:p:h'), 'test.go')
AssertEqual
\ [
\ {
\ 'lnum': 30,
\ 'col': 5,
\ 'text': 'variable ''err'' is not used (typecheck)',
\ 'type': 'E',
\ 'filename': ale#path#Simplify(expand('%:p:h') . '/test.go'),
\ },
\ {
\ 'lnum': 505,
\ 'col': 75,
\ 'text': 'Magic number: 404, in <argument> detected (gomnd)',
\ 'type': 'W',
\ 'filename': ale#path#Simplify(expand('%:p:h') . '/test.go'),
\ }
\ ],
\ ale_linters#go#golangci_lint#Handler(bufnr(''), [
\ file . ':30:5: variable ''err'' is not used (typecheck)',
\ file . ':505:75: Magic number: 404, in <argument> detected (gomnd)',
\ ])

View File

@ -1,38 +0,0 @@
Before:
runtime ale_linters/lua/selene.vim
After:
Restore
call ale#linter#Reset()
Execute(The selene handler for Lua should parse input correctly):
AssertEqual
\ [
\ {
\ 'lnum': 1,
\ 'end_lnum': 2,
\ 'col': 1,
\ 'end_col': 3,
\ 'text': 'empty if block',
\ 'code': 'empty_if',
\ 'type': 'W',
\ },
\ {
\ 'lnum': 1,
\ 'end_lnum': 1,
\ 'col': 4,
\ 'end_col': 11,
\ 'text': 'comparing things to nan directly is not allowed',
\ 'code': 'compare_nan',
\ 'type': 'E',
\ 'detail': "comparing things to nan directly is not allowed\n\ntry: `x ~= x` instead"
\ },
\ ],
\ ale_linters#lua#selene#Handle(0, [
\ '{"severity":"Warning","code":"empty_if","message":"empty if block","primary_label":{"span":{"start":0,"start_line":0,"start_column":0,"end":20,"end_line":1,"end_column":3},"message":""},"notes":[],"secondary_labels":[]}',
\ '{"severity":"Error","code":"compare_nan","message":"comparing things to nan directly is not allowed","primary_label":{"span":{"start":3,"start_line":0,"start_column":3,"end":11,"end_line":0,"end_column":11},"message":""},"notes":["try: `x ~= x` instead"],"secondary_labels":[]}',
\ 'Results:',
\ '1 errors',
\ '1 warnings',
\ '0 parse errors',
\ ])

View File

@ -1,76 +0,0 @@
Before:
call ale#test#SetDirectory('/testplugin/test/handler')
" Load sca2d
runtime ale_linters/openscad/sca2d.vim
After:
call ale#test#RestoreDirectory()
call ale#linter#Reset()
Execute(The openscad handler should handle sca2d output):
AssertEqual
\ [
\ {
\ 'filename': ale#path#Simplify(g:dir . '/awesome_project.scad'),
\ 'lnum': 7,
\ 'type': 'E',
\ 'col': 42,
\ 'text': 'Module `corcle` used but never defined.',
\ 'detail': 'E2002: Module `corcle` used but never defined.',
\ },
\ ],
\ ale#handlers#openscad#SCA2D_callback(bufnr(''), [
\ 'awesome_project.scad:7:42: E2002: Module `corcle` used but never defined.',
\ '',
\ 'SCA2D message summary',
\ '=====================',
\ 'Fatal errors: 0',
\ 'Errors: 1',
\ 'Warnings: 0',
\ 'Info: 0',
\ 'Depreciated 0',
\ ])
AssertEqual
\ [
\ {
\ 'filename': ale#path#Simplify(g:dir . '/awesome_project.scad'),
\ 'lnum': 1,
\ 'type': 'E',
\ 'col': 37,
\ 'text': 'Cannot read file due to syntax error: - No terminal matches ''}'' in the current parser context',
\ 'detail': 'F0001: Cannot read file due to syntax error: - No terminal matches ''}'' in the current parser context',
\ },
\ ],
\ ale#handlers#openscad#SCA2D_callback(bufnr(''), [
\ 'awesome_project.scad:1:1: F0001: Cannot read file due to syntax error:',
\ ' - No terminal matches ''}'' in the current parser context, at line 1 col 37',
\ ' - ',
\ ' - translate([ 0, 0, 0 ]) { circle(10) }',
\ ' - ^',
\ ' - Expected one of: ',
\ ' - * IF',
\ ' - * LET',
\ ' - * FOR',
\ ' - * FUNC_CALL_NAME',
\ ' - * TERMINATION',
\ ' - * STAR',
\ ' - * LBRACE',
\ ' - * BANG',
\ ' - * ASSIGN',
\ ' - * PERCENT',
\ ' - * HASH',
\ ' - * INTERSECTION_FOR',
\ ' - ',
\ 'If you belive this is a bug in SCA2D please report it to us.',
\ '',
\ '',
\ 'SCA2D message summary',
\ '=====================',
\ 'Fatal errors: 1',
\ 'Errors: 0',
\ 'Warnings: 0',
\ 'Info: 0',
\ 'Depreciated 0',
\ ])

View File

@ -12,13 +12,10 @@ After:
silent file something_else.py silent file something_else.py
Execute(The pylama handler should handle no messages with version older than 8.1.4): Execute(The pylama handler should handle no messages):
AssertEqual [], ale_linters#python#pylama#Handle(bufnr(''), [8, 0, 5], []) AssertEqual [], ale_linters#python#pylama#Handle(bufnr(''), [])
Execute(The pylama handler should handle no messages with version newer or equal than 8.1.4): Execute(The pylama handler should handle basic warnings and syntax errors):
AssertEqual [], ale_linters#python#pylama#Handle(bufnr(''), [8, 2, 0], [])
Execute(The pylama handler should handle basic warnings and syntax errors with version older than 8.1.4):
AssertEqual AssertEqual
\ [ \ [
\ { \ {
@ -86,7 +83,7 @@ Execute(The pylama handler should handle basic warnings and syntax errors with v
\ 'text': 'Invalid string quote ", should be '' [pylint]', \ 'text': 'Invalid string quote ", should be '' [pylint]',
\ }, \ },
\ ], \ ],
\ ale_linters#python#pylama#Handle(bufnr(''), [8, 0, 5], [ \ ale_linters#python#pylama#Handle(bufnr(''), [
\ 'No config file found, using default configuration', \ 'No config file found, using default configuration',
\ 'index.py:8:1: W0611 ''foo'' imported but unused [pyflakes]', \ 'index.py:8:1: W0611 ''foo'' imported but unused [pyflakes]',
\ 'index.py:8:0: E0401 Unable to import ''foo'' [pylint]', \ 'index.py:8:0: E0401 Unable to import ''foo'' [pylint]',
@ -98,79 +95,7 @@ Execute(The pylama handler should handle basic warnings and syntax errors with v
\ 'index.py:20:0: C4001 Invalid string quote ", should be '' [pylint]', \ 'index.py:20:0: C4001 Invalid string quote ", should be '' [pylint]',
\ ]) \ ])
Execute(The pylama handler should handle basic warnings and syntax errors with version newer than 8.1.4): Execute(The pylama handler should handle tracebacks with parsable messages):
AssertEqual
\ [
\ {
\ 'lnum': 8,
\ 'col': 1,
\ 'code': 'W0611',
\ 'type': 'W',
\ 'sub_type': '',
\ 'text': '''foo'' imported but unused [pyflakes]',
\ },
\ {
\ 'lnum': 8,
\ 'col': 0,
\ 'code': 'E0401',
\ 'type': 'E',
\ 'sub_type': '',
\ 'text': 'Unable to import ''foo'' [pylint]',
\ },
\ {
\ 'lnum': 10,
\ 'col': 1,
\ 'code': 'E302',
\ 'type': 'E',
\ 'sub_type': '',
\ 'text': 'expected 2 blank lines, found 1 [pycodestyle]',
\ },
\ {
\ 'lnum': 11,
\ 'col': 1,
\ 'code': 'D401',
\ 'type': 'W',
\ 'sub_type': 'style',
\ 'text': 'First line should be in imperative mood (''Get'', not ''Gets'') [pydocstyle]',
\ },
\ {
\ 'lnum': 15,
\ 'col': 81,
\ 'code': 'E501',
\ 'type': 'E',
\ 'sub_type': '',
\ 'text': 'line too long (96 > 80 characters) [pycodestyle]',
\ },
\ {
\ 'lnum': 16,
\ 'col': 1,
\ 'code': 'D203',
\ 'type': 'W',
\ 'sub_type': 'style',
\ 'text': '1 blank line required before class docstring (found 0) [pydocstyle]',
\ },
\ {
\ 'lnum': 18,
\ 'col': 1,
\ 'code': 'D107',
\ 'type': 'W',
\ 'sub_type': 'style',
\ 'text': 'Missing docstring in __init__ [pydocstyle]',
\ },
\ {
\ 'lnum': 20,
\ 'col': 0,
\ 'code': 'C4001',
\ 'type': 'W',
\ 'sub_type': 'style',
\ 'text': 'Invalid string quote ", should be '' [pylint]',
\ },
\ ],
\ ale_linters#python#pylama#Handle(bufnr(''), [8, 2, 0], [
\ '[{"source":"pyflakes","col":1,"lnum":8,"etype":"W","message":"''foo'' imported but unused","filename":"index.py","number":"W0611"},{"source":"pylint","col":0,"lnum":8,"etype":"E","message":"Unable to import ''foo''","filename":"index.py","number":"E0401"},{"source":"pycodestyle","col":1,"lnum":10,"etype":"E","message":"expected 2 blank lines, found 1","filename":"index.py","number":"E302"},{"source":"pydocstyle","col":1,"lnum":11,"etype":"D","message":"First line should be in imperative mood (''Get'', not ''Gets'')","filename":"index.py","number":"D401"},{"source":"pycodestyle","col":81,"lnum":15,"etype":"E","message":"line too long (96 > 80 characters)","filename":"index.py","number":"E501"},{"source":"pydocstyle","col":1,"lnum":16,"etype":"D","message":"1 blank line required before class docstring (found 0)","filename":"index.py","number":"D203"},{"source":"pydocstyle","col":1,"lnum":18,"etype":"D","message":"Missing docstring in __init__","filename":"index.py","number":"D107"},{"source":"pylint","col":0,"lnum":20,"etype":"C","message":"Invalid string quote \", should be ''","filename":"index.py","number":"C4001"}]',
\ ])
Execute(The pylama handler should handle tracebacks with parsable messages with version older than 8.1.4):
AssertEqual AssertEqual
\ [ \ [
\ { \ {
@ -210,7 +135,7 @@ Execute(The pylama handler should handle tracebacks with parsable messages with
\ 'text': 'line too long (96 > 80 characters) [pycodestyle]', \ 'text': 'line too long (96 > 80 characters) [pycodestyle]',
\ }, \ },
\ ], \ ],
\ ale_linters#python#pylama#Handle(bufnr(''), [8, 0, 5], [ \ ale_linters#python#pylama#Handle(bufnr(''), [
\ 'Traceback (most recent call last):', \ 'Traceback (most recent call last):',
\ ' File "/usr/local/lib/python2.7/site-packages/pylama/core.py", line 66, in run', \ ' File "/usr/local/lib/python2.7/site-packages/pylama/core.py", line 66, in run',
\ ' path, code=code, ignore=ignore, select=select, params=lparams)', \ ' path, code=code, ignore=ignore, select=select, params=lparams)',
@ -233,7 +158,7 @@ Execute(The pylama handler should handle tracebacks with parsable messages with
" Note: This is probably a bug, since all pylama plugins produce codes, but " Note: This is probably a bug, since all pylama plugins produce codes, but
" should be handled for compatibility. " should be handled for compatibility.
" Note: The pylama isort plugin is distributed in the isort package. " Note: The pylama isort plugin is distributed in the isort package.
Execute(The pylama handler should handle messages without codes with version older than 8.1.4): Execute(The pylama handler should handle messages without codes):
AssertEqual AssertEqual
\ [ \ [
\ { \ {
@ -245,13 +170,13 @@ Execute(The pylama handler should handle messages without codes with version old
\ 'text': 'Incorrectly sorted imports. [isort]' \ 'text': 'Incorrectly sorted imports. [isort]'
\ }, \ },
\ ], \ ],
\ ale_linters#python#pylama#Handle(bufnr(''), [8, 0, 5], [ \ ale_linters#python#pylama#Handle(bufnr(''), [
\ 'index.py:0:0: Incorrectly sorted imports. [isort]', \ 'index.py:0:0: Incorrectly sorted imports. [isort]',
\ ]) \ ])
" Note: This is a pylama bug, but should be handled for compatibility. " Note: This is a pylama bug, but should be handled for compatibility.
" See https://github.com/klen/pylama/pull/146 " See https://github.com/klen/pylama/pull/146
Execute(The pylama handler should handle message codes followed by a colon with version older than 8.1.4): Execute(The pylama handler should handle message codes followed by a colon):
AssertEqual AssertEqual
\ [ \ [
\ { \ {
@ -263,6 +188,6 @@ Execute(The pylama handler should handle message codes followed by a colon with
\ 'text': 'Found commented out code: # needs_sphinx = ''1.0'' [eradicate]', \ 'text': 'Found commented out code: # needs_sphinx = ''1.0'' [eradicate]',
\ }, \ },
\ ], \ ],
\ ale_linters#python#pylama#Handle(bufnr(''), [8, 0, 5], [ \ ale_linters#python#pylama#Handle(bufnr(''), [
\ 'index.py:31:1: E800: Found commented out code: # needs_sphinx = ''1.0'' [eradicate]', \ 'index.py:31:1: E800: Found commented out code: # needs_sphinx = ''1.0'' [eradicate]',
\ ]) \ ])

View File

@ -1,36 +0,0 @@
Before:
runtime ale_linters/cairo/starknet.vim
After:
call ale#linter#Reset()
Execute(The starknet handler should handle error messages correctly):
AssertEqual
\ [
\ {
\ 'lnum': 3,
\ 'col': 6,
\ 'text': 'Could not find module "starkware.cairo.commo.cairo_builtins". Searched in the following paths:',
\ 'type': 'E',
\ },
\ ],
\ ale_linters#cairo#starknet#Handle(bufnr(''), [
\ 'contract.cairo:3:6: Could not find module "starkware.cairo.commo.cairo_builtins". Searched in the following paths:',
\ 'from starkware.cairo.commo.cairo_builtins import HashBuiltin',
\ ' ^**********************************^',
\ ])
AssertEqual
\ [
\ {
\ 'lnum': 21,
\ 'col': 2,
\ 'text': 'Unsupported decorator: "vie".',
\ 'type': 'E',
\ },
\ ],
\ ale_linters#cairo#starknet#Handle(bufnr(''), [
\ 'contract.cairo:21:2: Unsupported decorator: "vie".',
\ '@vie',
\ ' ^*^',
\ ])

View File

@ -97,42 +97,3 @@ Execute(Should use summary if detail not available):
\ ' ]', \ ' ]',
\ '}' \ '}'
\ ]) \ ])
Execute(Should use summary if detail available but empty):
AssertEqual
\ [
\ {
\ 'lnum': 91,
\ 'col': 41,
\ 'filename': ale#path#Simplify(g:dir . '/main.tf'),
\ 'type': 'E',
\ 'text': 'storage_os_disk: required field is not set',
\ }
\ ],
\ ale_linters#terraform#terraform#Handle(bufnr(''), [
\ '{',
\ ' "valid": false,',
\ ' "error_count": 1,',
\ ' "warning_count": 0,',
\ ' "diagnostics": [',
\ ' {',
\ ' "severity": "error",',
\ ' "summary": "storage_os_disk: required field is not set",',
\ ' "detail": "",',
\ ' "range": {',
\ ' "filename": "main.tf",',
\ ' "start": {',
\ ' "line": 91,',
\ ' "column": 41,',
\ ' "byte": 2381',
\ ' },',
\ ' "end": {',
\ ' "line": 91,',
\ ' "column": 41,',
\ ' "byte": 2381',
\ ' }',
\ ' }',
\ ' }',
\ ' ]',
\ '}'
\ ])

Some files were not shown because too many files have changed in this diff Show More