mirror of
https://github.com/dense-analysis/ale.git
synced 2026-02-03 08:32:50 +08:00
Add buf linter and fixer (#4128)
* Add buf lint to linters * Add buf format to fixers * Fix test/linter/test_buf_lint.vader * Fix test/fixers/test_buf_format_fixer_callback.vader * Simplify test/test-files/proto/testfile.proto * Add buf-lint alias and rename linter
This commit is contained in:
@@ -37,6 +37,11 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['python'],
|
||||
\ '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': {
|
||||
\ 'function': 'ale#fixers#buildifier#Fix',
|
||||
\ 'suggested_filetypes': ['bzl'],
|
||||
|
||||
12
autoload/ale/fixers/buf_format.vim
Normal file
12
autoload/ale/fixers/buf_format.vim
Normal file
@@ -0,0 +1,12 @@
|
||||
" 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
|
||||
Reference in New Issue
Block a user