Skip to content

Commit 75f5cb2

Browse files
committed
HBASE-25333 Add maven enforcer rule to ban VisibleForTesting imports (#2854)
Signed-off-by: Peter Somogyi <[email protected]>
1 parent 09db88d commit 75f5cb2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

pom.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,6 +1145,19 @@
11451145
<bannedImport>org.glassfish.jersey.**</bannedImport>
11461146
</bannedImports>
11471147
</restrictImports>
1148+
<restrictImports implementation="de.skuzzle.enforcer.restrictimports.rule.RestrictImports">
1149+
<includeTestCode>true</includeTestCode>
1150+
<commentLineBufferSize>512</commentLineBufferSize>
1151+
<reason>
1152+
You should never use this style of annotations(i.e, 'this is for test only')
1153+
in IA.Public or IA.LimitedPrivate classes. Use IA.Private to tell users this is
1154+
not for public use.
1155+
For IA.Private classes, use RestrictedApi annotation in error prone instead.
1156+
</reason>
1157+
<bannedImports>
1158+
<bannedImport>org.apache.hbase.thirdparty.com.google.common.annotations.VisibleForTesting</bannedImport>
1159+
</bannedImports>
1160+
</restrictImports>
11481161
</rules>
11491162
</configuration>
11501163
</execution>

0 commit comments

Comments
 (0)