Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
package org.apache.lucene.gradle.plugins.astgrep;

import com.carrotsearch.gradle.buildinfra.buildoptions.BuildOptionsExtension;

import java.util.ArrayList;
import java.util.List;
import org.gradle.api.GradleException;
import org.gradle.api.Plugin;
Expand Down Expand Up @@ -67,9 +69,14 @@ public void apply(Project project) {
optionName);
}

var args = new ArrayList<String>();
// fail on any rule match regardless of severity level
task.setArgs(
List.of("scan", "-c", "gradle/validation/ast-grep/sgconfig.yml", "--error"));
args.addAll(List.of("scan", "-c", "gradle/validation/ast-grep/sgconfig.yml", "--error"));
// use the github format when being run as a workflow
if (System.getenv("CI") != null && System.getenv("GITHUB_WORKFLOW") != null) {
args.addAll(List.of("--format", "github"));
}
task.setArgs(args);
});

// Common configuration.
Expand Down
2 changes: 1 addition & 1 deletion lucene/core/src/test/org/apache/lucene/TestDemo.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"longtermlongtermlongtermlongtermlongtermlongtermlongtermlong"
+ "termlongtermlongtermlongtermlongtermlongtermlongtermlongterm"
+ "longtermlongtermlongterm";
String text = "This is the text to be indexed. " + longTerm;
String text = "This is the text to be indexed. " + longTerm.substring(0);

Check failure on line 54 in lucene/core/src/test/org/apache/lucene/TestDemo.java

View workflow job for this annotation

GitHub Actions / checks without tests (JDK 24 on ubuntu-latest)

SubstringOfZero

String.substring(0) returns the original String

Path indexPath = Files.createTempDirectory("tempIndex");
try (Directory dir = FSDirectory.open(indexPath)) {
Expand Down
Loading