mirror of
1
0
Fork 0

Updated plugins

This commit is contained in:
Amir 2023-07-15 12:43:27 +02:00
parent 68cf3c02e2
commit 747d4093f4
52 changed files with 767 additions and 165 deletions

View File

@ -29,10 +29,20 @@ function! ale_linters#ansible#ansible_lint#Handle(buffer, version, lines) abort
for l:issue in l:linter_issues
if ale#path#IsBufferPath(a:buffer, l:issue.location.path)
if exists('l:issue.location.positions')
let l:coord_keyname = 'positions'
else
let l:coord_keyname = 'lines'
endif
let l:column_member = printf(
\ 'l:issue.location.%s.begin.column', l:coord_keyname
\)
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,
\ 'lnum': exists(l:column_member) ? l:issue.location[l:coord_keyname].begin.line :
\ l:issue.location[l:coord_keyname].begin,
\ 'col': exists(l:column_member) ? l:issue.location[l:coord_keyname].begin.column : 0,
\ 'text': l:issue.check_name,
\ 'detail': l:issue.description,
\ 'code': l:issue.severity,

View File

@ -0,0 +1,69 @@
" Author: Carl Smedstad <carl.smedstad at protonmail dot com>
" Description: az_bicep for bicep files
let g:ale_bicep_az_bicep_executable =
\ get(g:, 'ale_bicep_az_bicep_executable', 'az')
let g:ale_bicep_az_bicep_options =
\ get(g:, 'ale_bicep_az_bicep_options', '')
function! ale_linters#bicep#az_bicep#Executable(buffer) abort
return ale#Var(a:buffer, 'bicep_az_bicep_executable')
endfunction
function! ale_linters#bicep#az_bicep#Command(buffer) abort
let l:executable = ale_linters#bicep#az_bicep#Executable(a:buffer)
let l:options = ale#Var(a:buffer, 'bicep_az_bicep_options')
if has('win32')
let l:nullfile = 'NUL'
else
let l:nullfile = '/dev/null'
endif
return ale#Escape(l:executable)
\ . ' bicep build --outfile '
\ . l:nullfile
\ . ' --file '
\ . '%s '
\ . l:options
endfunction
function! ale_linters#bicep#az_bicep#Handle(buffer, lines) abort
let l:pattern = '\v^([A-Z]+)?(:\s)?(.*)\((\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[1] is# 'ERROR'
let l:type = 'E'
elseif l:match[1] is# 'WARNING'
let l:type = 'W'
elseif l:match[6] is# 'Error'
let l:type = 'E'
elseif l:match[6] is# 'Warning'
let l:type = 'W'
else
let l:type = 'I'
endif
call add(l:output, {
\ 'filename': l:match[3],
\ 'lnum': l:match[4] + 0,
\ 'col': l:match[5] + 0,
\ 'type': l:type,
\ 'code': l:match[7],
\ 'text': l:match[8],
\})
endfor
return l:output
endfunction
call ale#linter#Define('bicep', {
\ 'name': 'az_bicep',
\ 'executable': function('ale_linters#bicep#az_bicep#Executable'),
\ 'command': function('ale_linters#bicep#az_bicep#Command'),
\ 'callback': 'ale_linters#bicep#az_bicep#Handle',
\ 'output_stream': 'stderr',
\ 'lint_file': 1,
\})

View File

@ -30,24 +30,25 @@ function! ale_linters#bicep#bicep#Command(buffer) abort
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: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'
if l:match[4] is# 'Error'
let l:type = 'E'
elseif l:match[3] is# 'Warning'
elseif l:match[4] 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,
\ 'filename': l:match[1],
\ 'lnum': l:match[2] + 0,
\ 'col': l:match[3] + 0,
\ 'type': l:type,
\ 'code': l:match[4],
\ 'text': l:match[5],
\ 'code': l:match[5],
\ 'text': l:match[6],
\})
endfor

View File

@ -0,0 +1,40 @@
" Author: Chuck Grindel <chuck.grindel@gmail.com>
" Description: Bazel Starlark lint support using buildifier.
function! ale_linters#bzl#buildifier#GetCommand(buffer) abort
let l:executable = ale#Escape(ale#fixers#buildifier#GetExecutable(a:buffer))
let l:options = ale#Var(a:buffer, 'bazel_buildifier_options')
let l:filename = ale#Escape(bufname(a:buffer))
let l:command = l:executable . ' -mode check -lint warn -path %s'
if l:options isnot# ''
let l:command .= ' ' . l:options
endif
return l:command
endfunction
function! ale_linters#bzl#buildifier#Handle(buffer, lines) abort
let l:pattern = '\v^[^:]+:(\d+):(\d+)?:?\s+(syntax error near)?(.+)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'lnum': l:match[1] + 0,
\ 'col': l:match[2] + 0,
\ 'text': l:match[3] . l:match[4],
\ 'type': l:match[3] is# 'syntax error near' ? 'E' : 'W',
\})
endfor
return l:output
endfunction
call ale#linter#Define('bzl', {
\ 'name': 'buildifier',
\ 'output_stream': 'both',
\ 'executable': function('ale#fixers#buildifier#GetExecutable'),
\ 'command': function('ale_linters#bzl#buildifier#GetCommand'),
\ 'callback': function('ale_linters#bzl#buildifier#Handle'),
\})

View File

