Skip to content

Commit

Permalink
add a new ALE version
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielSchuette committed Jan 8, 2023
1 parent 475aaf4 commit fb78133
Show file tree
Hide file tree
Showing 447 changed files with 9,841 additions and 3,665 deletions.
4 changes: 4 additions & 0 deletions vim-config/configs.vim
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ augroup END
"********************"
"** Plugin Configs **"
"********************"
" Zig.vim
" -------
let g:zig_fmt_autosave = 0

" Ctags
" -----
" Vim supports ctags natively, but some of the keybindings are awkward by
Expand Down
9 changes: 4 additions & 5 deletions vim-config/plugins/ale/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
FROM testbed/vim:20
FROM testbed/vim:24

RUN install_vim -tag v8.0.0027 -build \
-tag v8.2.2401 -build \
-tag v9.0.0297 -build \
-tag neovim:v0.2.0 -build \
-tag neovim:v0.4.4 -build \
-tag neovim:v0.5.0 -build
-tag neovim:v0.8.0 -build

ENV PACKAGES="\
bash \
Expand All @@ -25,4 +24,4 @@ RUN git clone https://github.com/junegunn/vader.vim vader && \

ARG GIT_VERSION
LABEL Version=${GIT_VERSION}
LABEL Name=w0rp/ale
LABEL Name=denseanalysis/ale
2 changes: 1 addition & 1 deletion vim-config/plugins/ale/LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2016-2020, w0rp <[email protected]>
Copyright (c) 2016-2023, Dense Analysis
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
26 changes: 15 additions & 11 deletions vim-config/plugins/ale/README.md
Original file line number Diff line number Diff line change
@@ -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 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)
# 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)


