Created
March 10, 2015 19:04
-
-
Save keith-turner/ee0deafe88fa9f5bc43f to your computer and use it in GitHub Desktop.
Example Checkstyle rule for Accumulo Public API
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
<pluginManagement> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-checkstyle-plugin</artifactId> | |
<version>2.14</version> | |
</plugin> | |
</plugins> | |
</pluginManagement> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-checkstyle-plugin</artifactId> | |
<configuration> | |
<checkstyleRules> | |
<module name="Checker"> | |
<module name="TreeWalker"> | |
<module name="AvoidStarImport"/> | |
<module name="RegexpSinglelineJava"> | |
<!--check that only Accumulo public APIs are imported--> | |
<property name="format" value="import\s+org\.apache\.accumulo\.(.*\.(impl|thrift)\..*|(?!core|minicluster).*|core\.(?!client|data|security\.Authorizations|security\.ColumnVisibility).*|core\.data\.(?!Key|Mutation|Value|Range|Condition|ConditionalMutation|ByteSequence|PartialKey|ColumnUpdate).*)"/> | |
<property name="ignoreComments" value="true"/> | |
<property name="message" value="Accumulo non-public classes imported"/> | |
</module> | |
</module> | |
</module> | |
</checkstyleRules> | |
<failOnViolation>true</failOnViolation> | |
</configuration> | |
<executions> | |
<execution> | |
<id>check-style</id> | |
<goals> | |
<goal>check</goal> | |
</goals> | |
</execution> | |
</executions> | |
</plugin> | |
</plugins> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What this rule checks for differs from what specified in the Accumulo README as the public API. Opened ACCUMULO-3657 to address this.