<?xml version="1.0"?>
<ruleset name="dogfood-goal" 
	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>Dogfood goal, delete this when we reach it.</description>

	<!-- Exclude JavaCC generated artifacts -->
	<exclude-pattern>.*net/sourceforge/pmd/lang/ast/JavaCharStream.java</exclude-pattern>
	<exclude-pattern>.*net/sourceforge/pmd/lang/ast/SimpleCharStream.java</exclude-pattern>
	<exclude-pattern>.*net/sourceforge/pmd/lang/ast/TokenMgrError.java</exclude-pattern>
	<exclude-pattern>.*lang/(java|jsp|cpp)/ast/.*Parser.java</exclude-pattern>
	<exclude-pattern>.*lang/(java|jsp|cpp)/ast/.*ParserConstants.java</exclude-pattern>
	<exclude-pattern>.*lang/(java|jsp|cpp)/ast/.*ParserTokenManager.java</exclude-pattern>
	<exclude-pattern>.*lang/(java|jsp|cpp)/ast/.*ParserTreeConstants.java</exclude-pattern>
	<exclude-pattern>.*lang/(java|jsp|cpp)/ast/.*ParserVisitor.java</exclude-pattern>
	<exclude-pattern>.*lang/(java|jsp|cpp)/ast/JJT.*ParserState.java</exclude-pattern>
	<exclude-pattern>.*lang/(java|jsp|cpp)/ast/ParseException.java</exclude-pattern>
	<exclude-pattern>.*lang/(java|jsp|cpp)/ast/Token.java</exclude-pattern>

	<rule ref="rulesets/internal/pmdspecific.xml"/>

	<rule ref="rulesets/java/basic.xml">
    	<exclude name="CollapsibleIfStatements"/>
	</rule>

	<rule ref="rulesets/java/braces.xml"/>

	<rule ref="rulesets/java/clone.xml"/>
	
	<rule ref="rulesets/java/controversial.xml">
		<exclude name="AvoidLiteralsInIfCondition"/>
		<exclude name="OnlyOneReturn"/>
		<exclude name="AtLeastOneConstructor"/>
		<exclude name="CallSuperInConstructor"/>
		<exclude name="DefaultPackage"/>
		<exclude name="BooleanInversion"/>
		<exclude name="DataflowAnomalyAnalysis"/>
		<exclude name="AvoidFinalLocalVariable"/>
		<exclude name="DataflowAnomalyAnalysis"/>
		<exclude name="AssignmentInOperand"/>
		<exclude name="NullAssignment"/>
		<exclude name="UseObjectForClearerAPI"/>
	</rule>
	<rule ref="rulesets/java/controversial.xml/AssignmentInOperand">
		<properties>
			<property name="allowWhile" value="true"/>
		</properties>
	</rule>

	<rule ref="rulesets/java/coupling.xml">
		<exclude name="CouplingBetweenObjects"/>
		<exclude name="ExcessiveImports"/>
	</rule>

	<rule ref="rulesets/java/design.xml">
		<exclude name="UseSingleton"/>
		<exclude name="AvoidDeeplyNestedIfStmts"/>
		<exclude name="AvoidReassigningParameters"/>
		<exclude name="SwitchDensity"/>
		<exclude name="ConstructorCallsOverridableMethod"/>
		<exclude name="SimpleDateFormatNeedsLocale"/>
		<exclude name="ImmutableField"/>
		<exclude name="UseLocaleWithCaseConversions"/>
		<!--  TODO Is AvoidSynchronizedAtMethodLevel something we should shoot for? -->
		<exclude name="AvoidSynchronizedAtMethodLevel"/>
		<exclude name="EmptyMethodInAbstractClassShouldBeAbstract"/>
		<exclude name="ReturnEmptyArrayRatherThanNull"/>
		<exclude name="TooFewBranchesForASwitchStatement"/>
	</rule>

	<rule ref="rulesets/java/empty.xml">
		<exclude name="EmptyCatchBlock" />
	</rule>
	<rule ref="rulesets/java/empty.xml/EmptyCatchBlock">
		<properties>
			<property name="allowCommentedBlocks" description="blah blah" value="true" />
		</properties>
	</rule>

	<rule ref="rulesets/java/finalizers.xml"/>

	<rule ref="rulesets/java/imports.xml"/>

	<rule ref="rulesets/java/logging-java.xml">
	</rule>

	<!-- Specifically reference via other referencing RuleSets to test Reference to Reference -->
	<rule ref="rulesets/java/migrating_to_13.xml"/>
	<rule ref="rulesets/java/migrating_to_14.xml"/>
	<rule ref="rulesets/java/migrating_to_15.xml"/>

	<rule ref="rulesets/java/naming.xml">
		<exclude name="ShortVariable"/>
		<exclude name="LongVariable"/>
		<exclude name="ShortMethodName"/>
		<exclude name="ShortClassName"/>
	</rule>

	<rule ref="rulesets/java/optimizations.xml">
		<exclude name="MethodArgumentCouldBeFinal"/>
		<exclude name="LocalVariableCouldBeFinal"/>
	</rule>

	<rule ref="rulesets/java/strictexception.xml">
	</rule>

	<rule ref="rulesets/java/strings.xml">
		<exclude name="AvoidDuplicateLiterals"/>
		<exclude name="InefficientEmptyStringCheck"/>
	</rule>

	<rule ref="rulesets/java/unnecessary.xml"/>

	<rule ref="rulesets/java/unusedcode.xml">
		<exclude name="UnusedFormalParameter"/>
	</rule>

</ruleset>
