Repository: incubator-hivemall
Updated Branches:
  refs/heads/master ecc480c98 -> ae0d3c410


Changed to use spotless-maven-plugin for the formatter


Project: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-hivemall/commit/ae0d3c41
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/tree/ae0d3c41
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/diff/ae0d3c41

Branch: refs/heads/master
Commit: ae0d3c4106250600f5922782d4c8a83a99e1feb9
Parents: ecc480c
Author: Makoto Yui <[email protected]>
Authored: Fri Apr 27 15:28:30 2018 +0900
Committer: Makoto Yui <[email protected]>
Committed: Fri Apr 27 15:34:50 2018 +0900

----------------------------------------------------------------------
 bin/format_code.sh          | 21 +--------------------
 pom.xml                     | 24 +++++++++++++++---------
 resources/eclipse-style.xml |  2 +-
 3 files changed, 17 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hivemall/blob/ae0d3c41/bin/format_code.sh
----------------------------------------------------------------------
diff --git a/bin/format_code.sh b/bin/format_code.sh
index 358e276..27b4f0d 100755
--- a/bin/format_code.sh
+++ b/bin/format_code.sh
@@ -32,23 +32,4 @@ fi
 cd $HIVEMALL_HOME
 HIVEMALL_HOME=`pwd`
 
-mvn clean
-
-# workaround for muti-module projects
-# https://github.com/revelc/formatter-maven-plugin/issues/261
-# mvn formatter:format
-
-projects=(
-  core
-  nlp
-  xgboost
-  mixserv
-  spark/common
-  tools/hivemall-docs
-)
-
-for pl in ${projects[@]}; do
-  echo "Start formatting ${pl} .."
-  mvn -pl ${pl} formatter:format
-  echo
-done
+mvn clean spotless:apply

http://git-wip-us.apache.org/repos/asf/incubator-hivemall/blob/ae0d3c41/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index cb58ff6..5a78bd1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -463,15 +463,21 @@
                                        
<artifactId>maven-enforcer-plugin</artifactId>
                                        <version>3.0.0-M1</version>
                                </plugin>
+                               <!-- mvn spotless:apply -->
                                <plugin>
-                                       <!-- mvn formatter:format -->
-                                       <groupId>net.revelc.code</groupId>
-                                       
<artifactId>formatter-maven-plugin</artifactId>
-                                       <version>0.5.2</version> <!-- for Java7 
compatibility -->
+                                       <groupId>com.diffplug.spotless</groupId>
+                                       
<artifactId>spotless-maven-plugin</artifactId>
+                                       <version>1.0.0.BETA4</version>
                                        <configuration>
-                                               
<configFile>${main.basedir}/resources/eclipse-style.xml</configFile>
+                                               <java>
+                                                       <eclipse>
+                                                               
<file>${main.basedir}/resources/eclipse-style.xml</file>
+                                                               
<version>4.7.2</version>
+                                                       </eclipse>
+                                                       
<encoding>UTF-8</encoding>
+                                               </java>
                                                <encoding>UTF-8</encoding>
-                                               <lineEnding>LF</lineEnding>
+                                               <lineEndings>UNIX</lineEndings>
                                        </configuration>
                                </plugin>
                                <plugin>
@@ -645,10 +651,10 @@
                                        </execution>
                                </executions>
                        </plugin>
-                       <!-- mvn formatter:format -->
+                       <!-- mvn spotless:apply -->
                        <plugin>
-                               <groupId>net.revelc.code</groupId>
-                               <artifactId>formatter-maven-plugin</artifactId>
+                               <groupId>com.diffplug.spotless</groupId>
+                               <artifactId>spotless-maven-plugin</artifactId>
                        </plugin>
                        <plugin>
                                <!-- mvn license:check; mvn license:format -->

http://git-wip-us.apache.org/repos/asf/incubator-hivemall/blob/ae0d3c41/resources/eclipse-style.xml
----------------------------------------------------------------------
diff --git a/resources/eclipse-style.xml b/resources/eclipse-style.xml
index b6590a0..2928cac 100644
--- a/resources/eclipse-style.xml
+++ b/resources/eclipse-style.xml
@@ -186,7 +186,7 @@
 <setting 
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression"
 value="insert"/>
 <setting 
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference"
 value="do not insert"/>
 <setting 
id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" 
value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" 
value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" 
value="false"/>
 <setting 
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer"
 value="insert"/>
 <setting 
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try" 
value="do not insert"/>
 <setting 
id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources"
 value="insert"/>

Reply via email to