Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Bloc exclusion patterns (sonar.switchoffviolations.block) to switch off violations on specific blocks of code. Note: if the first regular expression is found but not the second one, then the plugin considers that the end of the code block is the end of the file.
    • Example: exclude code blocks delimited by GEN-FIRST and GEN-LAST (like NetBeans auto-generated code):

 

Info
titleVersions prior to 1.3

Set the sonar.switchoffviolations.patterns property:

Code Block
titleExamples
languagenone
# Switch off all violations (Java projects: structure = packages)
*;*;*

# Exclude a specific rule
*;checkstyle:com.puppycrawl.tools.checkstyle.checks.design.DesignForExtensionCheck;*

# Exclude on manyseveral ranges of lines
com.foo.Bar;*;[10-90,92,98,120-150]
 
# Since 1.2: exclude Exclude code blocks delimited by GEN-FIRST and GEN-LAST (like NetBeans auto-generated code)
GEN-FIRST;GEN-LAST
 
# Since 1.2: exclude Exclude files containing "@javax.annotation.Generated"
@javax\.annotation\.Generated

Usage

...