Skip to content

Commit ee17500

Browse files
author
Vincent Potucek
committed
[S1161] use staticanalysis.MissingOverrideAnnotation to avoid missing @OverRide on overriding and implementing methods
1 parent cfe7a05 commit ee17500

File tree

2 files changed

+129
-0
lines changed

2 files changed

+129
-0
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ updates:
8585
# Maven plugins
8686
- dependency-name: org.apache.maven.plugins:*
8787
- dependency-name: org.codehaus.mojo:*
88+
- dependency-name: org.openrewrite.maven:rewrite-maven-plugin
8889
- dependency-name: io.fabric8:docker-maven-plugin
8990
- dependency-name: net.revelc.code.formatter:formatter-maven-plugin
9091
- dependency-name: net.revelc.code:impsort-maven-plugin

independent-projects/parent/pom.xml

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
<version.plugin.plugin>3.15.1</version.plugin.plugin>
3636
<version.release.plugin>3.1.1</version.release.plugin>
3737
<version.resources.plugin>3.3.1</version.resources.plugin>
38+
<version.rewrite.plugin>6.10.0</version.rewrite.plugin>
39+
<version.rewrite.static.analysis>2.10.0</version.rewrite.static.analysis>
3840
<!-- Do not update for now as it is causing test issues in integration-tests/devmode
3941
java.lang.NoClassDefFoundError: com/salesforce/jprotoc/Generator -->
4042
<version.shade.plugin>3.2.1</version.shade.plugin>
@@ -361,6 +363,34 @@
361363
</archive>
362364
</configuration>
363365
</plugin>
366+
<plugin>
367+
<groupId>org.openrewrite.maven</groupId>
368+
<artifactId>rewrite-maven-plugin</artifactId>
369+
<version>${version.rewrite.plugin}</version>
370+
<configuration>
371+
<activeRecipes>
372+
<recipe>org.openrewrite.staticanalysis.MissingOverrideAnnotation</recipe>
373+
<!-- <recipe>org.openrewrite.staticanalysis.NoToStringOnStringType</recipe>-->
374+
<!-- <recipe>org.openrewrite.staticanalysis.NoValueOfOnStringType</recipe>-->
375+
<!-- <recipe>org.openrewrite.staticanalysis.RemoveUnusedLocalVariables</recipe>-->
376+
<!-- <recipe>org.openrewrite.staticanalysis.RemoveUnusedPrivateFields</recipe>-->
377+
<!-- <recipe>org.openrewrite.staticanalysis.RemoveUnusedPrivateMethods</recipe>-->
378+
<!-- <recipe>org.openrewrite.staticanalysis.UnnecessaryCloseInTryWithResources</recipe>-->
379+
<!-- <recipe>org.openrewrite.staticanalysis.UnnecessaryExplicitTypeArguments</recipe>-->
380+
<!-- <recipe>org.openrewrite.staticanalysis.UnnecessaryReturnAsLastStatement</recipe>-->
381+
<!-- <recipe>org.openrewrite.staticanalysis.UnnecessaryThrows</recipe>-->
382+
</activeRecipes>
383+
<failOnDryRunResults>true</failOnDryRunResults>
384+
<rewriteSkip>${format.skip}</rewriteSkip>
385+
</configuration>
386+
<dependencies>
387+
<dependency>
388+
<groupId>org.openrewrite.recipe</groupId>
389+
<artifactId>rewrite-static-analysis</artifactId>
390+
<version>${version.rewrite.static.analysis}</version>
391+
</dependency>
392+
</dependencies>
393+
</plugin>
364394
<plugin>
365395
<groupId>net.revelc.code.formatter</groupId>
366396
<artifactId>formatter-maven-plugin</artifactId>
@@ -623,5 +653,103 @@
623653
</pluginManagement>
624654
</build>
625655
</profile>
656+
<profile>
657+
<id>format</id>
658+
<activation>
659+
<activeByDefault>true</activeByDefault>
660+
<property>
661+
<name>!no-format</name>
662+
</property>
663+
</activation>
664+
<build>
665+
<plugins>
666+
<plugin>
667+
<groupId>org.openrewrite.maven</groupId>
668+
<artifactId>rewrite-maven-plugin</artifactId>
669+
<executions>
670+
<execution>
671+
<phase>process-sources</phase>
672+
<goals>
673+
<goal>run</goal>
674+
</goals>
675+
</execution>
676+
</executions>
677+
</plugin>
678+
<plugin>
679+
<groupId>net.revelc.code.formatter</groupId>
680+
<artifactId>formatter-maven-plugin</artifactId>
681+
<executions>
682+
<execution>
683+
<phase>process-sources</phase>
684+
<goals>
685+
<goal>format</goal>
686+
</goals>
687+
</execution>
688+
</executions>
689+
</plugin>
690+
<plugin>
691+
<groupId>net.revelc.code</groupId>
692+
<artifactId>impsort-maven-plugin</artifactId>
693+
<executions>
694+
<execution>
695+
<id>sort-imports</id>
696+
<goals>
697+
<goal>sort</goal>
698+
</goals>
699+
</execution>
700+
</executions>
701+
</plugin>
702+
</plugins>
703+
</build>
704+
</profile>
705+
<profile>
706+
<id>validate</id>
707+
<activation>
708+
<activeByDefault>true</activeByDefault>
709+
<property>
710+
<name>no-format</name>
711+
</property>
712+
</activation>
713+
<build>
714+
<plugins>
715+
<plugin>
716+
<groupId>org.openrewrite.maven</groupId>
717+
<artifactId>rewrite-maven-plugin</artifactId>
718+
<executions>
719+
<execution>
720+
<phase>process-sources</phase>
721+
<goals>
722+
<goal>dryRun</goal>
723+
</goals>
724+
</execution>
725+
</executions>
726+
</plugin>
727+
<plugin>
728+
<groupId>net.revelc.code.formatter</groupId>
729+
<artifactId>formatter-maven-plugin</artifactId>
730+
<executions>
731+
<execution>
732+
<phase>process-sources</phase>
733+
<goals>
734+
<goal>validate</goal>
735+
</goals>
736+
</execution>
737+
</executions>
738+
</plugin>
739+
<plugin>
740+
<groupId>net.revelc.code</groupId>
741+
<artifactId>impsort-maven-plugin</artifactId>
742+
<executions>
743+
<execution>
744+
<id>check-imports</id>
745+
<goals>
746+
<goal>check</goal>
747+
</goals>
748+
</execution>
749+
</executions>
750+
</plugin>
751+
</plugins>
752+
</build>
753+
</profile>
626754
</profiles>
627755
</project>

0 commit comments

Comments
 (0)