forked from phoedos/pmd
Fix force lang
This commit is contained in:
@ -223,7 +223,10 @@ public final class FileUtil {
|
||||
|
||||
private static void internalGetApplicableFiles(List<TextFile> files, PMDConfiguration configuration, Set<Language> languages) throws IOException {
|
||||
List<String> ignoredFiles = getIgnoredFiles(configuration);
|
||||
Predicate<Path> fileFilter = PredicateUtil.toFileFilter(new LanguageFilenameFilter(languages));
|
||||
LanguageVersion forcedVersion = configuration.getForceLanguageVersion();
|
||||
Predicate<Path> fileFilter =
|
||||
forcedVersion != null ? Files::isRegularFile // accept everything except dirs
|
||||
: PredicateUtil.toFileFilter(new LanguageFilenameFilter(languages));
|
||||
fileFilter = fileFilter.and(path -> !ignoredFiles.contains(path.toString()));
|
||||
|
||||
for (String root : configuration.getAllInputPaths()) {
|
||||
|
@ -15,6 +15,7 @@ import net.sourceforge.pmd.lang.LanguageVersion;
|
||||
|
||||
/**
|
||||
* A builder for a new text file.
|
||||
* See static methods on {@link TextFile}.
|
||||
*/
|
||||
public abstract class TextFileBuilder {
|
||||
|
||||
|
@ -94,7 +94,7 @@ public abstract class BaseCLITest {
|
||||
protected void checkStatusCode(int expectedExitCode) {
|
||||
int statusCode = getStatusCode();
|
||||
if (statusCode != expectedExitCode) {
|
||||
fail("PMD failed with status code:" + statusCode);
|
||||
fail("PMD failed with status code: " + statusCode);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user