Skip to content

Commit 1d48147

Browse files
ryandensnahsra
authored andcommitted
🐛 add missing importance property to test codemods
1 parent a5ba29d commit 1d48147

File tree

9 files changed

+31
-4
lines changed

9 files changed

+31
-4
lines changed

framework/codemodder-base/src/test/java/io/codemodder/CLITest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,10 @@ void file_finder_works() throws IOException {
222222
}
223223

224224
/** This codemod just replaces Java file contents with the word "cloud9" */
225-
@Codemod(id = "org:java/cloud9", reviewGuidance = ReviewGuidance.MERGE_AFTER_REVIEW)
225+
@Codemod(
226+
id = "org:java/cloud9",
227+
reviewGuidance = ReviewGuidance.MERGE_AFTER_REVIEW,
228+
importance = Importance.LOW)
226229
private static class Cloud9Changer extends RawFileChanger {
227230
private Cloud9Changer() {
228231
super(UselessReportStrategy.INSTANCE);

framework/codemodder-base/src/test/java/io/codemodder/CodemodLoaderTest.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,16 @@
2222

2323
final class CodemodLoaderTest {
2424

25-
@Codemod(id = "test_mod", reviewGuidance = ReviewGuidance.MERGE_AFTER_CURSORY_REVIEW)
25+
@Codemod(
26+
id = "test_mod",
27+
importance = Importance.LOW,
28+
reviewGuidance = ReviewGuidance.MERGE_AFTER_CURSORY_REVIEW)
2629
static class InvalidCodemodName extends NoReportChanger {}
2730

28-
@Codemod(id = "pixee:java/id", reviewGuidance = ReviewGuidance.MERGE_AFTER_CURSORY_REVIEW)
31+
@Codemod(
32+
id = "pixee:java/id",
33+
importance = Importance.LOW,
34+
reviewGuidance = ReviewGuidance.MERGE_AFTER_CURSORY_REVIEW)
2935
static class ValidCodemod extends NoReportChanger {}
3036

3137
private static class NoReportChanger implements CodeChanger {
@@ -72,6 +78,7 @@ void it_blows_up_on_duplicate_codemod_ids(@TempDir Path tmpDir) {
7278
@Codemod(
7379
id = "test:java/changes-file",
7480
reviewGuidance = ReviewGuidance.MERGE_AFTER_CURSORY_REVIEW,
81+
importance = Importance.LOW,
7582
executionPriority = CodemodExecutionPriority.HIGH)
7683
static class ChangesFile extends RawFileChanger {
7784
ChangesFile() {
@@ -110,6 +117,7 @@ public String getIndividualChangeDescription(Path filePath, CodemodChange change
110117

111118
@Codemod(
112119
id = "test:java/changes-file-again",
120+
importance = Importance.LOW,
113121
reviewGuidance = ReviewGuidance.MERGE_AFTER_CURSORY_REVIEW)
114122
static class ChangesFileAgain extends RawFileChanger {
115123

@@ -150,6 +158,7 @@ public String getIndividualChangeDescription(Path filePath, CodemodChange change
150158
@Codemod(
151159
id = "test:java/changes-file-yet-again",
152160
reviewGuidance = ReviewGuidance.MERGE_AFTER_CURSORY_REVIEW,
161+
importance = Importance.LOW,
153162
executionPriority = CodemodExecutionPriority.LOW)
154163
static class ChangesFileYetAgain extends RawFileChanger {
155164

@@ -239,6 +248,7 @@ void it_handles_consecutive_codemod_changes(@TempDir Path tmpDir) throws IOExcep
239248

240249
@Codemod(
241250
id = "pixee:java/parameterized",
251+
importance = Importance.LOW,
242252
reviewGuidance = ReviewGuidance.MERGE_AFTER_CURSORY_REVIEW)
243253
static class ParameterizedCodemod extends RawFileChanger {
244254
private final Parameter parameter;

framework/codemodder-base/src/test/java/io/codemodder/javaparser/JavaParserCodemodRunnerTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,10 @@ void it_composes_successfully() throws IOException {
166166
assertThat(Files.readString(javaFile), is(updatedCode));
167167
}
168168

169-
@Codemod(reviewGuidance = ReviewGuidance.MERGE_AFTER_REVIEW, id = "pixee-test:java/my-composite")
169+
@Codemod(
170+
reviewGuidance = ReviewGuidance.MERGE_AFTER_REVIEW,
171+
importance = Importance.LOW,
172+
id = "pixee-test:java/my-composite")
170173
private static class RunsBothCodemod extends CompositeJavaParserChanger {
171174
@Inject
172175
public RunsBothCodemod(

plugins/codemodder-plugin-pmd/src/test/java/io/codemodder/providers/sarif/pmd/PmdModuleTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public abstract class MultipleDeclarations {
4646

4747
@Codemod(
4848
id = "pmd-test:java/my-pmd-codemod",
49+
importance = Importance.HIGH,
4950
reviewGuidance = ReviewGuidance.MERGE_AFTER_CURSORY_REVIEW)
5051
static class UsesPmdCodemod extends SarifPluginJavaParserChanger<VariableDeclarator> {
5152
private final RuleSarif ruleSarif;

plugins/codemodder-plugin-semgrep/src/test/java/io/codemodder/providers/sarif/semgrep/SemgrepJavaParserChangerTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ private Path writeJavaFile(final Path tmpDir, final String javaCode) throws IOEx
5959

6060
@Codemod(
6161
id = "pixee-test:java/uses-inline-semgrep",
62+
importance = Importance.LOW,
6263
reviewGuidance = ReviewGuidance.MERGE_AFTER_CURSORY_REVIEW)
6364
static class UsesInlineSemgrepCodemod extends SarifPluginJavaParserChanger<ObjectCreationExpr> {
6465

plugins/codemodder-plugin-semgrep/src/test/java/io/codemodder/providers/sarif/semgrep/SemgrepModuleTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ final class SemgrepModuleTest {
3838

3939
@Codemod(
4040
id = "pixee-test:java/implicit-yaml",
41+
importance = Importance.LOW,
4142
reviewGuidance = ReviewGuidance.MERGE_AFTER_CURSORY_REVIEW)
4243
static class UsesImplicitYamlPath implements CodeChanger {
4344
private final RuleSarif ruleSarif;
@@ -70,6 +71,7 @@ public String getIndividualChangeDescription(Path filePath, CodemodChange change
7071

7172
@Codemod(
7273
id = "pixee-test:java/explicit-yaml-test",
74+
importance = Importance.LOW,
7375
reviewGuidance = ReviewGuidance.MERGE_AFTER_CURSORY_REVIEW)
7476
static class UsesExplicitYamlPath extends SarifPluginJavaParserChanger<ObjectCreationExpr> {
7577

@@ -99,6 +101,7 @@ public boolean onResultFound(
99101

100102
@Codemod(
101103
id = "pixee-test:java/missing-properties-test",
104+
importance = Importance.LOW,
102105
reviewGuidance = ReviewGuidance.MERGE_AFTER_CURSORY_REVIEW)
103106
static class MissingYamlPropertiesPath extends SarifPluginJavaParserChanger<ObjectCreationExpr> {
104107

@@ -133,6 +136,7 @@ public boolean onResultFound(
133136

134137
@Codemod(
135138
id = "pixee-test:java/uses-implicit-rule",
139+
importance = Importance.LOW,
136140
reviewGuidance = ReviewGuidance.MERGE_AFTER_CURSORY_REVIEW)
137141
static class UsesImplicitRule extends SarifPluginJavaParserChanger<ObjectCreationExpr> {
138142

@@ -263,6 +267,7 @@ void it_works_with_offline_semgrep(@TempDir Path tmpDir) throws IOException {
263267

264268
@Codemod(
265269
id = "pixee-test:java/offline-semgrep",
270+
importance = Importance.LOW,
266271
reviewGuidance = ReviewGuidance.MERGE_AFTER_CURSORY_REVIEW)
267272
static class UsesOfflineSemgrepCodemod implements CodeChanger {
268273

plugins/codemodder-plugin-semgrep/src/test/java/io/codemodder/providers/sarif/semgrep/invalid/bindstoincorrect/BindsToIncorrectObject.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import io.codemodder.CodeChanger;
44
import io.codemodder.Codemod;
55
import io.codemodder.CodemodChange;
6+
import io.codemodder.Importance;
67
import io.codemodder.ReviewGuidance;
78
import io.codemodder.codetf.CodeTFReference;
89
import io.codemodder.providers.sarif.semgrep.SemgrepScan;
@@ -14,6 +15,7 @@
1415
/** An invalid codemod that binds SARIF to a non-SARIF object. */
1516
@Codemod(
1617
id = "pixee-test:java/incorrect-binding-type",
18+
importance = Importance.HIGH,
1719
reviewGuidance = ReviewGuidance.MERGE_AFTER_CURSORY_REVIEW)
1820
public final class BindsToIncorrectObject implements CodeChanger {
1921
@Inject

plugins/codemodder-plugin-semgrep/src/test/java/io/codemodder/providers/sarif/semgrep/invalid/bothyamlstrategies/InvalidUsesBothYamlStrategies.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
*/
1414
@Codemod(
1515
id = "pixee-test:java/both-yaml",
16+
importance = Importance.LOW,
1617
reviewGuidance = ReviewGuidance.MERGE_AFTER_CURSORY_REVIEW)
1718
public final class InvalidUsesBothYamlStrategies
1819
extends SarifPluginJavaParserChanger<ObjectCreationExpr> {

plugins/codemodder-plugin-semgrep/src/test/java/io/codemodder/providers/sarif/semgrep/invalid/implicitbutmultiplerules/UsesImplicitButHasMultipleRules.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
*/
1414
@Codemod(
1515
id = "pixee-test:java/uses-implicit-rule",
16+
importance = Importance.LOW,
1617
reviewGuidance = ReviewGuidance.MERGE_AFTER_CURSORY_REVIEW)
1718
public class UsesImplicitButHasMultipleRules
1819
extends SarifPluginJavaParserChanger<ObjectCreationExpr> {

0 commit comments

Comments
 (0)