Skip to content

Commit

Permalink
scalastyle add return check (warning level)
Browse files Browse the repository at this point in the history
  • Loading branch information
yzhliu committed Dec 31, 2015
1 parent def4e70 commit ab87ca9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions scala-package/core/scalastyle-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,7 @@ You can also disable only one rule, by specifying its rule id, as specified in:
<check level="error" class="org.scalastyle.scalariform.IllegalImportsChecker" enabled="true">
<parameters><parameter name="illegalImports"><![CDATA[sun._,java.awt._]]></parameter></parameters>
</check>

<!-- We can use return quite a bit for control flows and guards -->
<check level="warning" class="org.scalastyle.scalariform.ReturnChecker" enabled="true"></check>
</scalastyle>
4 changes: 2 additions & 2 deletions scala-package/core/src/main/scala/ml/dmlc/mxnet/IO.scala
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ object IO {
val keys = params.keys.toArray
val vals = params.values.toArray
checkCall(_LIB.mxDataIterCreateIter(handle, keys, vals, out))
return new MXDataIter(out)
new MXDataIter(out)
}
}

Expand Down Expand Up @@ -180,7 +180,7 @@ class MXDataIter(val handle: DataIterHandle) extends DataIter {
val outIndex = new ListBuffer[Long]
val outSize = new RefLong
checkCall(_LIB.mxDataIterGetIndex(handle, outIndex, outSize))
return outIndex.toList
outIndex.toList
}

/**
Expand Down
1 change: 1 addition & 0 deletions tests/travis/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ if [ ${TASK} == "scala_test" ]; then
fi

if [ ${TASK} == "scala_lint" ]; then
export JAVA_HOME=$(/usr/libexec/java_home)
cd scala-package/core
mvn scalastyle:check || exit -1
exit 0
Expand Down

0 comments on commit ab87ca9

Please sign in to comment.