forked from phoedos/pmd
Additional fixing to get exclude-pattern to work with multiple RuleSets.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6178 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
parent
8534a438a6
commit
791e3f10e4
@ -88,6 +88,7 @@ public class PMD {
|
||||
public void processFile(Reader reader, RuleSets ruleSets, RuleContext ctx,
|
||||
SourceType sourceType) throws PMDException {
|
||||
try {
|
||||
// Coarse check to see if any RuleSet applies to files, will need to do a finer RuleSet specific check later
|
||||
if (ruleSets.applies(ctx.getSourceCodeFile())) {
|
||||
SourceTypeHandler sourceTypeHandler = SourceTypeHandlerBroker.getVisitorsFactoryForSourceType(sourceType);
|
||||
ctx.setSourceType(sourceType);
|
||||
|
@ -133,7 +133,10 @@ public class RuleSets {
|
||||
ruleChain.apply(acuList, ctx, language);
|
||||
for (RuleSet ruleSet: ruleSets) {
|
||||
if (applies(language, ruleSet.getLanguage())) {
|
||||
ruleSet.apply(acuList, ctx);
|
||||
// This is the finer RuleSet specific check
|
||||
if (ruleSet.applies(ctx.getSourceCodeFile())) {
|
||||
ruleSet.apply(acuList, ctx);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user