mirror of
https://github.com/dense-analysis/ale.git
synced 2026-10-11 07:39:14 +08:00
Add Yara yls support (#4886)
This adds Yara support to ALE using Avast's language server for Yara: https://avast.github.io/yls/ A ".git" folder is used to determine the project_root so this means the Yara rules must be in a git repo for the integration to work. The server only have 1 optional argument (-v, --verbose). Since this is the case, no additional configuration options are available. --------- Co-authored-by: w0rp <w0rp@users.noreply.github.com>
This commit is contained in:
1 parent
0f71d4c494
commit
f0c8eb4fa8
7 files changed
+64
No files matched your search
@@ -0,0 +1,18 @@
|
||||
" Author: TcM1911
|
||||
" Description: A language server for Yara.
|
||||
|
||||
call ale#Set('yara_yls_executable', 'yls')
|
||||
|
||||
function! ale_linters#yara#yls#FindProjectRoot(buffer) abort
|
||||
let l:project_root = ale#path#FindNearestDirectory(a:buffer, '.git')
|
||||
|
||||
return !empty(l:project_root) ? (ale#path#Upwards(l:project_root)[1]) : ''
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('yara', {
|
||||
\ 'name': 'yls',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable': {b -> ale#Var(b, 'yara_yls_executable')},
|
||||
\ 'command': '%e -v',
|
||||
\ 'project_root': function('ale_linters#yara#yls#FindProjectRoot'),
|
||||
\})
|
||||
Reference in new issue
Block a user