Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

SonarLint for Eclipse — Proactive Code Quality Checks

DZone's Guide to

SonarLint for Eclipse — Proactive Code Quality Checks

How to get started using SonarLint with Eclipse to get on-the-fly feedback on code quality issues while using the IDE.

· DevOps Zone
Free Resource

The Nexus Suite is uniquely architected for a DevOps native world and creates value early in the development pipeline, provides precise contextual controls at every phase, and accelerates DevOps innovation with automation you can trust. Read how in this ebook.

This blog talks about the SonarLint tool for Eclipse IDE, which can used by developers to get on-the-fly feedback for code quality issues while coding. This feature was always one of the most awaited features of Sonar and thankfully, it’s out there for Java, Javascript, and PHP developers to try for themselves.

The following is how to get started:

  • To download and install SonarLint for Eclipse from within Eclipse IDE, all you need to do is go to this page (http://www.sonarlint.org/eclipse/) and click on the “Marketplace” button which takes you to the install page. Drag and drop the “install” button into your eclipse workspace and it should start downloading and installing.
  • Restart Eclipse and you are all set.

I tested it with a HelloWorld program and got following code quality assistance. Note the information such as “Replace this usage of System.out or System.err by a logger”.

sonarlint_for_eclipse_helloworld

In the current version, SonarLint does not support integration with SonarQube server. The integration of SonarLint with SonarQube server would achieve some of the following objectives:

  • Each project could set their own code quality rules (or configure rules) in SonarQube server.
  • The project teams would then be able to validate their code using SonarLint against the rules set for that project team.

The above would help the developers avoid the code quality issues much before they appear in the Sonar dashboard.

Feel free to try it out or recommend it for your projects. The downside (as I have not yet tested) is that it may slow your environment because a background task always running and checking the code quality issue. However, you could disable this by right-clicking on the project and disabling SonarLint.

The DevOps Zone is brought to you in partnership with Sonatype Nexus.  See how the Nexus platform infuses precise open source component intelligence into the DevOps pipeline early, everywhere, and at scale. Read how in this ebook

Topics:
sonar ,lint ,eclipse

Published at DZone with permission of Ajitesh Kumar, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}