@ -0,0 +1,54 @@
" Author: 0xHyoga <0xHyoga@gmx.com>
" Description: Report Starknet compile to sierra errors in cairo 1.0 code
call ale#Set('cairo_sierra_executable', 'starknet-compile')
call ale#Set('cairo_sierra_options', '')
function! ale_linters#cairo#sierra#Handle(buffer, lines) abort
" Matches patterns like the following:
" Error: Expected ';' but got '('
" --> /path/to/file/file.cairo:1:10:)
let l:pattern = '\v(error|warning): (.*)$'
let l:line_and_column_pattern = '\v\.cairo:(\d+):(\d+)'
let l:output = []
for l:line in a:lines
let l:match = matchlist(l:line, l:pattern)
if len(l:match) == 0
let l:match = matchlist(l:line, l:line_and_column_pattern)
if len(l:match) > 0
let l:index = len(l:output) - 1
let l:output[l:index]['lnum'] = l:match[1] + 0
let l:output[l:index]['col'] = l:match[2] + 0
endif
else
let l:isError = l:match[1] is? 'Error'
call add(l:output, {
\ 'lnum': 0,
\ 'col': 0,
\ 'text': l:match[2],
\ 'type': l:isError ? 'E' : 'W',
\})
endif
endfor
return l:output
endfunction
function! ale_linters#cairo#sierra#GetCommand(buffer) abort
let l:executable = ale#Var(a:buffer, 'cairo_sierra_executable')
return l:executable . ale#Pad(ale#Var(a:buffer, 'cairo_sierra_options')) . ' %s'
endfunction
call ale#linter#Define('cairo', {
\ 'name': 'sierra',
\ 'executable': {b -> ale#Var(b, 'cairo_sierra_executable')},
\ 'command': function('ale_linters#cairo#sierra#GetCommand'),
\ 'callback': 'ale_linters#cairo#sierra#Handle',
\ 'output_stream': 'stderr',
\})

View File

@ -1,5 +1,6 @@
" Author: 0xHyoga <0xHyoga@gmx.com>
" Description: Report starknet-compile errors in cairo code
" Description: Report starknet-compile errors in cairo code (pre-starknet
" 1.0). This is deprecated but kept for backwards compatability.
call ale#Set('cairo_starknet_executable', 'starknet-compile')
call ale#Set('cairo_starknet_options', '')
@ -35,3 +36,4 @@ call ale#linter#Define('cairo', {
\ 'callback': 'ale_linters#cairo#starknet#Handle',
\ 'output_stream': 'stderr',
\})

View File

@ -0,0 +1,69 @@
" Author: Shad
" Description: dockerlinter linter for dockerfile
call ale#Set('dockerfile_dockerlinter_executable', 'dockerlinter')
call ale#Set('dockerfile_dockerlinter_options', '')
function! ale_linters#dockerfile#dockerlinter#GetType(type) abort
if a:type is? 'error'
return 'E'
elseif a:type is? 'warning'
return 'W'
endif
return 'I'
endfunction
function! ale_linters#dockerfile#dockerlinter#Handle(buffer, lines) abort
try
let l:data = json_decode(join(a:lines, ''))
catch
return []
endtry
if empty(l:data)
" Should never happen, but it's better to be on the safe side
return []
endif
let l:messages = []
for l:object in l:data
let l:line = get(l:object, 'lineNumber', -1)
let l:message = l:object['message']
let l:type = l:object['level']
let l:detail = l:message
let l:code = l:object['code']
if l:code =~# '^SC'
let l:link = 'https://www.shellcheck.net/wiki/' . l:code
else
let l:link = 'https://github.com/buddy-works/dockerfile-linter/blob/master/Rules.md#' . l:code
endif
let l:detail = l:message . "\n\n" . l:link
call add(l:messages, {
\ 'lnum': l:line,
\ 'code': l:code,
\ 'text': l:message,
\ 'type': ale_linters#dockerfile#dockerlinter#GetType(l:type),
\ 'detail': l:detail,
\})
endfor
return l:messages
endfunction
function! ale_linters#dockerfile#dockerlinter#GetCommand(buffer) abort
return '%e' . ale#Pad(ale#Var(a:buffer, 'dockerfile_dockerlinter_options'))
\ . ' -j -f'
\ . ' %t'
endfunction
call ale#linter#Define('dockerfile', {
\ 'name': 'dockerlinter',
\ 'executable': {b -> ale#Var(b, 'dockerfile_dockerlinter_executable')},
\ 'command': function('ale_linters#dockerfile#dockerlinter#GetCommand'),
\ 'callback': 'ale_linters#dockerfile#dockerlinter#Handle',
\})

View File

@ -11,7 +11,7 @@ function! ale_linters#eruby#erb#GetCommand(buffer) abort
" Rails-flavored eRuby does not comply with the standard as understood by
" ERB, so we'll have to do some substitution. This does not reduce the
" effectiveness of the linter—the translated code is still evaluated.
return 'ruby -r erb -e ' . ale#Escape('puts ERB.new($stdin.read.gsub(%{<%=},%{<%}), nil, %{-}).src') . '< %t | ruby -c'
return 'ruby -r erb -e ' . ale#Escape('puts ERB.new($stdin.read.gsub(%{<%=},%{<%}), trim_mode: %{-}).src') . '< %t | ruby -c'
endfunction
call ale#linter#Define('eruby', {

View File

@ -1,7 +1,7 @@
" Author: Sascha Grunert <mail@saschagrunert.de>
" Description: Adds support of golangci-lint
call ale#Set('go_golangci_lint_options', '--enable-all')
call ale#Set('go_golangci_lint_options', '')
call ale#Set('go_golangci_lint_executable', 'golangci-lint')
call ale#Set('go_golangci_lint_package', 0)

View File

@ -1,21 +0,0 @@
" Author: neersighted <bjorn@neersighted.com>
" Description: golint for Go files
call ale#Set('go_golint_executable', 'golint')
call ale#Set('go_golint_options', '')
function! ale_linters#go#golint#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'go_golint_options')
return ale#go#EnvString(a:buffer) . '%e'
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' %t'
endfunction
call ale#linter#Define('go', {
\ 'name': 'golint',
\ 'output_stream': 'both',
\ 'executable': {b -> ale#Var(b, 'go_golint_executable')},
\ 'command': function('ale_linters#go#golint#GetCommand'),
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
\})

View File

@ -0,0 +1,46 @@
" Author: lucas-str <lucas.sturelle@ik.me>
" Description: Integration of npm-groovy-lint for Groovy files.
call ale#Set('groovy_npmgroovylint_executable', 'npm-groovy-lint')
call ale#Set('groovy_npmgroovylint_options', '--loglevel warning')
function! ale_linters#groovy#npmgroovylint#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'groovy_npmgroovylint_options')
return '%e --failon none --output json'
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' %t'
endfunction
function! ale_linters#groovy#npmgroovylint#Handle(buffer, lines) abort
let l:output = []
let l:json = ale#util#FuzzyJSONDecode(a:lines, {})
for [l:filename, l:file] in items(get(l:json, 'files', {}))
for l:error in get(l:file, 'errors', [])
let l:output_line = {
\ 'filename': l:filename,
\ 'lnum': l:error.line,
\ 'text': l:error.msg,
\ 'type': toupper(l:error.severity[0]),
\}
if has_key(l:error, 'range')
let l:output_line.col = l:error.range.start.character
let l:output_line.end_col = l:error.range.end.character
let l:output_line.end_lnum = l:error.range.end.line
endif
call add(l:output, l:output_line)
endfor
endfor
return l:output
endfunction
call ale#linter#Define('groovy', {
\ 'name': 'npm-groovy-lint',
\ 'executable': {b -> ale#Var(b, 'groovy_npmgroovylint_executable')},
\ 'command': function('ale_linters#groovy#npmgroovylint#GetCommand'),
\ 'callback': 'ale_linters#groovy#npmgroovylint#Handle',
\})

View File

@ -65,7 +65,7 @@ endfunction
function! ale_linters#python#pyright#GetCommand(buffer) abort
let l:executable = ale_linters#python#pyright#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry$'
\ ? ' run pyright'
\ ? ' run pyright-langserver'
\ : ''
let l:env_string = ''

View File

@ -561,6 +561,11 @@ let s:default_registry = {
\ 'suggested_filetypes': ['haskell'],
\ 'description': 'A formatter for Haskell source code.',
\ },
\ 'fourmolu': {
\ 'function': 'ale#fixers#fourmolu#Fix',
\ 'suggested_filetypes': ['haskell'],
\ 'description': 'A formatter for Haskell source code.',
\ },
\ 'jsonnetfmt': {
\ 'function': 'ale#fixers#jsonnetfmt#Fix',
\ 'suggested_filetypes': ['jsonnet'],
@ -605,6 +610,11 @@ let s:default_registry = {
\ 'function': 'ale#fixers#rustywind#Fix',
\ 'suggested_filetypes': ['html'],
\ 'description': 'Sort Tailwind CSS classes',
\ },
\ 'npm-groovy-lint': {
\ 'function': 'ale#fixers#npmgroovylint#Fix',
\ 'suggested_filetypes': ['groovy'],
\ 'description': 'Fix Groovy files with npm-groovy-fix.',
\ }
\}

View File

@ -0,0 +1,20 @@
call ale#Set('haskell_fourmolu_executable', 'fourmolu')
call ale#Set('haskell_fourmolu_options', '')
function! ale#fixers#fourmolu#GetExecutable(buffer) abort
let l:executable = ale#Var(a:buffer, 'haskell_fourmolu_executable')
return ale#handlers#haskell_stack#EscapeExecutable(l:executable, 'fourmolu')
endfunction
function! ale#fixers#fourmolu#Fix(buffer) abort
let l:executable = ale#fixers#fourmolu#GetExecutable(a:buffer)
let l:options = ale#Var(a:buffer, 'haskell_fourmolu_options')
return {
\ 'command': l:executable
\ . (empty(l:options) ? '' : ' ' . l:options)
\ . ' --stdin-input-file '
\ . ale#Escape(@%),
\}
endfunction

View File

@ -0,0 +1,16 @@
" Author: lucas-str <lucas.sturelle@ik.me>
" Description: Integration of npm-groovy-lint for Groovy files.
call ale#Set('groovy_npmgroovylint_fix_options', '--fix')
function! ale#fixers#npmgroovylint#Fix(buffer) abort
let l:executable = ale#Var(a:buffer, 'groovy_npmgroovylint_executable')
let l:options = ale#Var(a:buffer, 'groovy_npmgroovylint_fix_options')
return {
\ 'command': ale#Escape(l:executable)
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' %t',
\ 'read_temporary_file': 1,
\}
endfunction

View File

@ -42,7 +42,8 @@ let s:default_ale_linters = {
\ 'apkbuild': ['apkbuild_lint', 'secfixes_check'],
\ 'csh': ['shell'],
\ 'elixir': ['credo', 'dialyxir', 'dogma'],
\ 'go': ['gofmt', 'golint', 'gopls', 'govet'],
\ 'go': ['gofmt', 'gopls', 'govet'],
\ 'groovy': ['npm-groovy-lint'],
\ 'hack': ['hack'],
\ 'help': [],
\ 'inko': ['inko'],

View File

@ -16,9 +16,28 @@ g:ale_bicep_bicep_executable *g:ale_bicep_bicep_executable*
g:ale_bicep_bicep_options *g:ale_bicep_bicep_options*
*b:ale_bicep_bicep_options*
Type: |String|
Default: `'build --outfile /dev/null'`
Default: `''`
This variable can be set to pass additional options to bicep.
===============================================================================
az_bicep *ale-bicep-az_bicep*
g:ale_bicep_az_bicep_executable *g:ale_bicep_az_bicep_executable*
*b:ale_bicep_az_bicep_executable*
Type: |String|
Default: `'az'`
This variable can be set to change the path to az_bicep.
g:ale_bicep_az_bicep_options *g:ale_bicep_az_bicep_options*
*b:ale_bicep_az_bicep_options*
Type: |String|
Default: `''`
This variable can be set to pass additional options to az_bicep.
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View File

@ -198,8 +198,8 @@ g:ale_c_ccls_init_options *g:ale_c_ccls_init_options*
\ },
\ }
<
Visit https://github.com/MaskRay/ccls/wiki/Initialization-options for all
available options and explanations.
For all available options and explanations, visit
https://github.com/MaskRay/ccls/wiki/Customization#initialization-options.
===============================================================================

