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

Use previously implemented YAML predicate to ignore Helm Chart YAML files #4610

Merged
merged 1 commit into from Mar 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -19,6 +19,8 @@
*/
package org.sonar.plugins.javascript.bridge;

import static org.sonar.plugins.javascript.JavaScriptFilePredicate.getYamlPredicate;

import java.io.IOException;
import java.util.List;
import java.util.Scanner;
Expand Down Expand Up @@ -105,10 +107,8 @@ protected void analyzeFiles(List<InputFile> inputFiles) throws IOException {
protected List<InputFile> getInputFiles() {
var fileSystem = context.fileSystem();
FilePredicates p = fileSystem.predicates();
var filePredicate = p.and(
p.hasLanguage(YamlSensor.LANGUAGE),
input -> isSamTemplate(input, LOG)
);
var yamlPredicate = getYamlPredicate(fileSystem);
var filePredicate = p.and(yamlPredicate, input -> isSamTemplate(input, LOG));
var inputFiles = context.fileSystem().inputFiles(filePredicate);
return StreamSupport.stream(inputFiles.spliterator(), false).toList();
}
Expand Down