IntelliJ | Using SonarLint | File exclusions

On this page

File exclusions

All versions of SonarLint will fetch file exclusions from the SonarQube or SonarCloud server when you bind a project or update a binding while running in Connected Mode. Check the SonarQube and SonarCloud documentation for information about setting your Analysis scope.

File exclusions in the IDE

Go to IntelliJ Settings > Tools > SonarLint > File Exclusions to define an exclusion pattern. SonarLint for IntelliJ will accept wildcard patterns as described in the SonarQube and SonarCloud documentation.

Wildcard patterns

The recognized path-matching patterns are defined using the following wildcards:

  • *  Match zero or more characters (not including the directory delimiter,  / ).
  • **  Match zero or more directory segments within the path.
  • ?  Match a single character (not including the directory delimiter,  / ).

Wildcard examples

  • The pattern  **/*.css
    • matches  anyDirectory/anyFile.css
    • doesn't match  org/sonar.api/
  • The pattern  **/*
    • matches  org/sonar.api/
    • doesn't match  org/sonar/util/
  • The pattern  **/*Bean?.java
    • matches  org/sonar/util/
    • doesn't match  org/sonar/util/
  • The pattern  org/sonar/*
    • matches  org/sonar/
    • doesn't match  org/sonar/util/
  • The pattern  org/sonar/**/*
    • matches  org/sonar/
    • doesn't match  org/radar/

© 2015-2023, SonarSource S.A, Switzerland. Except where otherwise noted, content in this space is licensed under the GNU Lesser General Public License, Version 3.0. SONARLINT is a trademark of SonarSource SA. All other trademarks and copyrights are the property of their respective owners. See for everything you need to know about the Sonar Solution.

Creative Commons License