Repository navigation
0.7.0
Jarl 0.7.0
Breaking changes
-
The command-line argument
--assignmentand thejarl.tomlargumentassignment
(both deprecated since 0.5.0) are removed. Use the rule-specific option
[lint.assignment]injarl.tomlinstead (#663, #758). -
The rule
browser(deprecated since 0.5.0) is removed. Use the rule
undesirable_functioninstead (#757). -
A fix can now edit several places of a file at once, so in the
jsonoutput
format thefixobject contains a list of edits instead of a single
content/rangepair (#700):"fix": { "edits": [ { "range": [0, 13], "content": "anyNA(x)" } ], "to_skip": false }
Deprecations
- The
internal_functionrule is deprecated and disabled by default. Use
undesirable_operatorinstead (#657).
New and improved rules
-
New rules:
consecutive_signs(#745, @Yousa-Mirage)cyclomatic_complexity(#731)library_call(#701)undesirable_operator(#657, @christopherkenny)yoda_condition(#733, @Yousa-Mirage)
-
Improved rules:
-
expect_lengthno longer reports cases wherelength()is in theexpected
argument, e.g.expect_equal(nrow(x), length(y))(#684). -
nzcharnow also reports comparisons ofnchar(x)with zero, such as
nchar(x) == 0, and its fixes preserve missing values with
keepNA = TRUE(#705, @Yousa-Mirage). -
The
expect_typerule no longer lintsexpect_true(is.null(x)), which was
already reported by theexpect_nullrule (#680, @Yousa-Mirage).
-
Other improvements
-
jarl check --stdin-file-path <PATH>lints code read from stdin, using<PATH>
for config discovery, package detection,excludepatterns and diagnostics (#749). -
The config file can be named
.jarl.tomlas well asjarl.toml. Both names
are equivalent, and a directory containing both is now an error instead of
silently usingjarl.toml(#717). -
Only use placeholder text in messages and suggestions (#722).
-
The LSP now also publishes diagnostics when opening a file (#685).
-
The CLI now prints a message suggesting
fix-roxygen = truewhen some fixes
cannot be applied because the violation is in part of@examples(#702). -
The JSON output now contains information on the fix ("safe", "unsafe", or "none")
(#747) and reports more information on syntax errors (message,range,location)
(#748).
Bug fixes
-
Recognize parenthesized
TRUEconditions inrepeatand preserve loop body
comments when applying fixes (#754, @Yousa-Mirage). -
Handle uppercase
.RMD/.QMDextensions (and any other letter-case variant)
files consistently (#709, @Yousa-Mirage). -
Prevent the
nzcharrule from treating quote characters as empty strings and
support empty raw string literals (#696, @Yousa-Mirage). -
Jarl now properly checks the components of selector, extraction, and namespace
AST nodes ([[,@,$,::,:::) (#697, @Yousa-Mirage). -
The
githubandsarifoutput formats now report parsing errors to stderr
instead of silently dropping them (#695, @Yousa-Mirage). -
Prevent the
sample_intrule from panicking on calls with missing arguments
(#687, @Yousa-Mirage). -
Prevent the
outer_negationrule from rewriting unary+and-expressions
as logical negations (#688, @Yousa-Mirage). -
Prevent fixes for
any_is_na,any_duplicated, andcondition_message
from dropping extra unnamed arguments (#677, @Yousa-Mirage). -
The
lengthsrule no longer crashes on calls whereXis missing from the
syntax tree, e.g.sapply(FUN = length)orx |> sapply(FUN = length). The
autofix now also produceslengths(x)instead of the invalid
lengths(X = x)whenXis passed by name (#671, @Yousa-Mirage). -
Fix language server suppression quickfix positions for non-ASCII text and
Rmd/Qmd chunk insertion positions (#676, #708, @Yousa-Mirage). -
Prevent
unused_functionandunused_objectfrom falsely reporting non-ASCII
names (#706, @Yousa-Mirage). -
Ensure that
--fixworks with multi-byte characters (#672, @Yousa-Mirage). -
Avoid invalid
literal_coercionfixes for strings containing quotes
(#678, @Yousa-Mirage). -
The
pipe_consistencyrule no longer emits invalid fixes when converting
magrittrpipes with a non-call RHS, such asx %>% sum(#683, @Yousa-Mirage). -
Prevent incorrect
dplyr_filter_outfixes caused by matchingis.na()guard
arguments as substrings of other identifiers (#681, @Yousa-Mirage). -
In R Markdown and Quarto documents,
unreachable_codeno longer reports code
in chunks following a chunk that would stop evaluation but is either unevaluated or
haserror: true(#724).
Install jarl 0.7.0
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/etiennebacher/jarl/releases/download/0.7.0/jarl-installer.sh | shInstall prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://github.com/etiennebacher/jarl/releases/download/0.7.0/jarl-installer.ps1 | iex"Download jarl 0.7.0
| File | Platform | Checksum |
|---|---|---|
| jarl-aarch64-apple-darwin.tar.gz | Apple Silicon macOS | checksum |
| jarl-x86_64-apple-darwin.tar.gz | Intel macOS | checksum |
| jarl-x86_64-pc-windows-msvc.zip | x64 Windows | checksum |
| jarl-x86_64-pc-windows-msvc.msi | x64 Windows | checksum |
| jarl-aarch64-unknown-linux-gnu.tar.gz | ARM64 Linux | checksum |
| jarl-x86_64-unknown-linux-gnu.tar.gz | x64 Linux | checksum |
| jarl-aarch64-unknown-linux-musl.tar.gz | ARM64 MUSL Linux | checksum |
| jarl-x86_64-unknown-linux-musl.tar.gz | x64 MUSL Linux | checksum |