In this blog, I’ll explain the use of scct and scalastyle in your Scala-Sbt project.
scct is Scala code coverage tool. It tests the code coverage using test cases. It measures that how much code is covered by test cases and then it creates test coverage report (index.html) which resides at following position :
For good programming, code coverage should be greater that 90 %.
Add this line in build.sbt file :
Add this line in target/plugins.sbt file :
To run scct, follow this command :
Scalastyle is used to examine your Scala code. When we run scalastyle then it gives warnings for the code which does not follow scala style guidelines.
Add this line in build.sbt file :
Add this line in target/plugins.sbt file:
To run scala style, follow this command :
For good Scala code, warning should be zero. Sometimes we get the condition, where we have to break scala style guideline, but that is in very rare case. In general, waring should be zero.