How to use scct and Scala Style in Scala-Sbt project

Table of contents
Reading Time: < 1 minute

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.

Written by 

Rishi is a tech enthusiast with having around 10 years of experience who loves to solve complex problems with pure quality. He is a functional programmer and loves to learn new trending technologies. His leadership skill is well prooven and has delivered multiple distributed applications with high scalability and availability by keeping the Reactive principles in mind. He is well versed with Scala, Akka, Akka HTTP, Akka Streams, Java8, Reactive principles, Microservice architecture, Async programming, functional programming, distributed systems, AWS, docker.