mirror of
https://github.com/dense-analysis/ale.git
synced 2026-07-30 03:42:52 +08:00
Support astgrep (#4975)
CI / Build (push) Canceled after 0s
CI / Neovim 0.10 Windows (push) Canceled after 0s
CI / Neovim 0.12 Windows (push) Canceled after 0s
CI / Vim 8.2 Windows (push) Canceled after 0s
CI / Vim 9.2 Windows (push) Canceled after 0s
CI / Lint (push) Canceled after 0s
CI / Lua (push) Canceled after 0s
CI / Neovim 0.10 Linux (push) Canceled after 0s
CI / Neovim 0.12 Linux (push) Canceled after 0s
CI / Vim 8.2 Linux (push) Canceled after 0s
CI / Vim 9.2 Linux (push) Canceled after 0s
CI / Build (push) Canceled after 0s
CI / Neovim 0.10 Windows (push) Canceled after 0s
CI / Neovim 0.12 Windows (push) Canceled after 0s
CI / Vim 8.2 Windows (push) Canceled after 0s
CI / Vim 9.2 Windows (push) Canceled after 0s
CI / Lint (push) Canceled after 0s
CI / Lua (push) Canceled after 0s
CI / Neovim 0.10 Linux (push) Canceled after 0s
CI / Neovim 0.12 Linux (push) Canceled after 0s
CI / Vim 8.2 Linux (push) Canceled after 0s
CI / Vim 9.2 Linux (push) Canceled after 0s
* astgrep: support its LSP Fixes: #4974 * astgrep: add a fixer
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
Before:
|
||||
Save g:ale_astgrep_executable
|
||||
Save g:ale_astgrep_scan_options
|
||||
|
||||
After:
|
||||
Restore
|
||||
|
||||
Execute(The ast-grep callback should return the correct default values):
|
||||
AssertEqual
|
||||
\ {
|
||||
\ 'command': ale#Escape('ast-grep') . ' scan --update-all %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\ },
|
||||
\ ale#fixers#astgrep#Fix(bufnr(''))
|
||||
|
||||
Execute(The astgrep executable and options should be configurable):
|
||||
let g:ale_astgrep_executable = '/path/to/ast-grep'
|
||||
let g:ale_astgrep_scan_options = '--interactive'
|
||||
|
||||
AssertEqual
|
||||
\ {
|
||||
\ 'command': ale#Escape('/path/to/ast-grep')
|
||||
\ . ' scan'
|
||||
\ . ' --interactive %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\ },
|
||||
\ ale#fixers#astgrep#Fix(bufnr(''))
|
||||
Reference in New Issue
Block a user