Skip to content

Commit

Permalink
chore(checkstyle): add check for internal imports (INRIA#3244)
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinWitt authored Feb 14, 2020
1 parent 4ee28da commit 12543fe
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@
<module name="AvoidStarImport"/>
<module name="IllegalImport"/> <!-- defaults to sun.* packages -->
<module name="RedundantImport"/>
<module name="IllegalImport">
<property name="regexp" value="true" />
<property name="illegalClasses" value="^(?!.*(spoon|jdt)).*internal.*$" />
<!--The regex looks for imports containing internal and not containing spoon or jdt. Some examples are:
import spoon.pattern.internal.node.ForEachNode; // allowed because internal package but from spoon.
import org.eclipse.jdt.internal.compiler.batch.CompilationUnit; //allowed because internal package but from jdt.
import org.apache.commons.jexl2.internal.introspection; //rejected because import of internal package -->
</module>
<module name="UnusedImports">
<property name="processJavadoc" value="true"/>
</module>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.0.0</version>
<version>3.1.0</version>
<configuration>
<failsOnError>true</failsOnError>
<configLocation>checkstyle.xml</configLocation>
Expand Down
2 changes: 1 addition & 1 deletion spoon-control-flow/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.0.0</version>
<version>3.1.0</version>
<configuration>
<failsOnError>true</failsOnError>
<configLocation>../checkstyle.xml</configLocation>
Expand Down
2 changes: 1 addition & 1 deletion spoon-decompiler/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.0.0</version>
<version>3.1.0</version>
<configuration>
<failsOnError>true</failsOnError>
<configLocation>../checkstyle.xml</configLocation>
Expand Down

0 comments on commit 12543fe

Please sign in to comment.