Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only accept supported web languages for CSS analysis (and activate SASS by default) #4308

Merged
Prev Previous commit
Next Next commit
modularize web language in its own predicate
kebetsi committed Oct 25, 2023
commit c6d2db2db0e8f72e50aff2ba522e4471ba6bd7cf
Original file line number Diff line number Diff line change
@@ -208,15 +208,14 @@ protected List<InputFile> getInputFiles() {
var fileSystem = this.context.fileSystem();
var p = fileSystem.predicates();

var supportedWebExtensions = p.or(
p.hasExtension("htm"),
p.hasExtension("html"),
p.hasExtension("xhtml")
var cssFilePredicate = p.and(
p.hasType(InputFile.Type.MAIN),
p.or(p.hasLanguages(CssLanguage.KEY))
);

var mainFilePredicate = p.and(
var webFilePredicate = p.and(
p.hasType(InputFile.Type.MAIN),
p.or(p.hasLanguages(CssLanguage.KEY), supportedWebExtensions)
p.or(p.hasExtension("htm"), p.hasExtension("html"), p.hasExtension("xhtml"))
);

var vueFilePredicate = p.and(
@@ -227,7 +226,12 @@ protected List<InputFile> getInputFiles() {
);

return StreamSupport
.stream(fileSystem.inputFiles(p.or(mainFilePredicate, vueFilePredicate)).spliterator(), false)
.stream(
fileSystem
.inputFiles(p.or(cssFilePredicate, webFilePredicate, vueFilePredicate))
.spliterator(),
false
)
.collect(Collectors.toList());
}