Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Netbeans + Checkstyle

Does anyone have experience using checkstyle in netbeans 7? I have the plugin installed, and I have selected my configuration file but I'm not seeing any errors or the promised "annotation". Any suggestions? Is there something I need to do to get it to start working? I have the plugin activated in the plugins menu.

like image 429
Dalton Conley Avatar asked Sep 07 '11 19:09

Dalton Conley


People also ask

What is the use of checkstyle?

Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard. It automates the process of checking Java code to spare humans of this boring (but important) task. This makes it ideal for projects that want to enforce a coding standard.

How do I use FindBugs in NetBeans?

FindBugs in NetBeans The installation process is very simple just select FindBugs from the Configuration options and click Install. Once that is done select the project or class that you want to inspect and click on Inspect button. FindBugs will run the inspection automatically outputting all the errors encountered.

How can I view source code in NetBeans?

Right click, and from the context menu select Navigate > Go to Source and you should be redirected to the appropriate position within the source of the JDK class. Alternatively, press Ctrl + Shift + B.

Is checkstyle a Linter?

Checkstyle is one of the most popular linters available. With this popularity comes regular updates, thorough documentation, and ample community support.


1 Answers

Follow the directions in this article. You might need to restart Netbeans after installing the plugins. Code violations should appear as annotations on the line number gutter.

You can then go to the tools/options/quality/checkstyle tab to set your custom checkstyle configuration files.

Not sure if this is important but make sure that your custom checkstyle.xml uses the Check Configuration 1.3 version.

<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
like image 194
Leo Avatar answered Oct 11 '22 01:10

Leo