mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 12:44:23 +08:00
Improve ALE project style checking
* The project style linter now runs while you type. * Now the scripts for checking the project require blank lines. * Many style issues have been found and fixed.
This commit is contained in:
@@ -6,15 +6,19 @@ call ale#Set('scala_sbtserver_project_root', '')
|
||||
|
||||
function! ale_linters#scala#sbtserver#GetProjectRoot(buffer) abort
|
||||
let l:project_root = ale#Var(a:buffer, 'scala_sbtserver_project_root')
|
||||
|
||||
if l:project_root is? ''
|
||||
let l:project_root = ale#path#FindNearestFile(a:buffer, 'build.sbt')
|
||||
|
||||
return !empty(l:project_root) ? fnamemodify(l:project_root, ':h') : ''
|
||||
endif
|
||||
|
||||
return l:project_root
|
||||
endfunction
|
||||
|
||||
function! ale_linters#scala#sbtserver#GetAddress(buffer) abort
|
||||
let l:address = ale#Var(a:buffer, 'scala_sbtserver_address')
|
||||
|
||||
return l:address
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -53,12 +53,14 @@ function! ale_linters#scala#scalastyle#GetCommand(buffer) abort
|
||||
\ 'scalastyle_config.xml',
|
||||
\ 'scalastyle-config.xml'
|
||||
\]
|
||||
|
||||
for l:config in l:potential_configs
|
||||
let l:scalastyle_config = ale#path#ResolveLocalPath(
|
||||
\ a:buffer,
|
||||
\ l:config,
|
||||
\ ''
|
||||
\)
|
||||
|
||||
if !empty(l:scalastyle_config)
|
||||
break
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user