-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into sschroevers/inline-variable-return-statements
- Loading branch information
Showing
30 changed files
with
329 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ jobs: | |
- name: Set up JDK | ||
uses: actions/[email protected] | ||
with: | ||
java-version: 17.0.4 | ||
java-version: 17.0.6 | ||
distribution: temurin | ||
cache: maven | ||
- name: Run Pitest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ jobs: | |
- name: Set up JDK | ||
uses: actions/[email protected] | ||
with: | ||
java-version: 17.0.4 | ||
java-version: 17.0.6 | ||
distribution: temurin | ||
cache: maven | ||
- name: Download Pitest analysis artifact | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/BugCheckerRules.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package tech.picnic.errorprone.refasterrules; | ||
|
||
import com.google.errorprone.BugCheckerRefactoringTestHelper; | ||
import com.google.errorprone.BugCheckerRefactoringTestHelper.FixChooser; | ||
import com.google.errorprone.BugCheckerRefactoringTestHelper.FixChoosers; | ||
import com.google.errorprone.refaster.Refaster; | ||
import com.google.errorprone.refaster.annotation.AfterTemplate; | ||
import com.google.errorprone.refaster.annotation.BeforeTemplate; | ||
import tech.picnic.errorprone.refaster.annotation.OnlineDocumentation; | ||
|
||
/** Refaster rules related to {@link com.google.errorprone.bugpatterns.BugChecker} classes. */ | ||
@OnlineDocumentation | ||
final class BugCheckerRules { | ||
private BugCheckerRules() {} | ||
|
||
/** | ||
* Avoid calling {@link BugCheckerRefactoringTestHelper#setFixChooser(FixChooser)} or {@link | ||
* BugCheckerRefactoringTestHelper#setImportOrder(String)} with their respective default values. | ||
*/ | ||
static final class BugCheckerRefactoringTestHelperIdentity { | ||
@BeforeTemplate | ||
BugCheckerRefactoringTestHelper before(BugCheckerRefactoringTestHelper helper) { | ||
return Refaster.anyOf( | ||
helper.setFixChooser(FixChoosers.FIRST), helper.setImportOrder("static-first")); | ||
} | ||
|
||
@AfterTemplate | ||
BugCheckerRefactoringTestHelper after(BugCheckerRefactoringTestHelper helper) { | ||
return helper; | ||
} | ||
} | ||
|
||
/** | ||
* Prefer {@link BugCheckerRefactoringTestHelper.ExpectOutput#expectUnchanged()} over repeating | ||
* the input. | ||
*/ | ||
// XXX: This rule assumes that the full source code is specified as a single string, e.g. using a | ||
// text block. Support for multi-line source code input would require a `BugChecker` | ||
// implementation instead. | ||
static final class BugCheckerRefactoringTestHelperAddInputLinesExpectUnchanged { | ||
@BeforeTemplate | ||
BugCheckerRefactoringTestHelper before( | ||
BugCheckerRefactoringTestHelper helper, String path, String source) { | ||
return helper.addInputLines(path, source).addOutputLines(path, source); | ||
} | ||
|
||
@AfterTemplate | ||
BugCheckerRefactoringTestHelper after( | ||
BugCheckerRefactoringTestHelper helper, String path, String source) { | ||
return helper.addInputLines(path, source).expectUnchanged(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.