File tree Expand file tree Collapse file tree
gradle-open-java-format/src/main/java/com/palantir/javaformat/gradle
main/java/com/palantir/javaformat/java
test/java/com/palantir/javaformat/java Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,3 +51,10 @@ tasks.withType(JavaCompile).configureEach {
5151 // disable('NonStaticImport')
5252 }
5353}
54+
55+ // Checks whose findings have been fixed, build-breaking so that new ones are fixed too rather than read past.
56+ tasks. withType(JavaCompile ). configureEach {
57+ options. errorprone {
58+ error(' UnusedVariable' )
59+ }
60+ }
Original file line number Diff line number Diff line change 3131import org .gradle .api .artifacts .transform .TransformOutputs ;
3232import org .gradle .api .artifacts .transform .TransformParameters ;
3333import org .gradle .api .file .FileSystemLocation ;
34- import org .gradle .api .logging .Logger ;
35- import org .gradle .api .logging .Logging ;
3634import org .gradle .api .provider .Provider ;
3735import org .gradle .api .tasks .PathSensitive ;
3836import org .gradle .api .tasks .PathSensitivity ;
4745 because = "Only copies one file and sets its executable bit; caching would cost more than it saves" )
4846public abstract class ExecutableTransform implements TransformAction <TransformParameters .None > {
4947
50- private static Logger logger = Logging .getLogger (ExecutableTransform .class );
51-
5248 @ InputArtifact
5349 @ PathSensitive (PathSensitivity .NAME_ONLY )
5450 public abstract Provider <FileSystemLocation > getInputArtifact ();
Original file line number Diff line number Diff line change @@ -448,7 +448,6 @@ private String computePrefixIndentation(
448448 int startLine = lineMap .getLineNumber (startingPos );
449449 int lineStartPosition = lineMap .getStartPosition (startLine );
450450 int endPos = getEndPosition (unit , expression );
451- int endLine = lineMap .getLineNumber (endPos );
452451 int parentLine = shouldUseStartLineParent ? startParentLine : endParentLine ;
453452 // ignore indentation if the current argument is on the same line as the parent
454453 if (startLine == parentLine ) {
Original file line number Diff line number Diff line change @@ -483,7 +483,6 @@ void exitIfChangedStdin() throws Exception {
483483 Files .write (path , "class Test {\n }\n " .getBytes (UTF_8 ));
484484 Process process = formatterMain ("-" ).redirectInput (path .toFile ()).start ();
485485 process .waitFor ();
486- String err = new String (ByteStreams .toByteArray (process .getErrorStream ()), UTF_8 );
487486 String out = new String (ByteStreams .toByteArray (process .getInputStream ()), UTF_8 );
488487 assertThat (out ).isEqualTo ("<stdin>" + System .lineSeparator ());
489488 assertThat (process .exitValue ()).isEqualTo (1 );
@@ -495,7 +494,6 @@ void exitIfChangedFiles() throws Exception {
495494 Files .write (path , "class Test {\n }\n " .getBytes (UTF_8 ));
496495 Process process = formatterMain (path .toAbsolutePath ().toString ()).start ();
497496 process .waitFor ();
498- String err = new String (ByteStreams .toByteArray (process .getErrorStream ()), UTF_8 );
499497 String out = new String (ByteStreams .toByteArray (process .getInputStream ()), UTF_8 );
500498 assertThat (out ).isEqualTo (path .toAbsolutePath ().toString () + System .lineSeparator ());
501499 assertThat (process .exitValue ()).isEqualTo (1 );
You can’t perform that action at this time.
0 commit comments