Jarl
Jarl is a fast linter for R: it does static code analysis to search for programming errors, bugs, and suspicious patterns of code.
- Orders of magnitude faster than
lintrandflir1 - Automatic fixes when possible
- Support for 55+ rules (and growing)
- Integration in popular IDEs and editors (VS Code, Positron, Zed, …)
- Command-line interface (CLI)
- Multiple output modes (concise, detailed, JSON format)
- CI workflow
Jarl is built on Air, a fast formatter for R written in Rust.
Quick start
See:
- “Getting started” for an intro to Jarl;
- “By Example” for short examples of what Jarl can do;
- “Editors”, “Continuous integration”, and “Pre-commit tools” to integrate Jarl into your development tools.
This shows what it looks like in the terminal:
test.R:
any(is.na(x))
if (all.equal(x, y)) {
print("x and y are equal")
}# In the terminal:
$ jarl check test.R
warning: any_is_na
--> test.R:1:1
|
1 | any(is.na(x))
| ------------- `any(is.na(...))` is inefficient.
|
= help: Use `anyNA(...)` instead.
warning: all_equal
--> test.R:3:5
|
3 | if (all.equal(x, y)) {
| --------------- `all.equal()` can return a string instead of FALSE.
|
= help: Wrap `all.equal()` in `isTRUE()`, or replace it by `identical()` if
no tolerance is required.
Found 2 errors.
1 fixable with the `--fix` option (1 hidden fix can be enabled with the
`--unsafe-fixes` option).
Use --fix to automatically fix rule violations when possible:
$ jarl check test.R --fixtest.R:
anyNA(x)
if (all.equal(x, y)) {
print("x and y are equal")
}Installation
Released version
Either get binaries from the Releases page or install Jarl from the existing installer scripts below.
macOS and Linux:
curl --proto '=https' --tlsv1.2 -LsSf \
https://github.com/etiennebacher/jarl/releases/latest/download/jarl-installer.sh | shWindows:
powershell Set-ExecutionPolicy Bypass -Scope Process -Force; `
iwr https://github.com/etiennebacher/jarl/releases/latest/download/jarl-installer.ps1 | iexIf you use Scoop, you can also install or update Jarl with these commands:
scoop bucket add r-bucket https://github.com/cderv/r-bucket.git
# install
scoop install jarl
# update
scoop update jarlDevelopment version
Some pre-releases may be available from the Releases page (the version usually contains alpha, see the installation instructions there).
Alternatively, if you have Rust installed, you should be able to get the development version with:
cargo install --git https://github.com/etiennebacher/jarl jarl --profile=release
Click if you installed the development version via cargo
Using the pre-built binaries will install Jarl in $HOME/.local/bin, e.g. /home/etienne/.local/bin/jarl.
Using cargo will install Jarl in $HOME/.cargo/bin, e.g. /home/etienne/.cargo/bin/jarl.
If you have both installed, the .local/bin one will take precedence. Therefore, to run the version compiled with cargo, you must either delete the one in .local/bin or use the absolute path, e.g. /home/etienne/.cargo/bin/jarl check ..
Acknowledgements
lintrauthors and contributors: while the infrastructure is completely different, all the rule definitions and a large part of the tests are inspired or taken fromlintr.- Davis Vaughan and Lionel Henry, both for their work on Air and for their advices and answers to my questions during the development of Jarl.
- the design of Jarl is heavily inspired by Ruff and Cargo clippy.
- R Consortium for funding part of the development of Jarl.

Footnotes
Using 20 rules on the
dplyrpackage (~25k lines of R code), Jarl took 0.131s,flirtook 4.5s, andlintrtook 18.5s (9s with caching enabled).↩︎