Skip to content

Commit

Permalink
using jar distribution of checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlesZ-Chen committed Dec 11, 2016
1 parent eef4e94 commit 4451b29
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 12 deletions.
9 changes: 7 additions & 2 deletions run-check.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/bash
SCRIPT_DIR=$(cd $(dirname "$0") && pwd)
ROOT_DIR=$(cd $SCRIPT_DIR/.. && pwd)
java -cp $ROOT_DIR/checkstyle/target/classes:$(ls $ROOT_DIR/checkstyle/target/dependency/*.jar | tr '\n' : | rev | cut -c 2- | rev) com.puppycrawl.tools.checkstyle.Main -c multiDeclChecks.xml -f json "$@"
# java -cp $ROOT_DIR/checkstyle/target/classes:$(ls $ROOT_DIR/checkstyle/target/dependency/*.jar | tr '\n' : | rev | cut -c 2- | rev) com.puppycrawl.tools.checkstyle.Main -t "$@"

CHECK_STYLE_ALL_JAR=$ROOT_DIR/checkstyle/target/checkstyle-7.4-SNAPSHOT-all.jar

java -jar $CHECK_STYLE_ALL_JAR -c multiDeclChecks.xml -f json "$@"


# mvn clean install -DskipTests -Dcheckstyle.ant.skip -Dcobertura.skip
10 changes: 9 additions & 1 deletion run-refactor.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
#!/bin/bash
SCRIPT_DIR=$(cd $(dirname "$0") && pwd)
ROOT_DIR=$(cd $SCRIPT_DIR/.. && pwd)
java -cp $ROOT_DIR/checkstyle/target/classes:$(ls $ROOT_DIR/checkstyle/target/dependency/*.jar | tr '\n' : | rev | cut -c 2- | rev) com.puppycrawl.tools.checkstyle.Main -c $SCRIPT_DIR/multiDeclChecks.xml -f json "$@" | python $SCRIPT_DIR/multiDeclRefactor.py

CHECK_STYLE_ALL_JAR=$ROOT_DIR/checkstyle/target/checkstyle-7.4-SNAPSHOT-all.jar

java -jar $CHECK_STYLE_ALL_JAR -c multiDeclChecks.xml -f json "$@" | python $SCRIPT_DIR/multiDeclRefactor.py

##develop version call: using eclipse output of checkstyle, running refactor frontend
# java -cp $ROOT_DIR/checkstyle/target/classes:$(ls $ROOT_DIR/checkstyle/target/dependency/*.jar | tr '\n' : | rev | cut -c 2- | rev) com.puppycrawl.tools.checkstyle.Main -c $SCRIPT_DIR/multiDeclChecks.xml -f json "$@" | python $SCRIPT_DIR/multiDeclRefactor.py

## develop version call: using eclipse output of checkstyle, print AST tree
# java -cp $ROOT_DIR/checkstyle/target/classes:$(ls $ROOT_DIR/checkstyle/target/dependency/*.jar | tr '\n' : | rev | cut -c 2- | rev) com.puppycrawl.tools.checkstyle.Main -t "$@"
20 changes: 11 additions & 9 deletions test/Test.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import java.util.*;
public class Test {
protected int f;
protected int g;
protected int f, g;

public int[] a = {1,2,3};
public int[] b = new int[0];
public int[] c = Test.<Object, Object>m(a, b);
public int[] d = new int [2];
public int[] e = {1,2,3};
public int[] a = {1,2,3}, // line comment with ;
/* multi line comment
* asd
(*/
b = new int[0],
/*insance comment*/ c = Test.<Object, Object>m(a, b),
d = new int [2], // comment
/*insance comment*/
e = {1,2,3};

public int i;
public int j;
public int i, j;

static <T1, T2> int[] m(T1 t1, T2 t2) {
return new int[0];
Expand Down

0 comments on commit 4451b29

Please sign in to comment.