SkillAgentSearch skills...

Sonarlint4netbeans

SonarLint integration for Apache Netbeans

Install / Use

/learn @philippefichet/Sonarlint4netbeans

README

:toc: :toclevels: 5

= sonarlint4netbeans

== SonarLint integration for Apache Netbeans

This plugin is a https://www.sonarlint.org/[sonarlint] integration for netbeans. + It requests netbeans in version 13.0 or higher and Java in version 11 or higher. +

== Features

  • Support Java, Javascript, PHP, HTML and XML
  • Annotation in editor
  • Type SonarLint in Action Items
  • "Analyze with SonarLint" action on Project/package/files, Favorites tab, ...
  • Enable/Disable Rules in Tools/Options/Miscellaneous/SonarLint
  • Filter Rules in Tools/Options/Miscellaneous/SonarLint option panel and "Sonar Rule Details" window
  • Change rule settings in Tools/Options/Miscellaneous/SonarLint or in "Sonar Rule Details" window
  • Enable/Disable/Configure Rules by project
  • Add or remove analyse properties (global or by project)
  • Restore selected rule from activated by default
  • Add or update plugins from configuration
  • Custom "Sonar Rule Details" window with CSS
  • Enable or disabled test rules on test files
  • Severity icons
  • Partial Support on C/C++ project (show xref:README-CFamily.adoc[README-CFamily])

== Release 2.x to 3.x

=== Plugins

SonarLint no longer uses URLs to find plugins but file paths. + You have to update the path to the plugins you added in Tools -> Options -> Miscelaneous -> SonarLint -> Plugins. +

=== Analyse properties

Now global properties and project properties are merged on files belonging to a project. + ${projectDir} is now replaced by the absolute path of the project for files belonging to it. +

== Release 1.x to 2.x

Release 2.0.0 want publish this plugin in new Netbeans portal based on Maven central repository. + For this, all package are renamed and have

=== Preferences

In Netbeans User dirrectory move config/Preferences/fr/philippefichet/sonarlint/netbeans.properties to config/Preferences/com/github/philippefichet/sonarlint4netbeans/netbeans.properties. +

You can found Netbeans User directory in menu Help/About. +

== "Analyze with SonarLint"

You can run an "Analyze with SonarLint by context menu (click right) on project, folder, many file, ... + This action is visible directly in context menu on through Tools sub menu. +

.Analyze with SonarLint on project image::docs/SonarLintAnalyzerOnProject.jpg[]

.Analyze with SonarLint in Favorites tab image::docs/SonarLintAnalyzerOnFavorites.jpg[]

== Rule settings

You can change rule settings by left click on this icon image:docs/icon-settings.png[] in Tools/Options/Miscellaneous/SonarLint or in "Sonar Rule Details" window. +

When a rule has no settings, this icon image:docs/icon-settings-empty.png[] is present. +

.Sonar rule details window with name filter image::docs/SonarRuleDetailsWindowWithNameFilter.jpg[]

== Analyse properties (global or by project)

Properties can be added to the analysis by SonarLint, either globally or by project.+

== Add or update plugins from configuration

It is possible to add a plugin compatible with SonarLint by indicating a key and the URL of the plugin. + To avoid downloading the plugin each time it is used, it is recommended to download the plugin and use the file scheme +

Example:

[source]

file:/c:/path/to/plugin.jar <1> file:/path/to/plugin.jar <2>

<1> On Windows <2> On Linux or MacOS

== "Sonar rule details" window StyleSheet

You can customize "Sonar rule details" with CSS. +

Go to Tools/Options/Miscellaneous/SonarLint and click on "Options" and on button "Edit stylesheet for sonar rule detail window". +

[IMPORTANT]

CSS is limited by https://docs.oracle.com/javase/8/docs/api/javax/swing/text/html/CSS.html[javax.swing.text.html.CSS], consult the documentation to know the supported properties.

== Screenshot

.SonarLint in Java editor and show action items for selected project image::docs/JavaEditorAnnotationAndActionItems.jpg[]

.Show Action Items fo currently edited file only image::docs/JavascriptActionItems.jpg[]

.Analyze with SonarLint on project image::docs/SonarLintAnalyzerOnProject.jpg[]

.Analyze with SonarLint in Favorites tab image::docs/SonarLintAnalyzerOnFavorites.jpg[]

.SonarLint analyzer name and version image::docs/OptionsSonarLintAnalyzers.jpg[]

.SonarLint rules enabled or disabled image::docs/OptionsSonarLintRules.jpg[]

.SonarLint rules enabled or disabled with key filter image::docs/OptionsSonarLintRulesWithKeyFilter.jpg[]

.SonarLint rules enabled or disabled with name filter image::docs/OptionsSonarLintRulesWithNameFilter.jpg[]

.Restore selected rule from activated by default (before) image::docs/OptionsSonarLintRulesRestoreToDefaultBefore.jpg[]

.Restore selected rule from activated by default (after) image::docs/OptionsSonarLintRulesRestoreToDefaultAfter.jpg[]

.Add or remove analyse properties image::docs/OptionsSonarLintProperties.jpg[]

.Add or update plugins from configuration image::docs/OptionsSonarLintPlugins.jpg[]

.SonarLint Options image::docs/OptionsSonarLintOptions

.Sonar rule details window with key filter image::docs/SonarRuleDetailsWindowWithKeyFilter.jpg[]

.Sonar rule details window with name filter image::docs/SonarRuleDetailsWindowWithNameFilter.jpg[]

.Sonar rule details window with custom style image::docs/SonarRuleDetailsWindowWithCustomStyleSheet.jpg[]

.Sonar rule details window without change settings on java:S1067 rule image::docs/SonarRuleDetailsWithSettingsNoChangeJavaS1067.jpg[]

.Sonar rule details window with change to "5" the "max" settings on java:S1067 rule image::docs/SonarRuleDetailsWithSettingsChangeJavaS1067.jpg[]

.SonarLint global or project rules image::docs/SonarLintProjectOptions.jpg[]

.SonarLint Enable/Disable/Configure Rules by project image::docs/SonarLintProjectRules.jpg[]

.SonarLint Add or remove properties by project image::docs/SonarLintProjectProperties.jpg[]

Related Skills

View on GitHub
GitHub Stars35
CategoryDevelopment
Updated3mo ago
Forks10

Languages

Java

Security Score

92/100

Audited on Dec 20, 2025

No findings