Re: [pmd-devel] Setting a rule property
A source code analyzer
Brought to you by:
adangel,
juansotuyo
From: Kosta W. <the...@gm...> - 2013-11-17 01:27:48
|
Thanks a lot, that did the trick! > Am 11.11.2013 um 20:20 schrieb Andreas Dangel <ad...@us...>: > > Hi Kosta, > > you'll need to define your own ruleset, import the rules you want, and > there you can configure the properties. > > E.g. > > <?xml version="1.0"?> > <ruleset name="Custom ruleset" > xmlns="http://pmd.sourceforge.net/ruleset/2.0.0" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd"> > > <description> > This ruleset checks my code for bad stuff > </description> > > <rule ref="rulesets/java/imports.xml/TooManyStaticImports"> > <properties> > <property name="maximumStaticImports" value="5"/> > </properties> > </rule> > </ruleset> > > > More examples (like importing a complete ruleset at once, or excluding > single rules) can be found online: > http://pmd.sourceforge.net/pmd-5.0.5/howtomakearuleset.html > > Cheers, > Andreas > > > On 24.10.2013 19:12, schrieb Kosta Welke: >> Hi! >> >> I’m using the maven plugin of PMD and it works fine one my code with the default settings. I have one issue though - I have code with more than 4 static imports. They make sense and I want to keep it that way. I would like to get rid of these warnings, though. >> >> I found the rule “TooManyStaticImports” of the ruleset "Import Statements” has the property “maximumStaticImports”. I would like to set it. How can I do that? >> >> Thanks in advance for your replies! >> >> Cheers, >> Kosta >> ------------------------------------------------------------------------------ >> October Webinars: Code for Performance >> Free Intel webinars can help you accelerate application performance. >> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from >> the latest Intel processors and coprocessors. See abstracts and register > >> http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk >> _______________________________________________ >> Pmd-devel mailing list >> Pmd...@li... >> https://lists.sourceforge.net/lists/listinfo/pmd-devel > > > -- > Andreas Dangel > https://github.com/adangel > skype: andreas_dangel > |