summaryrefslogtreecommitdiff
path: root/ale_linters/php
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-04-15 13:35:54 +0100
committerw0rp <devw0rp@gmail.com>2017-04-15 13:36:16 +0100
commit706dd050f2ec570eb12398d42a18f6c4f2bd56df (patch)
tree2c463aa0d5ef02feab3f2ef87215bd4417b47729 /ale_linters/php
parent2f009690c3cf442f828830cc1d2fece619f308ff (diff)
downloadale-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.vim8
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',
\})