View File

@ -25,6 +25,31 @@ g:ale_dockerfile_dockerfile_lint_options
the dockerfile lint invocation - like custom rule file definitions.
===============================================================================
dockerlinter *ale-dockerfile-dockerlinter*
g:ale_dockerfile_dockerlinter_executable
*g:ale_dockerfile_dockerlinter_executable*
*b:ale_dockerfile_dockerlinter_executable*
Type: |String|
Default: `'dockerlinter'`
This variable can be changed to specify the executable used to run
dockerlinter.
g:ale_dockerfile_dockerlinter_options
*g:ale_dockerfile_dockerlinter_options*
*b:ale_dockerfile_dockerlinter_options*
Type: |String|
Default: `''`
This variable can be changed to add additional command-line arguments to
the dockerfile lint invocation - like custom rule file definitions.
dockerlinter
===============================================================================
dprint *ale-dockerfile-dprint*

View File

@ -6,8 +6,8 @@ ALE Go Integration *ale-go-options*
Integration Information
The `gometalinter` linter is disabled by default. ALE enables `gofmt`,
`golint` and `go vet` by default. It also supports `staticcheck`, `go
build`, `gosimple`, `golangserver`.
`gopls`, and `go vet` by default. It also supports `staticcheck, `go
build`, `gosimple`, `golangserver`, and `golangci-lint`.
To enable `gometalinter`, update |g:ale_linters| as appropriate:
>
@ -120,7 +120,7 @@ g:ale_go_golangci_lint_executable *g:ale_go_golangci_lint_executable*
g:ale_go_golangci_lint_options *g:ale_go_golangci_lint_options*
*b:ale_go_golangci_lint_options*
Type: |String|
Default: `'--enable-all'`
Default: `''`
This variable can be changed to alter the command-line arguments to the
golangci-lint invocation.
@ -175,25 +175,6 @@ g:ale_go_golines_options *g:ale_go_golines_options*
--max-length=100 (lines above 100 characters will be wrapped)
===============================================================================
golint *ale-go-golint*
g:ale_go_golint_executable *g:ale_go_golint_executable*
*b:ale_go_golint_executable*
Type: |String|
Default: `'golint'`
This variable can be set to change the golint executable path.
g:ale_go_golint_options *g:ale_go_golint_options*
*b:ale_go_golint_options*
Type: |String|
Default: `''`
This variable can be set to pass additional options to the golint linter.
===============================================================================
gometalinter *ale-go-gometalinter*

View File

@ -0,0 +1,42 @@
===============================================================================
ALE Groovy Integration *ale-groovy-options*
===============================================================================
Integration Information
Linting and fixing of Groovy files is enabled with the integration of
`npm-groovy-lint`.
===============================================================================
npm-groovy-lint *ale-groovy-npm-groovy-lint*
g:ale_groovy_npmgroovylint_executable *g:ale_groovy_npmgroovylint_executable*
*b:ale_groovy_npmgroovylint_executable*
Type: |String|
Default: `'npm-groovy-lint'`
Location of the npm-groovy-lint binary file.
g:ale_groovy_npmgroovylint_options *g:ale_groovy_npmgroovylint_options*
*b:ale_groovy_npmgroovylint_options*
Type: |String|
Default: `'--loglevel warning'`
Additional npm-groovy-lint linter options.
g:ale_groovy_npmgroovylint_fix_options *g:ale_groovy_npmgroovylint_fix_options*
*b:ale_groovy_npmgroovylint_fix_options*
Type: |String|
Default: `'--fix'`
This variable can be used to configure fixing with npm-groovy-lint. It must
contain either `--fix` or `--format` for the fixer to work. See
`npm-groovy-lint --help` for more information on possible fix rules.
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View File

@ -224,5 +224,25 @@ g:ale_haskell_ormolu_options *g:ale_haskell_ormolu_options*
executable.
===============================================================================
fourmolu *ale-haskell-fourmolu*
g:ale_haskell_fourmolu_executable *g:ale_haskell_fourmolu_executable*
*b:ale_haskell_fourmolu_executable*
Type: |String|
Default: `'fourmolu'`
This variable can be changed to use a different executable for fourmolu.
g:ale_haskell_fourmolu_options *g:ale_haskell_fourmolu_options*
*b:ale_haskell_fourmolu_options*
Type: |String|
Default: `''`
This variable can be used to pass extra options to the underlying fourmolu
executable.
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View File

@ -159,6 +159,7 @@ Notes:
* `dhall-lint`
* Dockerfile
* `dockerfile_lint`
* `dockerlinter`
* `dprint`
* `hadolint`
* Elixir
@ -212,7 +213,6 @@ Notes:
* `golangci-lint`!!
* `golangserver`
* `golines`
* `golint`
* `gometalinter`!!
* `gopls`
* `gosimple`!!
@ -223,6 +223,8 @@ Notes:
* `eslint`
* `gqlint`
* `prettier`
* Groovy
* `npm-groovy-lint`
* Hack
* `hack`
* `hackfmt`
@ -236,6 +238,7 @@ Notes:
* `cabal-ghc`
* `cspell`
* `floskell`
* `fourmolu`
* `ghc`
* `ghc-mod`
* `hdevtools`
@ -382,6 +385,7 @@ Notes:
* `nimpretty`
* nix
* `alejandra`
* `deadnix`
* `nix-instantiate`
* `nixfmt`
* `nixpkgs-fmt`

View File

@ -1641,7 +1641,8 @@ g:ale_linters *g:ale_linters*
\ 'apkbuild': ['apkbuild_lint', 'secfixes_check'],
\ 'csh': ['shell'],
\ 'elixir': ['credo', 'dialyxir', 'dogma'],
\ 'go': ['gofmt', 'golint', 'gopls', 'govet'],
\ 'go': ['gofmt', 'gopls', 'govet'],
\ 'groovy': ['npm-groovy-lint'],
\ 'hack': ['hack'],
\ 'help': [],
\ 'inko': ['inko'],
@ -2858,6 +2859,7 @@ documented in additional help files.
bibclean..............................|ale-bib-bibclean|
bicep...................................|ale-bicep-options|
bicep.................................|ale-bicep-bicep|
az_bicep..............................|ale-bicep-az_bicep|
bitbake.................................|ale-bitbake-options|
oelint-adv............................|ale-bitbake-oelint_adv|
c.......................................|ale-c-options|
@ -2939,6 +2941,7 @@ documented in additional help files.
dhall-lint............................|ale-dhall-lint|
dockerfile..............................|ale-dockerfile-options|
dockerfile_lint.......................|ale-dockerfile-dockerfile_lint|
dockerlinter..........................|ale-dockerfile-dockerlinter|
dprint................................|ale-dockerfile-dprint|
hadolint..............................|ale-dockerfile-hadolint|
elixir..................................|ale-elixir-options|
@ -2984,7 +2987,6 @@ documented in additional help files.
golangci-lint.........................|ale-go-golangci-lint|
golangserver..........................|ale-go-golangserver|
golines...............................|ale-go-golines|
golint................................|ale-go-golint|
gometalinter..........................|ale-go-gometalinter|
gopls.................................|ale-go-gopls|
govet.................................|ale-go-govet|
@ -2994,6 +2996,8 @@ documented in additional help files.
eslint................................|ale-graphql-eslint|
gqlint................................|ale-graphql-gqlint|
prettier..............................|ale-graphql-prettier|
groovy..................................|ale-groovy-options|
npm-groovy-lint.......................|ale-groovy-npm-groovy-lint|
hack....................................|ale-hack-options|
hack..................................|ale-hack-hack|
hackfmt...............................|ale-hack-hackfmt|
@ -3018,6 +3022,7 @@ documented in additional help files.
stylish-haskell.......................|ale-haskell-stylish-haskell|
hie...................................|ale-haskell-hie|
ormolu................................|ale-haskell-ormolu|
fourmolu..............................|ale-haskell-fourmolu|
hcl.....................................|ale-hcl-options|
packer-fmt............................|ale-hcl-packer-fmt|
terraform-fmt.........................|ale-hcl-terraform-fmt|

View File

@ -168,6 +168,7 @@ formatting.
* [dhall-lint](https://github.com/dhall-lang/dhall-lang)
* Dockerfile
* [dockerfile_lint](https://github.com/projectatomic/dockerfile_lint)
* [dockerlinter](https://github.com/buddy-works/dockerfile-linter)
* [dprint](https://dprint.dev)
* [hadolint](https://github.com/hadolint/hadolint)
* Elixir
@ -221,7 +222,6 @@ formatting.
* [golangci-lint](https://github.com/golangci/golangci-lint) :warning: :floppy_disk:
* [golangserver](https://github.com/sourcegraph/go-langserver) :warning:
* [golines](https://github.com/segmentio/golines)
* [golint](https://godoc.org/github.com/golang/lint)
* [gometalinter](https://github.com/alecthomas/gometalinter) :warning: :floppy_disk:
* [gopls](https://github.com/golang/go/wiki/gopls)
* [gosimple](https://github.com/dominikh/go-tools/tree/master/cmd/gosimple) :warning: :floppy_disk:
@ -232,6 +232,8 @@ formatting.
* [eslint](http://eslint.org/)
* [gqlint](https://github.com/happylinks/gqlint)
* [prettier](https://github.com/prettier/prettier)
* Groovy
* [npm-groovy-lint](https://github.com/nvuillam/npm-groovy-lint)
* Hack
* [hack](http://hacklang.org/)
* [hackfmt](https://github.com/facebook/hhvm/tree/master/hphp/hack/hackfmt)
@ -245,6 +247,7 @@ formatting.
* [cabal-ghc](https://www.haskell.org/cabal/)
* [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
* [floskell](https://github.com/ennocramer/floskell)
* [fourmolu](https://github.com/fourmolu/fourmolu)
* [ghc](https://www.haskell.org/ghc/)
* [ghc-mod](https://github.com/DanielG/ghc-mod)
* [hdevtools](https://hackage.haskell.org/package/hdevtools)
@ -391,6 +394,7 @@ formatting.
* nimpretty
* nix
* [alejandra](https://github.com/kamadorueda/alejandra)
* [deadnix](https://github.com/astro/deadnix)
* [nix-instantiate](http://nixos.org/nix/manual/#sec-nix-instantiate)
* [nixfmt](https://github.com/serokell/nixfmt)
* [nixpkgs-fmt](https://github.com/nix-community/nixpkgs-fmt)

View File

@ -1,7 +1,7 @@
*bufexplorer.txt* Buffer Explorer Last Change: 20 Sept 2022
*bufexplorer.txt* Buffer Explorer Last Change: 01 May 2023
Buffer Explorer *buffer-explorer* *bufexplorer*
Version 7.4.25
Version 7.4.26
Plugin for easily exploring (or browsing) Vim|:buffers|.
@ -263,6 +263,15 @@ The default is 1.
===============================================================================
CHANGE LOG *bufexplorer-changelog*
7.4.26 May 01, 2023
What's Changed
- wipe explorer buffer on hide by @basharh in
https://github.com/jlanzarotta/bufexplorer/pull/111
New Contributors
- @basharh made their first contribution in
https://github.com/jlanzarotta/bufexplorer/pull/111
Full Changelog
https://github.com/jlanzarotta/bufexplorer/compare/v.7.4.25...v7.4.26
7.4.25 September 20, 2022
What's Changed
- Fix MRU sort order after loading vim session by @mmrwoods in

View File

@ -1,5 +1,5 @@
"============================================================================
" Copyright: Copyright (c) 2001-2022, Jeff Lanzarotta
" Copyright: Copyright (c) 2001-2023, Jeff Lanzarotta
" All rights reserved.
"
" Redistribution and use in source and binary forms, with or
@ -36,7 +36,7 @@
" Name Of File: bufexplorer.vim
" Description: Buffer Explorer Vim Plugin
" Maintainer: Jeff Lanzarotta (my name at gmail dot com)
" Last Changed: Tuesday, 20 Sept 2022
" Last Changed: Monday, 01 May 2023
" Version: See g:bufexplorer_version for version number.
" Usage: This file should reside in the plugin directory and be
" automatically sourced.
@ -74,7 +74,7 @@ endif
"1}}}
" Version number
let g:bufexplorer_version = "7.4.25"
let g:bufexplorer_version = "7.4.26"
" Plugin Code {{{1
" Check for Vim version {{{2
@ -480,13 +480,12 @@ endfunction
" DisplayBufferList {{{2
function! s:DisplayBufferList()
" Do not set bufhidden since it wipes out the data if we switch away from
" the buffer using CTRL-^.
setlocal buftype=nofile
setlocal modifiable
setlocal noreadonly
setlocal noswapfile
setlocal nowrap
setlocal bufhidden=wipe
call s:SetupSyntax()
call s:MapKeys()

@ -1 +0,0 @@
Subproject commit b6e5624351ba735e25eb8864d7d22819aad00606

View File

@ -5,28 +5,32 @@
These are the default instructions using Vim 8's `|packages|` feature. See
sections below, if you use other plugin managers.
1. Create theme folder (in case you don't have yet):
1. Create theme folder (in case you don't have it yet):
- \*nix:
```
# vim 8.2+
mkdir -p ~/.vim/pack/themes/start
# vim 8.0
mkdir -p ~/.vim/pack/themes/opt
```
- Windows: create directory `$HOME\vimfiles\pack\themes\start`
If you use vim 8.0 (and not 8.2), you may need to use `~/.vim/pack/themes/opt`
or `$HOME\vimfiles\pack\themes\opt` instead.
- Windows: create directory `$HOME\vimfiles\pack\themes\start` or
`$HOME\vimfiles\pack\themes\opt`, according to your version.
2. Navigate to the folder above:
- \*nix:
```
# vim 8.2+
cd ~/.vim/pack/themes/start
# vim 8.0
cd ~/.vim/pack/themes/opt
```
- Windows: navigate to `$HOME\vimfiles\pack\themes\start`
- Windows: navigate to the directory you created earlier
3. Clone the repository using the "dracula" name:
@ -38,7 +42,9 @@ git clone https://github.com/dracula/vim.git dracula
4. Edit your `vimrc` file with the following content:
```
packadd! dracula
if v:version < 802
packadd! dracula
endif
syntax enable
colorscheme dracula
```
@ -94,4 +100,6 @@ following in `~/.SpaceVim.d/init.toml`:
Note that dracula must be in your `'runtimepath'` to load properly: Version 2.0
introduced autoload functionality for part of the plugin, which doesn't work
without `'runtimepath'` properly set. Consult your plugin-managers documentation
to make sure you put dracula on the `'runtimepath'` before loading it.
to make sure you put dracula on the `'runtimepath'` before loading it. For
`|packages|`, versions 8.2 and later will autoload `start` packages
correctly even in your vimrc.

View File

@ -56,9 +56,10 @@ if has('nvim-0.5') && luaeval("pcall(require, 'gitsigns')")
hi! link GitSignsChange DiffChange
hi! link GitSignsChangeLn DiffChange
hi! link GitSignsChangeNr DiffChange
hi! link GitSignsDelete DiffDelete
hi! link GitSignsDeleteLn DiffDelete
hi! link GitSignsDeleteNr DiffDelete
hi! link GitSignsDelete DraculaRed
hi! link GitSignsDeleteLn DraculaRed
hi! link GitSignsDeleteNr DraculaRed
endif
" }}}
" Tree-sitter: {{{

View File

@ -15,7 +15,7 @@ setlocal formatoptions-=t formatoptions+=croql
setlocal suffixesadd+=.ts,.tsx
let b:undo_ftplugin = "setl fo< ofu< com< cms<"
let b:undo_ftplugin = "setl cms< fo< sua<"
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@ -117,9 +117,9 @@ There's also a variant for searching and a variant for grepping.
## Coercion
Want to turn `fooBar` into `foo_bar`? Press `crs` (coerce to
snake\_case). MixedCase (`crm`), camelCase (`crc`), UPPER\_CASE (`cru`),
dash-case (`cr-`), dot.case (`cr.`), space case (`cr<space>`), and
Title Case (`crt`) are all just 3 keystrokes away.
snake\_case). MixedCase (`crm`), camelCase (`crc`), UPPER\_CASE
(`cru`), dash-case (`cr-`), and dot.case (`cr.`) are all just 3
keystrokes away.
## Installation

View File

@ -142,10 +142,6 @@ function! s:dotcase(word)
return substitute(s:snakecase(a:word),'_','.','g')
endfunction
function! s:titlecase(word)
return substitute(s:spacecase(a:word), '\(\<\w\)','\=toupper(submatch(1))','g')
endfunction
call extend(Abolish, {
\ 'camelcase': s:function('s:camelcase'),
\ 'mixedcase': s:function('s:mixedcase'),
@ -154,7 +150,6 @@ call extend(Abolish, {
\ 'dashcase': s:function('s:dashcase'),
\ 'dotcase': s:function('s:dotcase'),
\ 'spacecase': s:function('s:spacecase'),
\ 'titlecase': s:function('s:titlecase')
\ }, 'keep')
function! s:create_dictionary(lhs,rhs,opts)
@ -574,7 +569,6 @@ call extend(Abolish.Coercions, {
\ 'k': Abolish.dashcase,
\ '.': Abolish.dotcase,
\ ' ': Abolish.spacecase,
\ 't': Abolish.titlecase,
\ "function missing": s:function("s:unknown_coercion")
\}, "keep")

View File

@ -3188,12 +3188,12 @@ function! fugitive#BufReadCmd(...) abort
setlocal bufhidden=delete
endif
let &l:modifiable = modifiable
call fugitive#MapJumps()
if b:fugitive_type !=# 'blob'
setlocal filetype=git
call s:Map('n', 'a', ":<C-U>let b:fugitive_display_format += v:count1<Bar>exe fugitive#BufReadCmd(@%)<CR>", '<silent>')
call s:Map('n', 'i', ":<C-U>let b:fugitive_display_format -= v:count1<Bar>exe fugitive#BufReadCmd(@%)<CR>", '<silent>')
setlocal filetype=git
endif
call fugitive#MapJumps()
endtry
setlocal modifiable
@ -4265,7 +4265,7 @@ function! s:ReloadStatusBuffer(...) abort
endif
let original_lnum = a:0 ? a:1 : line('.')
let info = s:StageInfo(original_lnum)
call fugitive#BufReadStatus(0)
exe fugitive#BufReadStatus(0)
call setpos('.', [0, s:StageSeek(info, original_lnum), 1, 0])
return ''
endfunction

View File

@ -23,7 +23,7 @@ function! FugitiveGitDir(...) abort
return g:fugitive_event
endif
let dir = get(b:, 'git_dir', '')
if empty(dir) && (empty(bufname('')) || &buftype =~# '^\%(nofile\|acwrite\|quickfix\|terminal\|prompt\)$')
if empty(dir) && (empty(bufname('')) && &filetype !=# 'netrw' || &buftype =~# '^\%(nofile\|acwrite\|quickfix\|terminal\|prompt\)$')
return FugitiveExtractGitDir(getcwd())
elseif (!exists('b:git_dir') || b:git_dir =~# s:bad_git_dir) && &buftype =~# '^\%(nowrite\)\=$'
let b:git_dir = FugitiveExtractGitDir(bufnr(''))
@ -425,6 +425,9 @@ function! FugitiveExtractGitDir(path) abort
return get(a:path, 'fugitive_dir', get(a:path, 'git_dir', ''))
elseif type(a:path) == type(0)
let path = s:Slash(a:path > 0 ? bufname(a:path) : bufname(''))
if getbufvar(a:path, '&filetype') ==# 'netrw'
let path = s:Slash(getbufvar(a:path, 'netrw_curdir', path))
endif
else
let path = s:Slash(a:path)
endif

View File

@ -23,6 +23,7 @@ Features:
* Provides fold text showing whether folded lines have been changed.
* Can load all hunk locations into quickfix list or the current window's location list.
* Handles line endings correctly, even with repos that do CRLF conversion.
* Handles clean/smudge filters.
* Optional line highlighting.
* Optional line number highlighting. (Only available in Neovim 0.3.2 or higher)
* Fully customisable (signs, sign column, line (number) highlights, mappings, extra git-diff arguments, etc).
@ -54,7 +55,7 @@ In the screenshot above you can see:
### Installation
Install using your favourite package manager, or use Vim's built-in package support.
First, install using your favourite package manager, or use Vim's built-in package support.
Vim:
@ -67,7 +68,6 @@ vim -u NONE -c "helptags vim-gitgutter/doc" -c q
Neovim:
```
mkdir -p ~/.config/nvim/pack/airblade/start
cd ~/.config/nvim/pack/airblade/start
@ -75,6 +75,12 @@ git clone https://github.com/airblade/vim-gitgutter.git
nvim -u NONE -c "helptags vim-gitgutter/doc" -c q
```
Second, ensure your `updatetime` and `signcolumn` options are set appropriately.
When you make a change to a file tracked by git, the diff markers should appear automatically after a short delay. The delay is governed by vim's `updatetime` option; the default value is `4000`, i.e. 4 seconds, but I suggest reducing it to around 100ms (add `set updatetime=100` to your vimrc). Note `updatetime` also controls the delay before vim writes its swap file (see `:help updatetime`).
The `signcolumn` option can have any value except `'off'`.
### Windows
@ -92,7 +98,7 @@ Unfortunately I don't know the correct escaping for the path - if you do, please
### Getting started
When you make a change to a file tracked by git, the diff markers should appear automatically. The delay is governed by vim's `updatetime` option; the default value is `4000`, i.e. 4 seconds, but I suggest reducing it to around 100ms (add `set updatetime=100` to your vimrc). Note `updatetime` also controls the delay before vim writes its swap file (see `:help updatetime`).
When you make a change to a file tracked by git, the diff markers should appear automatically after a short delay.
You can jump between hunks with `[c` and `]c`. You can preview, stage, and undo hunks with `<leader>hp`, `<leader>hs`, and `<leader>hu` respectively.
@ -375,7 +381,7 @@ Similarly to the signs' colours, set up the following highlight groups in your c
GitGutterAddLine " default: links to DiffAdd
GitGutterChangeLine " default: links to DiffChange
GitGutterDeleteLine " default: links to DiffDelete
GitGutterChangeDeleteLine " default: links to GitGutterChangeLineDefault, i.e. DiffChange
GitGutterChangeDeleteLine " default: links to GitGutterChangeLine, i.e. DiffChange
```
For example, in some colorschemes the `DiffText` highlight group is easier to read than `DiffChange`. You could use it like this:
@ -395,7 +401,7 @@ Similarly to the signs' colours, set up the following highlight groups in your c
GitGutterAddLineNr " default: links to CursorLineNr
GitGutterChangeLineNr " default: links to CursorLineNr
GitGutterDeleteLineNr " default: links to CursorLineNr
GitGutterChangeDeleteLineNr " default: links to CursorLineNr
GitGutterChangeDeleteLineNr " default: links to GitGutterChangeLineNr
```
Maybe you think `CursorLineNr` is a bit annoying. For example, you could use `Underlined` for this:
@ -747,5 +753,4 @@ Copyright Andrew Stewart, AirBlade Software Ltd. Released under the MIT licence
[pathogen]: https://github.com/tpope/vim-pathogen
[siv]: http://pluralsight.com/training/Courses/TableOfContents/smash-into-vim
[airblade]: http://airbladesoftware.com/peepcode-vim
[terminus]: https://github.com/wincent/terminus

View File

@ -46,6 +46,8 @@ function! gitgutter#process_buffer(bufnr, force) abort
call gitgutter#debug#log('Not tracked: '.gitgutter#utility#file(a:bufnr))
catch /gitgutter assume unchanged/
call gitgutter#debug#log('Assume unchanged: '.gitgutter#utility#file(a:bufnr))
catch /gitgutter file unknown in base/
let diff = gitgutter#diff#hunk_header_showing_every_line_added(a:bufnr)
catch /gitgutter diff failed/
call gitgutter#debug#log('Diff failed: '.gitgutter#utility#file(a:bufnr))
call gitgutter#hunk#reset(a:bufnr)
@ -117,6 +119,16 @@ endfunction
" }}}
function! gitgutter#git()
if empty(g:gitgutter_git_args)
return g:gitgutter_git_executable
else
return g:gitgutter_git_executable.' '.g:gitgutter_git_args
endif
endfunction
function! gitgutter#setup_maps()
if !g:gitgutter_map_keys
return
@ -193,14 +205,14 @@ endfunction
" - it ignores unsaved changes in buffers
" - it does not change to the repo root
function! gitgutter#quickfix(current_file)
let cmd = g:gitgutter_git_executable.' '.g:gitgutter_git_args.' rev-parse --show-cdup'
let cmd = gitgutter#git().' rev-parse --show-cdup'
let path_to_repo = get(systemlist(cmd), 0, '')
if !empty(path_to_repo) && path_to_repo[-1:] != '/'
let path_to_repo .= '/'
endif
let locations = []
let cmd = g:gitgutter_git_executable.' '.g:gitgutter_git_args.' --no-pager'.
let cmd = gitgutter#git().' --no-pager'.
\ ' diff --no-ext-diff --no-color -U0'.
\ ' --src-prefix=a/'.path_to_repo.' --dst-prefix=b/'.path_to_repo.' '.
\ g:gitgutter_diff_args. ' '. g:gitgutter_diff_base
@ -249,7 +261,7 @@ function! gitgutter#difforig()
if g:gitgutter_diff_relative_to ==# 'index'
let index_name = gitgutter#utility#get_diff_base(bufnr).':'.path
let cmd = gitgutter#utility#cd_cmd(bufnr,
\ g:gitgutter_git_executable.' '.g:gitgutter_git_args.' --no-pager show '.index_name
\ gitgutter#git().' --no-pager show '.index_name
\ )
" NOTE: this uses &shell to execute cmd. Perhaps we should use instead
" gitgutter#utility's use_known_shell() / restore_shell() functions.

View File

@ -75,23 +75,21 @@ function! gitgutter#debug#log(message, ...) abort
endif
endif
execute 'redir >> '.s:log_file
if s:new_log_session
let s:start = reltime()
silent echo "\n==== start log session ===="
endif
if s:new_log_session
let s:start = reltime()
call writefile(['', '========== start log session '.strftime('%d.%m.%Y %H:%M:%S').' =========='], s:log_file, 'a')
endif
let elapsed = reltimestr(reltime(s:start)).' '
silent echo ''
" callers excluding this function
silent echo elapsed.expand('<sfile>')[:-22].':'
silent echo elapsed.s:format_for_log(a:message)
if a:0 && !empty(a:1)
for msg in a:000
silent echo elapsed.s:format_for_log(msg)
endfor
endif
redir END
let elapsed = reltimestr(reltime(s:start)).' '
call writefile([''], s:log_file, 'a')
" callers excluding this function
call writefile([elapsed.expand('<sfile>')[:-22].':'], s:log_file, 'a')
call writefile([elapsed.s:format_for_log(a:message)], s:log_file, 'a')
if a:0 && !empty(a:1)
for msg in a:000
call writefile([elapsed.s:format_for_log(msg)], s:log_file, 'a')
endfor
endif
let s:new_log_session = 0
endif

View File

@ -6,7 +6,7 @@ let s:hunk_re = '^@@ -\(\d\+\),\?\(\d*\) +\(\d\+\),\?\(\d*\) @@'
" True for git v1.7.2+.
function! s:git_supports_command_line_config_override() abort
call gitgutter#utility#system(g:gitgutter_git_executable.' '.g:gitgutter_git_args.' -c foo.bar=baz --version')
call gitgutter#utility#system(gitgutter#git().' -c foo.bar=baz --version')
return !v:shell_error
endfunction
@ -81,6 +81,20 @@ function! gitgutter#diff#run_diff(bufnr, from, preserve_full_diff) abort
throw 'gitgutter assume unchanged'
endif
" If we are diffing against a specific branch/commit, handle the case
" where a file exists on the current branch but not in/at the diff base.
" We have to handle it here because the approach below (using git-show)
" doesn't work for this case.
if !empty(g:gitgutter_diff_base)
let index_name = gitgutter#utility#get_diff_base(a:bufnr).':'.gitgutter#utility#repo_path(a:bufnr, 1)
let cmd = gitgutter#git().' --no-pager show '.index_name
let cmd = gitgutter#utility#cd_cmd(a:bufnr, cmd)
call gitgutter#utility#system(cmd)
if v:shell_error
throw 'gitgutter file unknown in base'
endif
endif
" Wrap compound commands in parentheses to make Windows happy.
" bash doesn't mind the parentheses.
let cmd = '('
@ -124,14 +138,14 @@ function! gitgutter#diff#run_diff(bufnr, from, preserve_full_diff) abort
" Write file from index to temporary file.
let index_name = gitgutter#utility#get_diff_base(a:bufnr).':'.gitgutter#utility#repo_path(a:bufnr, 1)
let cmd .= g:gitgutter_git_executable.' '.g:gitgutter_git_args.' --no-pager show '.index_name.' > '.from_file.' && '
let cmd .= gitgutter#git().' --no-pager show --textconv '.index_name.' > '.from_file.' && '
elseif a:from ==# 'working_tree'
let from_file = gitgutter#utility#repo_path(a:bufnr, 1)