Scala Clippy : Why no one is talking about?

Table of contents
Reading Time: 2 minutes

Scala Clippy : The Helping Hand

Hi all, I am back with another blog. This one is really interesting. As a developer, we usually come across many types of compilation errors some take a hard time to rectify it. This is what we require Scala Clippy. Scala Clippy provides a human-friendly explanation to some of the common errors that we make. Let’s take a simple example,

ScalaClippyEg1

Now these type of errors is presented like this when we use Scala Clippy:

ScalaClippyEg2

Now you may be wondering how these errors are identified and we get advice related to it.

Simple, these are provided by the Scala community. If you visit their official website Scala Clippy where you can find a tab “Contribute”. Under that, we can post our own errors. These errors are parsed first, and when successful we can add our advice which will be reviewed and if accepted it will be added to their database which will, in turn, be beneficial to others.

Now next question will be, how to add this in our project.

Add a plugin

The easiest way to use clippy is through sbt plugin.

addSbtPlugin(“com.softwaremill.clippy” % “plugin-sbt” % “0.5.3”)

In first compilation, it will download the advice dataset (i.e advice list) from their official website and store it in $HOME/.clippy which will be automatically updated in the background once in a day.

We are done…….!!

Will this affect the performance?

Not much because this plugin only acts when there’s a compiler error. So adding an overhead to a failure will not affect that much.

I am leaving my GitHub link for the above example for reference.

Scala Clippy GitHub

Thank you for your patience.

Happy coding….!!

References

Scala Clippy Official Website

Software MILL


knoldus-advt-sticker

Written by 

I am a Software Consultant at Knoldus Inc. I am a Scala Enthusiast. I am familiar with Object Oriented Programming Paradigms, and has also worked upon .NET based technologies. Aside from being a programmer, I am familiar with NoSQL database technologies such like Cassandra. I also worked on Lagom microservice architecture.

2 thoughts on “Scala Clippy : Why no one is talking about?1 min read

Comments are closed.

Discover more from Knoldus Blogs

Subscribe now to keep reading and get access to the full archive.

Continue reading