![ALE Logo by Mark Grealish - https://www.bhalash.com/](https://user-images.githubusercontent.com/3518142/59195920-2c339500-8b85-11e9-9c22-f6b7f69637b8.jpg)
Expand All @@ -7,7 +7,7 @@ ALE (Asynchronous Lint Engine) is a plugin providing linting (syntax checking
and semantic errors) in NeoVim 0.2.0+ and Vim 8 while you edit your text files,
and acts as a Vim [Language Server Protocol](https://langserver.org/) client.

<img src="https://user-images.githubusercontent.com/3518142/59195938-3a81b100-8b85-11e9-8e8d-6a601b1db908.gif" alt="A linting example with the darkspectrum color scheme in GVim." title="A linting example with the darkspectrum color scheme in GVim.">
<video autoplay="true" muted="true" loop="true" controls="false" src="https://user-images.githubusercontent.com/3518142/210141215-8f2ff760-6a87-4704-a11e-c109b8e9ec41.mp4" title="An example showing what ALE can do."></video>

ALE makes use of NeoVim and Vim 8 job control functions and timers to
run linters on the contents of text buffers and return errors as
Expand Down Expand Up @@ -198,14 +198,15 @@ completion manually with `<C-x><C-o>`.
set omnifunc=ale#completion#OmniFunc
```

ALE supports automatic imports from external modules. This behavior is disabled
by default and can be enabled by setting:
ALE supports automatic imports from external modules. This behavior is enabled
by default and can be disabled by setting:

```vim
let g:ale_completion_autoimport = 1
let g:ale_completion_autoimport = 0
```

See `:help ale-completion` for more information.
Note that disabling auto import can result in missing completion items from some
LSP servers (e.g. eclipselsp). See `:help ale-completion` for more information.

<a name="usage-go-to-definition"></a>

Expand Down Expand Up @@ -263,6 +264,9 @@ See `:help ale-symbol-search` for more information.
ALE supports renaming symbols in symbols in code such as variables or class
names with the `ALERename` command.

`ALEFileRename` will rename file and fix import paths (tsserver
only).

`ALECodeAction` will execute actions on the cursor or applied to a visual
range selection, such as automatically fixing errors.

Expand Down Expand Up @@ -355,7 +359,7 @@ See the Vundle documentation for more information.

<a name="installation-with-vim-plug"></a>

### 3.iiii. Installation with Vim-Plug
### 3.iv. Installation with 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`:
Expand All @@ -382,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
a Roadmap for the future, and more.

If you'd liked to discuss the project more directly, check out the `#vim-ale` channel
on Freenode. Web chat is available [here](https://webchat.freenode.net/?channels=vim-ale).
If you'd liked to discuss ALE and more check out the Dense Analysis Discord
server here: https://discord.gg/5zFD6pQxDk

<a name="faq"></a>

Expand Down Expand Up @@ -927,14 +931,14 @@ If the terminal supports Unicode, you might try setting the value like below, to
make it look nicer.

```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
ale into using that default with

```vim
let g:ale_floating_window_border = repeat([''], 6)
let g:ale_floating_window_border = repeat([''], 8)
```

<a name="faq-vim-lsp"></a>
Expand Down
5 changes: 5 additions & 0 deletions vim-config/plugins/ale/ale_linters/ada/cspell.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
scriptencoding utf-8
" Author: David Houston <houstdav000>
" Description: cspell support for Ada files.

call ale#handlers#cspell#DefineLinter('ada')
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
" Author: Horacio Sanson <https://github.com/hsanson>
" Description: Support ansible language server https://github.com/ansible/ansible-language-server/

call ale#Set('ansible_language_server_executable', 'ansible-language-server')
call ale#Set('ansible_language_server_config', {})

function! ale_linters#ansible#ansible_language_server#Executable(buffer) abort
return ale#Var(a:buffer, 'ansible_language_server_executable')
endfunction

function! ale_linters#ansible#ansible_language_server#GetCommand(buffer) abort
let l:executable = ale_linters#ansible#ansible_language_server#Executable(a:buffer)

return ale#Escape(l:executable) . ' --stdio'
endfunction

function! ale_linters#ansible#ansible_language_server#FindProjectRoot(buffer) abort
let l:dir = fnamemodify(
\ ale#path#FindNearestFile(a:buffer, 'ansible.cfg'),
\ ':h'
\)

if l:dir isnot# '.' && isdirectory(l:dir)
return l:dir
endif

let l:dir = fnamemodify(
\ ale#path#FindNearestDirectory(a:buffer, '.git'),
\ ':h:h'
\)

if l:dir isnot# '.' && isdirectory(l:dir)
return l:dir
endif

return ''
endfunction

call ale#linter#Define('ansible', {
\ 'name': 'ansible-language-server',
\ 'lsp': 'stdio',
\ 'executable': function('ale_linters#ansible#ansible_language_server#Executable'),
\ 'command': function('ale_linters#ansible#ansible_language_server#GetCommand'),
\ 'project_root': function('ale_linters#ansible#ansible_language_server#FindProjectRoot'),
\ 'lsp_config': {b -> ale#Var(b, 'ansible_language_server_config')}
\})
28 changes: 26 additions & 2 deletions vim-config/plugins/ale/ale_linters/ansible/ansible_lint.vim
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,30 @@ function! ale_linters#ansible#ansible_lint#Handle(buffer, version, lines) abort
endif
endfor

let l:version_group = ale#semver#GTE(a:version, [5, 0, 0]) ? '>=5.0.0' : '<5.0.0'
let l:version_group = ale#semver#GTE(a:version, [6, 0, 0]) ? '>=6.0.0' :
\ ale#semver#GTE(a:version, [5, 0, 0]) ? '>=5.0.0' :
\ '<5.0.0'
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 = ale#util#FuzzyJSONDecode(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
" Matches patterns line the following:
" test.yml:3:148: syntax-check 'var' is not a valid attribute for a Play
Expand Down Expand Up @@ -73,10 +94,13 @@ endfunction

function! ale_linters#ansible#ansible_lint#GetCommand(buffer, version) abort
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 -p %t'
\}
let l:command = ale#semver#GTE(a:version, [5, 0]) ? l:commands['>=5.0.0'] : l:commands['<5.0.0']
let l:command = ale#semver#GTE(a:version, [6, 0]) ? l:commands['>=6.0.0'] :
\ ale#semver#GTE(a:version, [5, 0]) ? l:commands['>=5.0.0'] :
\ l:commands['<5.0.0']

return l:command
endfunction
Expand Down
5 changes: 5 additions & 0 deletions vim-config/plugins/ale/ale_linters/asciidoc/cspell.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
scriptencoding utf-8
" Author: David Houston <houstdav000>
" Description: cspell support for ASCIIDoc files.

call ale#handlers#cspell#DefineLinter('asciidoc')
36 changes: 36 additions & 0 deletions vim-config/plugins/ale/ale_linters/avra/avra.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
" Author: Utkarsh Verma <[email protected]>
" Description: AVRA linter for avra syntax.

call ale#Set('avra_avra_executable', 'avra')
call ale#Set('avra_avra_options', '')

function! ale_linters#avra#avra#GetCommand(buffer) abort
return '%e'
\ . ' %t'
\ . ale#Pad(ale#Var(a:buffer, 'avra_avra_options'))
\ . ' -o ' . g:ale#util#nul_file
endfunction

function! ale_linters#avra#avra#Handle(buffer, lines) abort
" Note that we treat 'fatal' as errors.
let l:pattern = '^\S\+(\(\d\+\))\s\+:\s\+\(\S\+\)\s\+:\s\+\(.\+\)$'
let l:output = []

for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'lnum': l:match[1] + 0,
\ 'type': l:match[2] =~? 'Error' ? 'E' : 'W',
\ 'text': l:match[3],
\})
endfor

return l:output
endfunction

call ale#linter#Define('avra', {
\ 'name': 'avra',
\ 'output_stream': 'stderr',
\ 'executable': {b -> ale#Var(b, 'avra_avra_executable')},
\ 'command': function('ale_linters#avra#avra#GetCommand'),
\ 'callback': 'ale_linters#avra#avra#Handle',
\})
5 changes: 3 additions & 2 deletions vim-config/plugins/ale/ale_linters/awk/gawk.vim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
" Author: kmarc <[email protected]>
" Description: This file adds support for using GNU awk with sripts.
" Description: This file adds support for using GNU awk with scripts.

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

call ale#linter#Define('awk', {
Expand Down
64 changes: 64 additions & 0 deletions vim-config/plugins/ale/ale_linters/bicep/bicep.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
" Author: Carl Smedstad <carl.smedstad at protonmail dot com>
" Description: bicep for bicep files

let g:ale_bicep_bicep_executable =
\ get(g:, 'ale_bicep_bicep_executable', 'bicep')

let g:ale_bicep_bicep_options =
\ get(g:, 'ale_bicep_bicep_options', '')

function! ale_linters#bicep#bicep#Executable(buffer) abort
return ale#Var(a:buffer, 'bicep_bicep_executable')
endfunction

function! ale_linters#bicep#bicep#Command(buffer) abort
let l:executable = ale_linters#bicep#bicep#Executable(a:buffer)
let l:options = ale#Var(a:buffer, 'bicep_bicep_options')

if has('win32')
let l:nullfile = 'NUL'
else
let l:nullfile = '/dev/null'
endif

return ale#Escape(l:executable)
\ . ' build --outfile '
\ . l:nullfile
\ . ' '
\ . l:options
\ . ' %s'
endfunction

function! ale_linters#bicep#bicep#Handle(buffer, lines) abort
let l:pattern = '\v^.*\((\d+),(\d+)\)\s:\s([a-zA-Z]*)\s([-a-zA-Z0-9]*):\s(.*)'
let l:output = []

for l:match in ale#util#GetMatches(a:lines, l:pattern)
if l:match[3] is# 'Error'
let l:type = 'E'
elseif l:match[3] is# 'Warning'
let l:type = 'W'
else
let l:type = 'I'
endif

call add(l:output, {
\ 'lnum': l:match[1] + 0,
\ 'col': l:match[2] + 0,
\ 'type': l:type,
\ 'code': l:match[4],
\ 'text': l:match[5],
\})
endfor

return l:output
endfunction

call ale#linter#Define('bicep', {
\ 'name': 'bicep',
\ 'executable': function('ale_linters#bicep#bicep#Executable'),
\ 'command': function('ale_linters#bicep#bicep#Command'),
\ 'callback': 'ale_linters#bicep#bicep#Handle',
\ 'output_stream': 'both',
\ 'lint_file': 1,
\})
47 changes: 47 additions & 0 deletions vim-config/plugins/ale/ale_linters/bitbake/oelint_adv.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
" Author: offa
" Description: oelint-adv for BitBake files

call ale#Set('bitbake_oelint_adv_executable', 'oelint-adv')
call ale#Set('bitbake_oelint_adv_options', '')
call ale#Set('bitbake_oelint_adv_config', '.oelint.cfg')

function! ale_linters#bitbake#oelint_adv#Command(buffer) abort
let l:config_file = ale#path#FindNearestFile(a:buffer,
\ ale#Var(a:buffer, 'bitbake_oelint_adv_config'))

return ((!empty(l:config_file))
\ ? 'OELINT_CONFIG=' . ale#Escape(l:config_file) . ' '
\ : '')
\ . '%e --quiet '
\ . ale#Pad(ale#Var(a:buffer, 'bitbake_oelint_adv_options')) . '%s'
endfunction

function! ale_linters#bitbake#oelint_adv#Handle(buffer, lines) abort
let l:pattern = '\v^(.+):(.+):(.+):(.+):(.+)$'
let l:output = []

for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'lnum': str2nr(l:match[2]),
\ 'type': l:match[3] is# 'error'
\ ? 'E' : (l:match[3] is# 'warning' ? 'W' : 'I'),
\ 'text': StripAnsiCodes(l:match[5]),
\ 'code': l:match[4]
\ })
endfor

return l:output
endfunction

function! StripAnsiCodes(line) abort
return substitute(a:line, '\e\[[0-9;]\+[mK]', '', 'g')
endfunction

call ale#linter#Define('bitbake', {
\ 'name': 'oelint_adv',
\ 'output_stream': 'both',
\ 'executable': {b -> ale#Var(b, 'bitbake_oelint_adv_executable')},
\ 'cwd': '%s:h',
\ 'command': function('ale_linters#bitbake#oelint_adv#Command'),
\ 'callback': 'ale_linters#bitbake#oelint_adv#Handle',
\ })
Loading

0 comments on commit fb78133

Please sign in to comment.