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.
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:
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:
Example:
Rule Properties
Rule properties control the enabling or disabling of specific rules. They follow the format:
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
trueorfalse(case-sensitive)
Example:
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:
- Run
qlty checkto see issues with their rule identifiers - The rule key appears in the format
language:SnnNN(e.g.,java:S1110) - 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:
Enabling Radarlint in Qlty
To use radarlint with Qlty CLI, enable the appropriate plugin in your qlty.toml:
Or enable via the CLI:
Property Parsing Rules
Understanding how radarlint parses properties helps avoid configuration issues:
- Properties not starting with
sonar.orradarlint.rules.are silently ignored - Rule property values must be exactly
trueorfalse(case-sensitive) - Invalid rule values (e.g.,
yes,1,TRUE) are ignored - If
radarlint.propertiesis 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:
- Verify the properties file is named exactly
radarlint.properties - Check that rule keys match the format
radarlint.rules.<language>.<ruleKey> - Ensure values are lowercase
trueorfalse - Confirm the rule key exists for your language version
Analyzer Errors
If you see errors related to language version mismatches:
- Set the appropriate
sonar.<language>.sourceorsonar.<language>.versionproperty - Ensure your project files are compatible with the specified version
Viewing Applied Configuration
Run Qlty in debug mode to see configuration details:
See Also
- Available Plugins - List of all Qlty plugins including radarlint variants
- Analysis Configuration - General Qlty configuration
- Ignoring Checks and Issues - How to ignore specific issues