mirror of
https://github.com/dense-analysis/ale.git
synced 2026-02-02 16:15:42 +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:
@@ -8,13 +8,51 @@ Integration Information
|
||||
To enable `.proto` file linting, update |g:ale_linters| as appropriate:
|
||||
>
|
||||
" Enable linter for .proto files
|
||||
let g:ale_linters = {'proto': ['protoc-gen-lint', 'protolint']}
|
||||
let g:ale_linters = {'proto': ['buf-lint', 'protoc-gen-lint', 'protolint']}
|
||||
|
||||
To enable `.proto` file fixing, update |g:ale_fixers| as appropriate:
|
||||
>
|
||||
" Enable linter for .proto files
|
||||
let b:ale_fixers = {'proto': ['protolint']}
|
||||
let b:ale_fixers = {'proto': ['buf-format', '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*
|
||||
|
||||
|
||||
@@ -430,6 +430,8 @@ Notes:
|
||||
* Prolog
|
||||
* `swipl`
|
||||
* proto
|
||||
* `buf-format`!!
|
||||
* `buf-lint`!!
|
||||
* `protoc-gen-lint`!!
|
||||
* `protolint`!!
|
||||
* Pug
|
||||
|
||||
@@ -3060,6 +3060,8 @@ documented in additional help files.
|
||||
prolog..................................|ale-prolog-options|
|
||||
swipl.................................|ale-prolog-swipl|
|
||||
proto...................................|ale-proto-options|
|
||||
buf-format............................|ale-proto-buf-format|
|
||||
buf-lint..............................|ale-proto-buf-lint|
|
||||
protoc-gen-lint.......................|ale-proto-protoc-gen-lint|
|
||||
protolint.............................|ale-proto-protolint|
|
||||
pug.....................................|ale-pug-options|
|
||||
|
||||
Reference in New Issue
Block a user