summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikko Pesari <mikko@pesari.fi>2019-05-10 18:25:07 +0300
committerMikko Pesari <mikko@pesari.fi>2019-05-10 18:28:32 +0300
commitafa20d96ca532f08126f298d25a3aea2b1a94835 (patch)
tree03cc70408b5875927ecf512a3b882ec4e92afd8e
parent79e42fed14b35767d53d7d443a644a037e012b89 (diff)
downloadale-afa20d96ca532f08126f298d25a3aea2b1a94835.zip
Add phpstan autoload option
-rw-r--r--ale_linters/php/phpstan.vim7
-rw-r--r--doc/ale-php.txt8
2 files changed, 15 insertions, 0 deletions
diff --git a/ale_linters/php/phpstan.vim b/ale_linters/php/phpstan.vim
index b621f855..78f7dd10 100644
--- a/ale_linters/php/phpstan.vim
+++ b/ale_linters/php/phpstan.vim
@@ -5,6 +5,7 @@
let g:ale_php_phpstan_executable = get(g:, 'ale_php_phpstan_executable', 'phpstan')
let g:ale_php_phpstan_level = get(g:, 'ale_php_phpstan_level', '')
let g:ale_php_phpstan_configuration = get(g:, 'ale_php_phpstan_configuration', '')
+let g:ale_php_phpstan_autoload = get(g:, 'ale_php_phpstan_autoload', '')
function! ale_linters#php#phpstan#GetCommand(buffer, version) abort
let l:configuration = ale#Var(a:buffer, 'php_phpstan_configuration')
@@ -12,6 +13,11 @@ function! ale_linters#php#phpstan#GetCommand(buffer, version) abort
\ ? ' -c ' . ale#Escape(l:configuration)
\ : ''
+ let l:autoload = ale#Var(a:buffer, 'php_phpstan_autoload')
+ let l:autoload_option = !empty(l:autoload)
+ \ ? ' -a ' . ale#Escape(l:autoload)
+ \ : ''
+
let l:level = ale#Var(a:buffer, 'php_phpstan_level')
let l:config_file_exists = ale#path#FindNearestFile(a:buffer, 'phpstan.neon')
@@ -31,6 +37,7 @@ function! ale_linters#php#phpstan#GetCommand(buffer, version) abort
return '%e analyze --no-progress'
\ . l:error_format
\ . l:configuration_option
+ \ . l:autoload_option
\ . l:level_option
\ . ' %s'
endfunction
diff --git a/doc/ale-php.txt b/doc/ale-php.txt
index 6f53cead..d41fb50d 100644
--- a/doc/ale-php.txt
+++ b/doc/ale-php.txt
@@ -171,6 +171,14 @@ g:ale_php_phpstan_configuration *g:ale_php_phpstan_configuration*
This variable sets path to phpstan configuration file.
+g:ale_php_phpstan_autoload *g:ale_php_phpstan_autoload*
+ *b:ale_php_phpstan_autoload*
+ Type: |String|
+ Default: `''`
+
+ This variable sets path to phpstan autoload file.
+
+
===============================================================================
psalm *ale-php-psalm*