mirror of
https://github.com/dense-analysis/ale.git
synced 2026-08-02 14:10:24 +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,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for c files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('c')
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for cpp files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('cpp')
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for cs files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('cs')
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for css files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('css')
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for elixir files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('elixir')
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for go files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('go')
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for haskell files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('haskell')
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for html files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('html')
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for java files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('java')
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for javascript files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('javascript')
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for json files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('json')
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for kotlin files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('kotlin')
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for lua files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('lua')
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for nix files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('nix')
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for php files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('php')
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for python files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('python')
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for ruby files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('ruby')
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for rust files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('rust')
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for scala files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('scala')
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for sh files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('sh')
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for solidity files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('solidity')
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for swift files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('swift')
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for tsx files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('tsx')
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for typescript files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('typescript')
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for yaml files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('yaml')
|
||||||
@@ -22,6 +22,11 @@ let s:default_registry = {
|
|||||||
\ 'suggested_filetypes': ['apkbuild'],
|
\ 'suggested_filetypes': ['apkbuild'],
|
||||||
\ 'description': 'Fix policy violations found by apkbuild-lint in APKBUILDs',
|
\ 'description': 'Fix policy violations found by apkbuild-lint in APKBUILDs',
|
||||||
\ },
|
\ },
|
||||||
|
\ 'ast-grep': {
|
||||||
|
\ 'function': 'ale#fixers#astgrep#Fix',
|
||||||
|
\ 'suggested_filetypes': ['c', 'cpp', 'cs', 'css', 'elixer', 'go', 'haskell', 'html', 'java', 'javascript', 'json', 'kotlin', 'lua', 'nix', 'php', 'python', 'ruby', 'rust', 'scala', 'sh', 'solidity', 'swift', 'tsx', 'typescript', 'yaml'],
|
||||||
|
\ 'description': 'Apply ast-grep rules.',
|
||||||
|
\ },
|
||||||
\ 'autoimport': {
|
\ 'autoimport': {
|
||||||
\ 'function': 'ale#fixers#autoimport#Fix',
|
\ 'function': 'ale#fixers#autoimport#Fix',
|
||||||
\ 'suggested_filetypes': ['python'],
|
\ 'suggested_filetypes': ['python'],
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: Fix files with `ast-grep`.
|
||||||
|
|
||||||
|
call ale#Set('astgrep_executable', 'ast-grep')
|
||||||
|
call ale#Set('astgrep_scan_options', '--update-all')
|
||||||
|
|
||||||
|
function! ale#fixers#astgrep#Fix(buffer) abort
|
||||||
|
let l:executable = ale#Var(a:buffer, 'astgrep_executable')
|
||||||
|
let l:options = ale#Var(a:buffer, 'astgrep_scan_options')
|
||||||
|
|
||||||
|
return {
|
||||||
|
\ 'command': ale#Escape(l:executable)
|
||||||
|
\ . ' scan'
|
||||||
|
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||||
|
\ . ' %t',
|
||||||
|
\ 'read_temporary_file': 1,
|
||||||
|
\}
|
||||||
|
endfunction
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: A CLI tool for code structural search, lint and rewriting
|
||||||
|
|
||||||
|
call ale#Set('astgrep_executable', 'ast-grep')
|
||||||
|
|
||||||
|
function! ale#handlers#astgrep#GetCommand(buffer) abort
|
||||||
|
return '%e lsp'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale#handlers#astgrep#GetProjectRoot(buffer) abort
|
||||||
|
" Try to find nearest sgconfig.yml
|
||||||
|
let l:sgconfig_file = ale#path#FindNearestFile(a:buffer, 'sgconfig.yml')
|
||||||
|
|
||||||
|
if !empty(l:sgconfig_file)
|
||||||
|
return fnamemodify(l:sgconfig_file . '/', ':p:h:h')
|
||||||
|
endif
|
||||||
|
|
||||||
|
return ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale#handlers#astgrep#Define(lang) abort
|
||||||
|
call ale#linter#Define(a:lang, {
|
||||||
|
\ 'name': 'astgrep',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'astgrep_executable')},
|
||||||
|
\ 'command': function('ale#handlers#astgrep#GetCommand'),
|
||||||
|
\ 'project_root': function('ale#handlers#astgrep#GetProjectRoot'),
|
||||||
|
\})
|
||||||
|
endfunction
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
===============================================================================
|
||||||
|
ALE Generic Integration *ale-generic-options*
|
||||||
|
*ale-integration-generic*
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
Integration Information
|
||||||
|
|
||||||
|
Some tools are not language specific. This document collects information on
|
||||||
|
ale's support for these tools.
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
astgrep *ale-generic-astgrep*
|
||||||
|
|
||||||
|
`'ast-grep'` is a tool which can detect code patterns and offer fixes based
|
||||||
|
on various languages' abstract syntax trees (ASTs) using tree-sitter.
|
||||||
|
|
||||||
|
*ale-options.astgrep_executable*
|
||||||
|
*g:ale_astgrep_executable*
|
||||||
|
*b:ale_astgrep_executable*
|
||||||
|
astgrep_executable
|
||||||
|
g:ale_astgrep_executable
|
||||||
|
Type: |String|
|
||||||
|
Default: `'ast-grep'`
|
||||||
|
|
||||||
|
This variable can be modified to change the executable path for
|
||||||
|
`ast-grep`.
|
||||||
|
|
||||||
|
|
||||||
|
*ale-options.astgrep_scan_options*
|
||||||
|
*g:ale_astgrep_scan_options*
|
||||||
|
*b:ale_astgrep_scan_options*
|
||||||
|
astgrep_scan_options
|
||||||
|
g:ale_astgrep_scan_options
|
||||||
|
Type: |String|
|
||||||
|
Default: `'--update-all'`
|
||||||
|
|
||||||
|
This variable can be modified to change the options when applying rules with
|
||||||
|
the `ast-grep scan` command.
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||||
@@ -231,6 +231,8 @@ Notes:
|
|||||||
* `proselint`
|
* `proselint`
|
||||||
* FusionScript
|
* FusionScript
|
||||||
* `fusion-lint`
|
* `fusion-lint`
|
||||||
|
* Generic
|
||||||
|
* `ast-grep`
|
||||||
* Git Commit Messages
|
* Git Commit Messages
|
||||||
* `gitlint`
|
* `gitlint`
|
||||||
* Gleam
|
* Gleam
|
||||||
|
|||||||
@@ -3593,6 +3593,8 @@ documented in additional help files.
|
|||||||
fountain................................|ale-fountain-options|
|
fountain................................|ale-fountain-options|
|
||||||
fusionscript............................|ale-fuse-options|
|
fusionscript............................|ale-fuse-options|
|
||||||
fusion-lint...........................|ale-fuse-fusionlint|
|
fusion-lint...........................|ale-fuse-fusionlint|
|
||||||
|
generic.................................|ale-generic-options|
|
||||||
|
astgrep...............................|ale-generic-astgrep|
|
||||||
git commit..............................|ale-gitcommit-options|
|
git commit..............................|ale-gitcommit-options|
|
||||||
gitlint...............................|ale-gitcommit-gitlint|
|
gitlint...............................|ale-gitcommit-gitlint|
|
||||||
gleam...................................|ale-gleam-options|
|
gleam...................................|ale-gleam-options|
|
||||||
|
|||||||
@@ -241,6 +241,8 @@ formatting.
|
|||||||
* [proselint](http://proselint.com/)
|
* [proselint](http://proselint.com/)
|
||||||
* FusionScript
|
* FusionScript
|
||||||
* [fusion-lint](https://github.com/RyanSquared/fusionscript)
|
* [fusion-lint](https://github.com/RyanSquared/fusionscript)
|
||||||
|
* Generic
|
||||||
|
* [ast-grep](https://ast-grep.github.io/)
|
||||||
* Git Commit Messages
|
* Git Commit Messages
|
||||||
* [gitlint](https://github.com/jorisroovers/gitlint)
|
* [gitlint](https://github.com/jorisroovers/gitlint)
|
||||||
* Gleam
|
* Gleam
|
||||||
|
|||||||
@@ -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(''))
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
Before:
|
||||||
|
call ale#assert#SetUpLinterTest('c', 'astgrep')
|
||||||
|
|
||||||
|
After:
|
||||||
|
call ale#assert#TearDownLinterTest()
|
||||||
|
|
||||||
|
Execute(The default executable path should be correct):
|
||||||
|
AssertLinter 'ast-grep', ale#Escape('ast-grep') . ' lsp'
|
||||||
|
|
||||||
|
Execute(The project root should be detected correctly with a configuration file):
|
||||||
|
call ale#test#SetFilename('../test-files/generic/astgrep/subdir/file.c')
|
||||||
|
|
||||||
|
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/generic/astgrep')
|
||||||
|
|
||||||
|
Execute(The project root should be empty when no project files can be detected):
|
||||||
|
call ale#test#SetFilename('../test-files/dummy')
|
||||||
|
|
||||||
|
AssertLSPProject ''
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
Before:
|
||||||
|
call ale#assert#SetUpLinterTest('cpp', 'astgrep')
|
||||||
|
|
||||||
|
After:
|
||||||
|
call ale#assert#TearDownLinterTest()
|
||||||
|
|
||||||
|
Execute(The default executable path should be correct):
|
||||||
|
AssertLinter 'ast-grep', ale#Escape('ast-grep') . ' lsp'
|
||||||
|
|
||||||
|
Execute(The project root should be detected correctly with a configuration file):
|
||||||
|
call ale#test#SetFilename('../test-files/generic/astgrep/subdir/file.cpp')
|
||||||
|
|
||||||
|
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/generic/astgrep')
|
||||||
|
|
||||||
|
Execute(The project root should be empty when no project files can be detected):
|
||||||
|
call ale#test#SetFilename('../test-files/dummy')
|
||||||
|
|
||||||
|
AssertLSPProject ''
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
Before:
|
||||||
|
call ale#assert#SetUpLinterTest('cs', 'astgrep')
|
||||||
|
|
||||||
|
After:
|
||||||
|
call ale#assert#TearDownLinterTest()
|
||||||
|
|
||||||
|
Execute(The default executable path should be correct):
|
||||||
|
AssertLinter 'ast-grep', ale#Escape('ast-grep') . ' lsp'
|
||||||
|
|
||||||
|
Execute(The project root should be detected correctly with a configuration file):
|
||||||
|
call ale#test#SetFilename('../test-files/generic/astgrep/subdir/file.cs')
|
||||||
|
|
||||||
|
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/generic/astgrep')
|
||||||
|
|
||||||
|
Execute(The project root should be empty when no project files can be detected):
|
||||||
|
call ale#test#SetFilename('../test-files/dummy')
|
||||||
|
|
||||||
|
AssertLSPProject ''
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
Before:
|
||||||
|
call ale#assert#SetUpLinterTest('css', 'astgrep')
|
||||||
|
|
||||||
|
After:
|
||||||
|
call ale#assert#TearDownLinterTest()
|
||||||
|
|
||||||
|
Execute(The default executable path should be correct):
|
||||||
|
AssertLinter 'ast-grep', ale#Escape('ast-grep') . ' lsp'
|
||||||
|
|
||||||
|
Execute(The project root should be detected correctly with a configuration file):
|
||||||
|
call ale#test#SetFilename('../test-files/generic/astgrep/subdir/file.css')
|
||||||
|
|
||||||
|
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/generic/astgrep')
|
||||||
|
|
||||||
|
Execute(The project root should be empty when no project files can be detected):
|
||||||
|
call ale#test#SetFilename('../test-files/dummy')
|
||||||
|
|
||||||
|
AssertLSPProject ''
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
Before:
|
||||||
|
call ale#assert#SetUpLinterTest('elixir', 'astgrep')
|
||||||
|
|
||||||
|
After:
|
||||||
|
call ale#assert#TearDownLinterTest()
|
||||||
|
|
||||||
|
Execute(The default executable path should be correct):
|
||||||
|
AssertLinter 'ast-grep', ale#Escape('ast-grep') . ' lsp'
|
||||||
|
|
||||||
|
Execute(The project root should be detected correctly with a configuration file):
|
||||||
|
call ale#test#SetFilename('../test-files/generic/astgrep/subdir/file.ex')
|
||||||
|
|
||||||
|
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/generic/astgrep')
|
||||||
|
|
||||||
|
Execute(The project root should be empty when no project files can be detected):
|
||||||
|
call ale#test#SetFilename('../test-files/dummy')
|
||||||
|
|
||||||
|
AssertLSPProject ''
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
Before:
|
||||||
|
call ale#assert#SetUpLinterTest('go', 'astgrep')
|
||||||
|
|
||||||
|
After:
|
||||||
|
call ale#assert#TearDownLinterTest()
|
||||||
|
|
||||||
|
Execute(The default executable path should be correct):
|
||||||
|
AssertLinter 'ast-grep', ale#Escape('ast-grep') . ' lsp'
|
||||||
|
|
||||||
|
Execute(The project root should be detected correctly with a configuration file):
|
||||||
|
call ale#test#SetFilename('../test-files/generic/astgrep/subdir/file.go')
|
||||||
|
|
||||||
|
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/generic/astgrep')
|
||||||
|
|
||||||
|
Execute(The project root should be empty when no project files can be detected):
|
||||||
|
call ale#test#SetFilename('../test-files/dummy')
|
||||||
|
|
||||||
|
AssertLSPProject ''
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
Before:
|
||||||
|
call ale#assert#SetUpLinterTest('haskell', 'astgrep')
|
||||||
|
|
||||||
|
After:
|
||||||
|
call ale#assert#TearDownLinterTest()
|
||||||
|
|
||||||
|
Execute(The default executable path should be correct):
|
||||||
|
AssertLinter 'ast-grep', ale#Escape('ast-grep') . ' lsp'
|
||||||
|
|
||||||
|
Execute(The project root should be detected correctly with a configuration file):
|
||||||
|
call ale#test#SetFilename('../test-files/generic/astgrep/subdir/file.hs')
|
||||||
|
|
||||||
|
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/generic/astgrep')
|
||||||
|
|
||||||
|
Execute(The project root should be empty when no project files can be detected):
|
||||||
|
call ale#test#SetFilename('../test-files/dummy')
|
||||||
|
|
||||||
|
AssertLSPProject ''
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
Before:
|
||||||
|
call ale#assert#SetUpLinterTest('html', 'astgrep')
|
||||||
|
|
||||||
|
After:
|
||||||
|
call ale#assert#TearDownLinterTest()
|
||||||
|
|
||||||
|
Execute(The default executable path should be correct):
|
||||||
|
AssertLinter 'ast-grep', ale#Escape('ast-grep') . ' lsp'
|
||||||
|
|
||||||
|
Execute(The project root should be detected correctly with a configuration file):
|
||||||
|
call ale#test#SetFilename('../test-files/generic/astgrep/subdir/file.html')
|
||||||
|
|
||||||
|
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/generic/astgrep')
|
||||||
|
|
||||||
|
Execute(The project root should be empty when no project files can be detected):
|
||||||
|
call ale#test#SetFilename('../test-files/dummy')
|
||||||
|
|
||||||
|
AssertLSPProject ''
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
Before:
|
||||||
|
call ale#assert#SetUpLinterTest('java', 'astgrep')
|
||||||
|
|
||||||
|
After:
|
||||||
|
call ale#assert#TearDownLinterTest()
|
||||||
|
|
||||||
|
Execute(The default executable path should be correct):
|
||||||
|
AssertLinter 'ast-grep', ale#Escape('ast-grep') . ' lsp'
|
||||||
|
|
||||||
|
Execute(The project root should be detected correctly with a configuration file):
|
||||||
|
call ale#test#SetFilename('../test-files/generic/astgrep/subdir/file.java')
|
||||||
|
|
||||||
|
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/generic/astgrep')
|
||||||
|
|
||||||
|
Execute(The project root should be empty when no project files can be detected):
|
||||||
|
call ale#test#SetFilename('../test-files/dummy')
|
||||||
|
|
||||||
|
AssertLSPProject ''
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
Before:
|
||||||
|
call ale#assert#SetUpLinterTest('javascript', 'astgrep')
|
||||||
|
|
||||||
|
After:
|
||||||
|
call ale#assert#TearDownLinterTest()
|
||||||
|
|
||||||
|
Execute(The default executable path should be correct):
|
||||||
|
AssertLinter 'ast-grep', ale#Escape('ast-grep') . ' lsp'
|
||||||
|
|
||||||
|
Execute(The project root should be detected correctly with a configuration file):
|
||||||
|
call ale#test#SetFilename('../test-files/generic/astgrep/subdir/file.js')
|
||||||
|
|
||||||
|
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/generic/astgrep')
|
||||||
|
|
||||||
|
Execute(The project root should be empty when no project files can be detected):
|
||||||
|
call ale#test#SetFilename('../test-files/dummy')
|
||||||
|
|
||||||
|
AssertLSPProject ''
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
Before:
|
||||||
|
call ale#assert#SetUpLinterTest('json', 'astgrep')
|
||||||
|
|
||||||
|
After:
|
||||||
|
call ale#assert#TearDownLinterTest()
|
||||||
|
|
||||||
|
Execute(The default executable path should be correct):
|
||||||
|
AssertLinter 'ast-grep', ale#Escape('ast-grep') . ' lsp'
|
||||||
|
|
||||||
|
Execute(The project root should be detected correctly with a configuration file):
|
||||||
|
call ale#test#SetFilename('../test-files/generic/astgrep/subdir/file.json')
|
||||||
|
|
||||||
|
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/generic/astgrep')
|
||||||
|
|
||||||
|
Execute(The project root should be empty when no project files can be detected):
|
||||||
|
call ale#test#SetFilename('../test-files/dummy')
|
||||||
|
|
||||||
|
AssertLSPProject ''
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
Before:
|
||||||
|
call ale#assert#SetUpLinterTest('kotlin', 'astgrep')
|
||||||
|
|
||||||
|
After:
|
||||||
|
call ale#assert#TearDownLinterTest()
|
||||||
|
|
||||||
|
Execute(The default executable path should be correct):
|
||||||
|
AssertLinter 'ast-grep', ale#Escape('ast-grep') . ' lsp'
|
||||||
|
|
||||||
|
Execute(The project root should be detected correctly with a configuration file):
|
||||||
|
call ale#test#SetFilename('../test-files/generic/astgrep/subdir/file.kt')
|
||||||
|
|
||||||
|
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/generic/astgrep')
|
||||||
|
|
||||||
|
Execute(The project root should be empty when no project files can be detected):
|
||||||
|
call ale#test#SetFilename('../test-files/dummy')
|
||||||
|
|
||||||
|
AssertLSPProject ''
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
Before:
|
||||||
|
call ale#assert#SetUpLinterTest('lua', 'astgrep')
|
||||||
|
|
||||||
|
After:
|
||||||
|
call ale#assert#TearDownLinterTest()
|
||||||
|
|
||||||
|
Execute(The default executable path should be correct):
|
||||||
|
AssertLinter 'ast-grep', ale#Escape('ast-grep') . ' lsp'
|
||||||
|
|
||||||
|
Execute(The project root should be detected correctly with a configuration file):
|
||||||
|
call ale#test#SetFilename('../test-files/generic/astgrep/subdir/file.lua')
|
||||||
|
|
||||||
|
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/generic/astgrep')
|
||||||
|
|
||||||
|
Execute(The project root should be empty when no project files can be detected):
|
||||||
|
call ale#test#SetFilename('../test-files/dummy')
|
||||||
|
|
||||||
|
AssertLSPProject ''
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
Before:
|
||||||
|
call ale#assert#SetUpLinterTest('nix', 'astgrep')
|
||||||
|
|
||||||
|
After:
|
||||||
|
call ale#assert#TearDownLinterTest()
|
||||||
|
|
||||||
|
Execute(The default executable path should be correct):
|
||||||
|
AssertLinter 'ast-grep', ale#Escape('ast-grep') . ' lsp'
|
||||||
|
|
||||||
|
Execute(The project root should be detected correctly with a configuration file):
|
||||||
|
call ale#test#SetFilename('../test-files/generic/astgrep/subdir/file.nix')
|
||||||
|
|
||||||
|
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/generic/astgrep')
|
||||||
|
|
||||||
|
Execute(The project root should be empty when no project files can be detected):
|
||||||
|
call ale#test#SetFilename('../test-files/dummy')
|
||||||
|
|
||||||
|
AssertLSPProject ''
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
Before:
|
||||||
|
call ale#assert#SetUpLinterTest('php', 'astgrep')
|
||||||
|
|
||||||
|
After:
|
||||||
|
call ale#assert#TearDownLinterTest()
|
||||||
|
|
||||||
|
Execute(The default executable path should be correct):
|
||||||
|
AssertLinter 'ast-grep', ale#Escape('ast-grep') . ' lsp'
|
||||||
|
|
||||||
|
Execute(The project root should be detected correctly with a configuration file):
|
||||||
|
call ale#test#SetFilename('../test-files/generic/astgrep/subdir/file.php')
|
||||||
|
|
||||||
|
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/generic/astgrep')
|
||||||
|
|
||||||
|
Execute(The project root should be empty when no project files can be detected):
|
||||||
|
call ale#test#SetFilename('../test-files/dummy')
|
||||||
|
|
||||||
|
AssertLSPProject ''
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
Before:
|
||||||
|
call ale#assert#SetUpLinterTest('python', 'astgrep')
|
||||||
|
|
||||||
|
After:
|
||||||
|
call ale#assert#TearDownLinterTest()
|
||||||
|
|
||||||
|
Execute(The default executable path should be correct):
|
||||||
|
AssertLinter 'ast-grep', ale#Escape('ast-grep') . ' lsp'
|
||||||
|
|
||||||
|
Execute(The project root should be detected correctly with a configuration file):
|
||||||
|
call ale#test#SetFilename('../test-files/generic/astgrep/subdir/file.py')
|
||||||
|
|
||||||
|
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/generic/astgrep')
|
||||||
|
|
||||||
|
Execute(The project root should be empty when no project files can be detected):
|
||||||
|
call ale#test#SetFilename('../test-files/dummy')
|
||||||
|
|
||||||
|
AssertLSPProject ''
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
Before:
|
||||||
|
call ale#assert#SetUpLinterTest('ruby', 'astgrep')
|
||||||
|
|
||||||
|
After:
|
||||||
|
call ale#assert#TearDownLinterTest()
|
||||||
|
|
||||||
|
Execute(The default executable path should be correct):
|
||||||
|
AssertLinter 'ast-grep', ale#Escape('ast-grep') . ' lsp'
|
||||||
|
|
||||||
|
Execute(The project root should be detected correctly with a configuration file):
|
||||||
|
call ale#test#SetFilename('../test-files/generic/astgrep/subdir/file.rb')
|
||||||
|
|
||||||
|
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/generic/astgrep')
|
||||||
|
|
||||||
|
Execute(The project root should be empty when no project files can be detected):
|
||||||
|
call ale#test#SetFilename('../test-files/dummy')
|
||||||
|
|
||||||
|
AssertLSPProject ''
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
Before:
|
||||||
|
call ale#assert#SetUpLinterTest('rust', 'astgrep')
|
||||||
|
|
||||||
|
After:
|
||||||
|
call ale#assert#TearDownLinterTest()
|
||||||
|
|
||||||
|
Execute(The default executable path should be correct):
|
||||||
|
AssertLinter 'ast-grep', ale#Escape('ast-grep') . ' lsp'
|
||||||
|
|
||||||
|
Execute(The project root should be detected correctly with a configuration file):
|
||||||
|
call ale#test#SetFilename('../test-files/generic/astgrep/subdir/file.rs')
|
||||||
|
|
||||||
|
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/generic/astgrep')
|
||||||
|
|
||||||
|
Execute(The project root should be empty when no project files can be detected):
|
||||||
|
call ale#test#SetFilename('../test-files/dummy')
|
||||||
|
|
||||||
|
AssertLSPProject ''
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
Before:
|
||||||
|
call ale#assert#SetUpLinterTest('scala', 'astgrep')
|
||||||
|
|
||||||
|
After:
|
||||||
|
call ale#assert#TearDownLinterTest()
|
||||||
|
|
||||||
|
Execute(The default executable path should be correct):
|
||||||
|
AssertLinter 'ast-grep', ale#Escape('ast-grep') . ' lsp'
|
||||||
|
|
||||||
|
Execute(The project root should be detected correctly with a configuration file):
|
||||||
|
call ale#test#SetFilename('../test-files/generic/astgrep/subdir/file.scala')
|
||||||
|
|
||||||
|
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/generic/astgrep')
|
||||||
|
|
||||||
|
Execute(The project root should be empty when no project files can be detected):
|
||||||
|
call ale#test#SetFilename('../test-files/dummy')
|
||||||
|
|
||||||
|
AssertLSPProject ''
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
Before:
|
||||||
|
call ale#assert#SetUpLinterTest('sh', 'astgrep')
|
||||||
|
|
||||||
|
After:
|
||||||
|
call ale#assert#TearDownLinterTest()
|
||||||
|
|
||||||
|
Execute(The default executable path should be correct):
|
||||||
|
AssertLinter 'ast-grep', ale#Escape('ast-grep') . ' lsp'
|
||||||
|
|
||||||
|
Execute(The project root should be detected correctly with a configuration file):
|
||||||
|
call ale#test#SetFilename('../test-files/generic/astgrep/subdir/file.sh')
|
||||||
|
|
||||||
|
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/generic/astgrep')
|
||||||
|
|
||||||
|
Execute(The project root should be empty when no project files can be detected):
|
||||||
|
call ale#test#SetFilename('../test-files/dummy')
|
||||||
|
|
||||||
|
AssertLSPProject ''
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
Before:
|
||||||
|
call ale#assert#SetUpLinterTest('solidity', 'astgrep')
|
||||||
|
|
||||||
|
After:
|
||||||
|
call ale#assert#TearDownLinterTest()
|
||||||
|
|
||||||
|
Execute(The default executable path should be correct):
|
||||||
|
AssertLinter 'ast-grep', ale#Escape('ast-grep') . ' lsp'
|
||||||
|
|
||||||
|
Execute(The project root should be detected correctly with a configuration file):
|
||||||
|
call ale#test#SetFilename('../test-files/generic/astgrep/subdir/file.sol')
|
||||||
|
|
||||||
|
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/generic/astgrep')
|
||||||
|
|
||||||
|
Execute(The project root should be empty when no project files can be detected):
|
||||||
|
call ale#test#SetFilename('../test-files/dummy')
|
||||||
|
|
||||||
|
AssertLSPProject ''
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
Before:
|
||||||
|
call ale#assert#SetUpLinterTest('swift', 'astgrep')
|
||||||
|
|
||||||
|
After:
|
||||||
|
call ale#assert#TearDownLinterTest()
|
||||||
|
|
||||||
|
Execute(The default executable path should be correct):
|
||||||
|
AssertLinter 'ast-grep', ale#Escape('ast-grep') . ' lsp'
|
||||||
|
|
||||||
|
Execute(The project root should be detected correctly with a configuration file):
|
||||||
|
call ale#test#SetFilename('../test-files/generic/astgrep/subdir/file.swift')
|
||||||
|
|
||||||
|
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/generic/astgrep')
|
||||||
|
|
||||||
|
Execute(The project root should be empty when no project files can be detected):
|
||||||
|
call ale#test#SetFilename('../test-files/dummy')
|
||||||
|
|
||||||
|
AssertLSPProject ''
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
Before:
|
||||||
|
call ale#assert#SetUpLinterTest('tsx', 'astgrep')
|
||||||
|
|
||||||
|
After:
|
||||||
|
call ale#assert#TearDownLinterTest()
|
||||||
|
|
||||||
|
Execute(The default executable path should be correct):
|
||||||
|
AssertLinter 'ast-grep', ale#Escape('ast-grep') . ' lsp'
|
||||||
|
|
||||||
|
Execute(The project root should be detected correctly with a configuration file):
|
||||||
|
call ale#test#SetFilename('../test-files/generic/astgrep/subdir/file.tsx')
|
||||||
|
|
||||||
|
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/generic/astgrep')
|
||||||
|
|
||||||
|
Execute(The project root should be empty when no project files can be detected):
|
||||||
|
call ale#test#SetFilename('../test-files/dummy')
|
||||||
|
|
||||||
|
AssertLSPProject ''
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
Before:
|
||||||
|
call ale#assert#SetUpLinterTest('typescript', 'astgrep')
|
||||||
|
|
||||||
|
After:
|
||||||
|
call ale#assert#TearDownLinterTest()
|
||||||
|
|
||||||
|
Execute(The default executable path should be correct):
|
||||||
|
AssertLinter 'ast-grep', ale#Escape('ast-grep') . ' lsp'
|
||||||
|
|
||||||
|
Execute(The project root should be detected correctly with a configuration file):
|
||||||
|
call ale#test#SetFilename('../test-files/generic/astgrep/subdir/file.ts')
|
||||||
|
|
||||||
|
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/generic/astgrep')
|
||||||
|
|
||||||
|
Execute(The project root should be empty when no project files can be detected):
|
||||||
|
call ale#test#SetFilename('../test-files/dummy')
|
||||||
|
|
||||||
|
AssertLSPProject ''
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
Before:
|
||||||
|
call ale#assert#SetUpLinterTest('yaml', 'astgrep')
|
||||||
|
|
||||||
|
After:
|
||||||
|
call ale#assert#TearDownLinterTest()
|
||||||
|
|
||||||
|
Execute(The default executable path should be correct):
|
||||||
|
AssertLinter 'ast-grep', ale#Escape('ast-grep') . ' lsp'
|
||||||
|
|
||||||
|
Execute(The project root should be detected correctly with a configuration file):
|
||||||
|
call ale#test#SetFilename('../test-files/generic/astgrep/subdir/file.yaml')
|
||||||
|
|
||||||
|
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/generic/astgrep')
|
||||||
|
|
||||||
|
Execute(The project root should be empty when no project files can be detected):
|
||||||
|
call ale#test#SetFilename('../test-files/dummy')
|
||||||
|
|
||||||
|
AssertLSPProject ''
|
||||||
Reference in New Issue
Block a user