FlexPMD and TextMate setup question: Creating rules
I wanted to g开发者_运维技巧et some assistance into how to set up new rulesets for Textmate, as I can't find the pmd.xml file that needs to be modified.
Thanks in advance
I couldn't find a default pmd.xml file anywhere, so I just used the Adobe Flex PMD Ruleset creator and then exported the default set of rules.
[edited to add]
My project was running using ANT and Hudson so I just put it in the root of that.
However, to properly test this out using TextMate I copied my project to match the following documented conditions:
"The bundle is currently experimental, as such it expects the following:
- Source files to be in a saved TextMate project.
- ActionScript and MXML source files to be in a directory named 'src'"
I then copied my pmd config file into the project root, opened it, and ran the FlexPMD 'Project' option.
This gave the illusion of using my file, so I renamed the file and deleted all but one rule to prove it wasn't being used.
The TextMate FlexPMD bundle documentation mentions:
- To specify a custom ruleset specify it's path using the env var TM_FLEXPMD_RULESET.
So I rather than create a global variable which would affect all projects, I created a project dependent variable by:
The way to do this is currently a little secret but if you deselect everything in the project drawer, then click the info (circled I) button, a panel will appear where you can set variables.
So my variable was TM_FLEXPMD_RULESET
with the value pmd_rules.xml
When I then ran the FlexPMD 'Project' option, only one rule was being run.
精彩评论