Skip to content
Browse files

Allow for built-in phpmd rules, closes #7

Mess detector rulesets can be specified as a comma separated list,
made up of XML files or built-in rules, and a combination.
  • Loading branch information...
1 parent ce375b6 commit 023c6a756e3d10a99936fb2f790415526875c2e4 @joonty committed Apr 9, 2013
Showing with 4 additions and 8 deletions.
  1. +2 −6 autoload/phpqa.vim
  2. +2 −2 plugin/phpqa.vim
View
8 autoload/phpqa.vim
@@ -142,12 +142,8 @@ function! phpqa#PhpMessDetector()
if 0 != len(g:phpqa_messdetector_cmd)
let file_tmp = ""
while 0 == len(g:phpqa_messdetector_ruleset)
- let file_tmp = expand(resolve(input("Please specify a mess detector ruleset XML file: ",file_tmp,"file")))
- if filereadable(file_tmp)
- let g:phpqa_messdetector_ruleset = file_tmp
- else
- echohl Error |echo "Not a valid or readable file"|echohl None
- endif
+ let file_tmp = input("Please specify a mess detector ruleset file, or built in rule: ",file_tmp)
+ let g:phpqa_messdetector_ruleset = file_tmp
endwhile
let l:phpmd_output=system(g:phpqa_messdetector_cmd." ".@%." text ".g:phpqa_messdetector_ruleset)
let l:phpmd_list=split(l:phpmd_output, "\n")
View
4 plugin/phpqa.vim
@@ -51,9 +51,9 @@ if !exists("g:phpqa_messdetector_cmd")
let g:phpqa_messdetector_cmd='phpmd'
endif
-" Rule set XML file for mess detector
+" Rule set built-in or XML file for mess detector, comma separated
if !exists("g:phpqa_messdetector_ruleset")
- let g:phpqa_messdetector_ruleset=""
+ let g:phpqa_messdetector_ruleset="codesize,unusedcode,naming"
endif
" Clover code coverage file

0 comments on commit 023c6a7

Please sign in to comment.
Something went wrong with that request. Please try again.