Skip to main content
Participant
November 10, 2009
Question

customizing the ruleset

  • November 10, 2009
  • 1 reply
  • 961 views

From what I understand, to customize a ruleset for our development needs, we would have to modify, or add, to the java source and rebuild FlexPMD.  Is that correct?

Thanks

Brenda

This topic has been closed for replies.

1 reply

ledroff
Adobe Employee
Adobe Employee
November 10, 2009

You may add your own rule :

http://opensource.adobe.com/wiki/display/flexpmd/Howtoaddyourown+rule

Or you may just configure the rules set:

http://opensource.adobe.com/svn/opensource/flexpmd/bin/flex-pmd-ruleset-creator.html

Cheers!

François

bkhatlAuthor
Participant
November 12, 2009

In the flex-pmd-ruleset-creator, from what I see, it appears that you can remove an existing rule but not change an exising rule or add a new rule.  Both changing and adding rules require modifying the FlexPMD code.  Is the correct?

In the 'How To Add Your Own Rule' page, it says "If you need to add a new resource in order to test your rule, please add it to the flex-pmd-test-resources/src/test/resources folder.".  I don't see any such folder in the project ?  Has that been changed?

FlexPMD consists of both Java and ActionScript classes?

thanks

Brenda

ledroff
Adobe Employee
Adobe Employee
November 12, 2009

The flex-pmd-ruleset-creator is just creating a rules subset xml file from an existing flexpmd rules set.

In order to create a rule, you need either to write some java code and/or write some xml.

To get you started on that; two options :

Read the doc again : http://opensource.adobe.com/wiki/display/flexpmd/Howtoaddyourown+rule

Download this great sample of flexpmd extension:

http://www.vanhulzenonline.nl/techblog/moreflexpmdrules

That should be enough.

Cheers,

François

PS: the folder flex-pmd-test-resources/src/test/resources is indeed under flexmpd svn structure, you only need it if you want to do unit test and eventually commit a patch to the flexpmd team.