mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 20:54:26 +08:00
phpstan: support config phpstan.dist.neon (#5052)
phpstan will load config from (in order) phpstan.neon, phpstan.neon.dist, or phpstan.dist.neon.
This commit is contained in:
@@ -87,6 +87,10 @@ function! ale_linters#php#phpstan#FindConfigFile(buffer) abort
|
|||||||
let l:result = ale#path#FindNearestFile(a:buffer, 'phpstan.neon.dist')
|
let l:result = ale#path#FindNearestFile(a:buffer, 'phpstan.neon.dist')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if empty(l:result)
|
||||||
|
let l:result = ale#path#FindNearestFile(a:buffer, 'phpstan.dist.neon')
|
||||||
|
endif
|
||||||
|
|
||||||
return l:result
|
return l:result
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
@@ -102,6 +102,17 @@ Execute(Configuration dist file exists in current directory):
|
|||||||
\ ]
|
\ ]
|
||||||
AssertLinterCwd g:dir
|
AssertLinterCwd g:dir
|
||||||
|
|
||||||
|
Execute(Configuration alternative dist file exists in current directory):
|
||||||
|
call writefile(['parameters:', ' level: 7'], './phpstan.dist.neon')
|
||||||
|
let g:ale_php_phpstan_level = ''
|
||||||
|
let g:ale_php_phpstan_configuration = ''
|
||||||
|
|
||||||
|
AssertLinter 'phpstan', [
|
||||||
|
\ ale#Escape('phpstan') . ' --version',
|
||||||
|
\ ale#Escape('phpstan') . ' analyze --no-progress --errorFormat json %s'
|
||||||
|
\ ]
|
||||||
|
AssertLinterCwd g:dir
|
||||||
|
|
||||||
Execute(Configuration file exists in current directory, but force phpstan level):
|
Execute(Configuration file exists in current directory, but force phpstan level):
|
||||||
call writefile(['parameters:', ' level: 7'], './phpstan.neon')
|
call writefile(['parameters:', ' level: 7'], './phpstan.neon')
|
||||||
let g:ale_php_phpstan_configuration = ''
|
let g:ale_php_phpstan_configuration = ''
|
||||||
|
|||||||
Reference in New Issue
Block a user