mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-23 04:21:26 +08:00
#427 Implement buffer variable overrides for all linter options
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
" Author: jwilliams108 <https://github.com/jwilliams108>
|
||||
" Description: phpcs for PHP files
|
||||
|
||||
let g:ale_php_phpcs_standard = get(g:, 'ale_php_phpcs_standard', '')
|
||||
|
||||
function! ale_linters#php#phpcs#GetCommand(buffer) abort
|
||||
let l:command = 'phpcs -s --report=emacs --stdin-path=%s'
|
||||
let l:standard = ale#Var(a:buffer, 'php_phpcs_standard')
|
||||
let l:standard_option = !empty(l:standard)
|
||||
\ ? '--standard=' . l:standard
|
||||
\ : ''
|
||||
|
||||
" This option can be set to change the standard used by phpcs
|
||||
if exists('g:ale_php_phpcs_standard')
|
||||
let l:command .= ' --standard=' . g:ale_php_phpcs_standard
|
||||
endif
|
||||
|
||||
return l:command
|
||||
return 'phpcs -s --report=emacs --stdin-path=%s ' . l:standard_option
|
||||
endfunction
|
||||
|
||||
function! ale_linters#php#phpcs#Handle(buffer, lines) abort
|
||||
|
||||
Reference in New Issue
Block a user