8

Scala Clippy : Why no one is talking about?

 3 years ago
source link: https://blog.knoldus.com/scala-clippy-why-no-one-is-talking-about/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Scala Clippy : Why no one is talking about?

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



About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK