diff options
author | w0rp <devw0rp@gmail.com> | 2017-04-15 13:35:54 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-04-15 13:36:16 +0100 |
commit | 706dd050f2ec570eb12398d42a18f6c4f2bd56df (patch) | |
tree | 2c463aa0d5ef02feab3f2ef87215bd4417b47729 /ale_linters/php | |
parent | 2f009690c3cf442f828830cc1d2fece619f308ff (diff) | |
download | ale-706dd050f2ec570eb12398d42a18f6c4f2bd56df.zip |
Fix #257 in preparation for #427, standardise options with fallbacks, and make it so every value can be computed dynamically
Diffstat (limited to 'ale_linters/php')
-rw-r--r-- | ale_linters/php/phpmd.vim | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ale_linters/php/phpmd.vim b/ale_linters/php/phpmd.vim index c8d1b79d..9426fcc3 100644 --- a/ale_linters/php/phpmd.vim +++ b/ale_linters/php/phpmd.vim @@ -4,6 +4,12 @@ " Set to change the ruleset let g:ale_php_phpmd_ruleset = get(g:, 'ale_php_phpmd_ruleset', 'cleancode,codesize,controversial,design,naming,unusedcode') +function! ale_linters#php#phpmd#GetCommand(buffer) abort + return 'phpmd %s text ' + \ . g:ale_php_phpmd_ruleset + \ . ' --ignore-violations-on-exit %t' +endfunction + function! ale_linters#php#phpmd#Handle(buffer, lines) abort " Matches against lines like the following: " @@ -33,6 +39,6 @@ endfunction call ale#linter#Define('php', { \ 'name': 'phpmd', \ 'executable': 'phpmd', -\ 'command': 'phpmd %s text ' . g:ale_php_phpmd_ruleset . ' --ignore-violations-on-exit %t', +\ 'command_callback': 'ale_linters#php#phpmd#GetCommand', \ 'callback': 'ale_linters#php#phpmd#Handle', \}) |