Skip to content

Commit

Permalink
Excluding files from PMD checking.
Browse files Browse the repository at this point in the history
  • Loading branch information
Polina Volkhontseva committed Apr 6, 2022
1 parent 1d90255 commit a9f0276
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion qulice-pmd/src/main/java/com/qulice/pmd/PmdValidator.java
Expand Up @@ -65,7 +65,12 @@ public Collection<Violation> validate(final Collection<File> files) {
final SourceValidator validator = new SourceValidator(this.env);
final Collection<DataSource> sources = new LinkedList<>();
for (final File file : files) {
sources.add(new FileDataSource(file));
final String name = file.getPath().substring(
this.env.basedir().toString().length()
);
if (!this.env.exclude("pmd", name)) {
sources.add(new FileDataSource(file));
}
}
final Collection<RuleViolation> breaches = validator.validate(
sources, this.env.basedir().getPath()
Expand Down

0 comments on commit a9f0276

Please sign in to comment.