Radarlint Configuration

Radarlint is a static analysis tool that brings open source SonarQube-style analysis to Qlty CLI. It provides linting and security scanning capabilities for multiple languages including Java, Kotlin, Python, PHP, and Go.

Radarlint and Qlty Software is not affiliated with SonarQube or SonarSource.

Overview

Radarlint wraps open source SonarLint analyzers to provide:

  • Code quality checks based on SonarQube rules
  • Security vulnerability detection (SAST)
  • Configurable rule sets per language
  • Pass-through support for Sonar analyzer properties

Configuration File

Radarlint supports configuration via a radarlint.properties file placed in your project root. This file allows you to control both Sonar analyzer properties and individual rule toggles.

File Location

The configuration file should be placed at the root of your repository:

your-project/
├── radarlint.properties
├── src/
│ └── ...

Property Types

There are two main types of properties you can configure:

Sonar Properties

Standard SonarQube properties are passed directly to the underlying Sonar analyzers. These properties must start with sonar. to be recognized.

Common Sonar properties include:

PropertyDescriptionExample
sonar.java.sourceJava source version17
sonar.java.targetJava target version17
sonar.python.versionPython version3.11
sonar.go.exclusionsFiles to exclude for Go**/*_test.go

Example:

1sonar.java.source=17
2sonar.java.target=17
3sonar.python.version=3.11

Rule Properties

Rule properties control the enabling or disabling of specific rules. They follow the format:

radarlint.rules.<language>.<ruleKey>=<true|false>

Where:

  • <language>: The language identifier (e.g., java, kotlin, python, php, go)
  • <ruleKey>: The Sonar rule identifier (e.g., S1110, S2196)
  • Value: Must be exactly true or false (case-sensitive)

Example:

1radarlint.rules.java.S1110=true
2radarlint.rules.java.S2196=false
3radarlint.rules.python.S5754=false
4radarlint.rules.kotlin.S6530=true

This configuration:

  • Enables rule java:S1110 (redundant parentheses)
  • Disables rule java:S2196 (equals method override)
  • Disables rule python:S5754
  • Enables rule kotlin:S6530

Finding Rule Keys

To find the rule key for a specific issue:

  1. Run qlty check to see issues with their rule identifiers
  2. The rule key appears in the format language:SnnNN (e.g., java:S1110)
  3. Use the rule number (e.g., S1110) in your configuration

You can also browse the SonarQube Rules documentation to find rules by category or keyword.

Complete Example

Here’s a complete radarlint.properties file:

1# Java configuration
2sonar.java.source=17
3sonar.java.target=17
4
5# Python configuration
6sonar.python.version=3.11
7
8# Rule overrides - Java
9radarlint.rules.java.S1110=true
10radarlint.rules.java.S2196=false
11radarlint.rules.java.S1135=false
12
13# Rule overrides - Kotlin
14radarlint.rules.kotlin.S6530=true
15
16# Rule overrides - Python
17radarlint.rules.python.S5754=false

Enabling Radarlint in Qlty

To use radarlint with Qlty CLI, enable the appropriate plugin in your qlty.toml:

1[[plugin]]
2name = "radarlint-java"
3
4[[plugin]]
5name = "radarlint-kotlin"
6
7[[plugin]]
8name = "radarlint-python"

Or enable via the CLI:

$qlty plugins enable radarlint-java
>qlty plugins enable radarlint-kotlin

Property Parsing Rules

Understanding how radarlint parses properties helps avoid configuration issues:

  • Properties not starting with sonar. or radarlint.rules. are silently ignored
  • Rule property values must be exactly true or false (case-sensitive)
  • Invalid rule values (e.g., yes, 1, TRUE) are ignored
  • If radarlint.properties is missing, radarlint uses default settings
  • Empty lines and lines starting with # are treated as comments

Troubleshooting

Rules Not Being Applied

If your rule configuration isn’t taking effect:

  1. Verify the properties file is named exactly radarlint.properties
  2. Check that rule keys match the format radarlint.rules.<language>.<ruleKey>
  3. Ensure values are lowercase true or false
  4. Confirm the rule key exists for your language version

Analyzer Errors

If you see errors related to language version mismatches:

  1. Set the appropriate sonar.<language>.source or sonar.<language>.version property
  2. Ensure your project files are compatible with the specified version

Viewing Applied Configuration

Run Qlty in debug mode to see configuration details:

$qlty check --debug

See Also