This is an automated email from the ASF dual-hosted git repository.
nwang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-heron.git
The following commit(s) were added to refs/heads/master by this push:
new 92267f4 Fix style check config (#3257)
92267f4 is described below
commit 92267f4433057ce0b2654419054002a2273ea97c
Author: Ning Wang <[email protected]>
AuthorDate: Thu May 16 13:56:16 2019 -0700
Fix style check config (#3257)
---
.../apache/bazel/checkstyle/JavaCheckstyle.java | 25 +++++++++++-----------
.../bazel/checkstyle/apache_coding_style.xml | 2 +-
2 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/tools/java/src/org/apache/bazel/checkstyle/JavaCheckstyle.java
b/tools/java/src/org/apache/bazel/checkstyle/JavaCheckstyle.java
index 80dae59..6abcf9b 100644
--- a/tools/java/src/org/apache/bazel/checkstyle/JavaCheckstyle.java
+++ b/tools/java/src/org/apache/bazel/checkstyle/JavaCheckstyle.java
@@ -49,6 +49,15 @@ import org.apache.commons.lang.ArrayUtils;
public final class JavaCheckstyle {
public static final Logger LOG =
Logger.getLogger(JavaCheckstyle.class.getName());
private static final String CLASSNAME =
JavaCheckstyle.class.getCanonicalName();
+ private static final Predicate APACHE_STYLE_FILES = Predicates.or(
+ Predicates.containsPattern("storm-compatibility-examples.src.java"),
+ Predicates.containsPattern("storm-compatibility.src.java"),
+ Predicates.containsPattern("tools/test/LcovMerger"),
+ Predicates.containsPattern("contrib")
+ );
+ private static final Predicate NO_CHECK_FILES = Predicates.or(
+ Predicates.containsPattern("external") // from external/ directory for
bazel
+ );
private JavaCheckstyle() {
}
@@ -114,22 +123,14 @@ public final class JavaCheckstyle {
@SuppressWarnings("unchecked")
private static String[] getHeronSourceFiles(String extraActionFile) {
- return getSourceFiles(extraActionFile, Predicates.not(Predicates.or(
- Predicates.containsPattern("storm-compatibility-examples.src.java"),
- Predicates.containsPattern("storm-compatibility.src.java"),
- Predicates.containsPattern("tools/test/LcovMerger"),
- Predicates.containsPattern("contrib"),
- Predicates.containsPattern("external") // from external/ directory for
bazel
- )));
+ return getSourceFiles(extraActionFile, Predicates.not(
+ Predicates.or(APACHE_STYLE_FILES, NO_CHECK_FILES)
+ ));
}
@SuppressWarnings("unchecked")
private static String[] getApacheSourceFiles(String extraActionFile) {
- return getSourceFiles(extraActionFile, Predicates.or(
- Predicates.containsPattern("storm-compatibility-examples.src.java"),
- Predicates.containsPattern("storm-compatibility.src.java"),
- Predicates.containsPattern("contrib")
- ));
+ return getSourceFiles(extraActionFile, APACHE_STYLE_FILES);
}
private static String[] getSourceFiles(String extraActionFile,
diff --git a/tools/java/src/org/apache/bazel/checkstyle/apache_coding_style.xml
b/tools/java/src/org/apache/bazel/checkstyle/apache_coding_style.xml
index be66b38..83c1171 100644
--- a/tools/java/src/org/apache/bazel/checkstyle/apache_coding_style.xml
+++ b/tools/java/src/org/apache/bazel/checkstyle/apache_coding_style.xml
@@ -70,7 +70,7 @@ under the License.
<property name="fileExtensions" value="java"/>
<property name="ignoreLines" value="9,11"/>
<message key="header.mismatch"
- value="Line does not match expected header line of ''{0}''. See
header template in tools/java/src/org/apache/bazel/checkstyle/header.txt"/>
+ value="Line does not match expected header line of ''{0}''. See
header template in
tools/java/src/org/apache/bazel/checkstyle/apache_header.txt"/>
</module>
<!-- Allows the ability to turn off/on checkstyles for a chunk of code.
Better to use the 1 line suppress method