Rust Language Support

Summary

FeatureStatusNotes
MaintainabilityComplexity, duplication, code smells
Linting
Auto-formatting
Custom checks
Security scanningAppSec, dependencies, and secrets
Code metrics
Code coverage

Details

Maintainability
ComplexityAka cognitive complexity
Cyclomatic complexity
Identical code duplication
Similar code duplication
Code smells
Linters
ClippyRust linter providing a collection of lints
Auto-formatters
rustfmtOfficial Rust code formatter
Custom checks
ast-grep
Semgrep
ripgrep
Security scanning
GitleaksSecrets scanning
OSV-ScannerDependency scanning (SCA)
SemgrepAppSec (SAST)
TrivyDependency scanning (SCA)
TruffleHogSecrets scanning
Code coverage
cargo test
grcov
Cobertura coverage format
LCOV coverage format

File extensions

By default, Rust files are defined as:

[file_types.rust]
globs = ["*.rs"]

These patterns can be overridden from qlty.toml.

Test detection

Rust test functions are automatically detected using the following patterns:

[language.rust]
test_syntax_patterns = ["""
(
(mod_item
name: (identifier) @name)
(#eq? @name "test")
)
""", """
(
(attribute_item
(attribute
(identifier) @meta_item))
(function_item) @function
(#eq? @meta_item "test")
)
"""]

Supported Rust versions

We officially support Rust 1.30 and later for maintainability checks and code coverage. Each plugin may have its own version requirements.