Created
October 31, 2013 19:03
-
-
Save bgallagh3r/7255042 to your computer and use it in GitHub Desktop.
Comma separated exception list for PHP Mess Detector for short variable names like $id or other valid shortnames. I include this using Sublime PHPcs settings.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// other settings | |
// Execute phpmd | |
"phpmd_run": true, | |
// Execute the phpmd on file save | |
"phpmd_command_on_save": true, | |
// It seems python/sublime cannot always find the phpmd application | |
// If empty, then use PATH version of phpmd, else use the set value | |
"phpmd_executable_path": "c:\\wamp\\bin\\php\\php5.4.12\\pear\\phpmd.bat", | |
// Additional arguments you can specify into the application | |
// | |
// Example: | |
// { | |
// "codesize,unusedcode" | |
// } | |
"phpmd_additional_args": { | |
"codesize,unusedcode,naming,~/.phpmd/rules.xml": "" // add path to custom ruleset file here | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<rule ref="rulesets/naming.xml/ShortVariable" > | |
<properties> | |
<property name="exceptions" value="id,em" /> | |
</properties> | |
</rule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
for anyone that finds this when searching for a solution.... I only had luck when omitting naming from phpmd_additional_args