You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zh...@apache.org on 2021/01/09 01:06:21 UTC

[hbase] branch branch-2 updated: HBASE-25333 Add maven enforcer rule to ban VisibleForTesting imports (#2854)

This is an automated email from the ASF dual-hosted git repository.

zhangduo pushed a commit to branch branch-2
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2 by this push:
     new 751431d  HBASE-25333 Add maven enforcer rule to ban VisibleForTesting imports (#2854)
751431d is described below

commit 751431d93ea866ffc8edff925705e73fb851881d
Author: Duo Zhang <zh...@apache.org>
AuthorDate: Sat Jan 9 08:50:11 2021 +0800

    HBASE-25333 Add maven enforcer rule to ban VisibleForTesting imports (#2854)
    
    Signed-off-by: Peter Somogyi <ps...@apache.org>
---
 pom.xml | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/pom.xml b/pom.xml
index 52efda0..f156e0f 100755
--- a/pom.xml
+++ b/pom.xml
@@ -1145,6 +1145,19 @@
                     <bannedImport>org.glassfish.jersey.**</bannedImport>
                   </bannedImports>
                 </restrictImports>
+                <restrictImports implementation="de.skuzzle.enforcer.restrictimports.rule.RestrictImports">
+                  <includeTestCode>true</includeTestCode>
+                  <commentLineBufferSize>512</commentLineBufferSize>
+                  <reason>
+                    You should never use this style of annotations(i.e, 'this is for test only')
+                    in IA.Public or IA.LimitedPrivate classes. Use IA.Private to tell users this is
+                    not for public use.
+                    For IA.Private classes, use RestrictedApi annotation in error prone instead.
+                  </reason>
+                  <bannedImports>
+                    <bannedImport>org.apache.hbase.thirdparty.com.google.common.annotations.VisibleForTesting</bannedImport>
+                  </bannedImports>
+                </restrictImports>
               </rules>
             </configuration>
           </execution>