mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 12:44:23 +08:00
fix: memory-limit option for phpstan (#4900)
This might only be a problem for newer phpstan versions (2.1.1 here). If you try to run `phpstan` the way ale will when it builds the option, you will get something like: ``` The "--memory-limit" option requires a value. ``` It wants you to use `--memory-limit=-1` instead.
This commit is contained in:
@@ -22,7 +22,7 @@ function! ale_linters#php#phpstan#GetCommand(buffer, version) abort
|
|||||||
|
|
||||||
let l:memory_limit = ale#Var(a:buffer, 'php_phpstan_memory_limit')
|
let l:memory_limit = ale#Var(a:buffer, 'php_phpstan_memory_limit')
|
||||||
let l:memory_limit_option = !empty(l:memory_limit)
|
let l:memory_limit_option = !empty(l:memory_limit)
|
||||||
\ ? ' --memory-limit ' . ale#Escape(l:memory_limit)
|
\ ? ' --memory-limit=' . ale#Escape(l:memory_limit)
|
||||||
\ : ''
|
\ : ''
|
||||||
|
|
||||||
let l:level = ale#Var(a:buffer, 'php_phpstan_level')
|
let l:level = ale#Var(a:buffer, 'php_phpstan_level')
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ Execute(Memory limit parameter is added to the command):
|
|||||||
let g:ale_php_phpstan_memory_limit = '500M'
|
let g:ale_php_phpstan_memory_limit = '500M'
|
||||||
|
|
||||||
AssertLinter 'phpstan',
|
AssertLinter 'phpstan',
|
||||||
\ ale#Escape('phpstan') . ' analyze --no-progress --errorFormat json -l ' . ale#Escape('4') . ' --memory-limit ' . ale#Escape('500M') . ' %s'
|
\ ale#Escape('phpstan') . ' analyze --no-progress --errorFormat json -l ' . ale#Escape('4') . ' --memory-limit=' . ale#Escape('500M') . ' %s'
|
||||||
|
|
||||||
Execute(Directory is changed to that of the configuration file):
|
Execute(Directory is changed to that of the configuration file):
|
||||||
call writefile([], '../phpstan.neon')
|
call writefile([], '../phpstan.neon')
|
||||||
|
|||||||
Reference in New Issue
Block a user