Skip to content

0.7.0

Choose a tag to compare

@github-actions github-actions released this 20 Oct 22:42
· 1 commit to 9ad3bd56c141673bbcbd47f99e6878007a6fa6a8 since this release

Jarl 0.7.0

Breaking changes

  • The command-line argument --assignment and the jarl.toml argument assignment
    (both deprecated since 0.5.0) are removed. Use the rule-specific option
    [lint.assignment] in jarl.toml instead (#663, #758).

  • The rule browser (deprecated since 0.5.0) is removed. Use the rule
    undesirable_function instead (#757).

  • A fix can now edit several places of a file at once, so in the json output
    format the fix object contains a list of edits instead of a single
    content/range pair (#700):

    "fix": { "edits": [ { "range": [0, 13], "content": "anyNA(x)" } ], "to_skip": false }

Deprecations

  • The internal_function rule is deprecated and disabled by default. Use
    undesirable_operator instead (#657).

New and improved rules

  • New rules:

  • Improved rules:

    • expect_length no longer reports cases where length() is in the expected
      argument, e.g. expect_equal(nrow(x), length(y)) (#684).

    • nzchar now also reports comparisons of nchar(x) with zero, such as
      nchar(x) == 0, and its fixes preserve missing values with
      keepNA = TRUE (#705, @Yousa-Mirage).

    • The expect_type rule no longer lints expect_true(is.null(x)), which was
      already reported by the expect_null rule (#680, @Yousa-Mirage).

Other improvements

  • jarl check --stdin-file-path <PATH> lints code read from stdin, using <PATH>
    for config discovery, package detection, exclude patterns and diagnostics (#749).

  • The config file can be named .jarl.toml as well as jarl.toml. Both names
    are equivalent, and a directory containing both is now an error instead of
    silently using jarl.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 = true when 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 TRUE conditions in repeat and preserve loop body
    comments when applying fixes (#754, @Yousa-Mirage).

  • Handle uppercase .RMD/.QMD extensions (and any other letter-case variant)
    files consistently (#709, @Yousa-Mirage).

  • Prevent the nzchar rule 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 github and sarif output formats now report parsing errors to stderr
    instead of silently dropping them (#695, @Yousa-Mirage).

  • Prevent the sample_int rule from panicking on calls with missing arguments
    (#687, @Yousa-Mirage).

  • Prevent the outer_negation rule from rewriting unary + and - expressions
    as logical negations (#688, @Yousa-Mirage).

  • Prevent fixes for any_is_na, any_duplicated, and condition_message
    from dropping extra unnamed arguments (#677, @Yousa-Mirage).

  • The lengths rule no longer crashes on calls where X is missing from the
    syntax tree, e.g. sapply(FUN = length) or x |> sapply(FUN = length). The
    autofix now also produces lengths(x) instead of the invalid
    lengths(X = x) when X is 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_function and unused_object from falsely reporting non-ASCII
    names (#706, @Yousa-Mirage).

  • Ensure that --fix works with multi-byte characters (#672, @Yousa-Mirage).

  • Avoid invalid literal_coercion fixes for strings containing quotes
    (#678, @Yousa-Mirage).

  • The pipe_consistency rule no longer emits invalid fixes when converting
    magrittr pipes with a non-call RHS, such as x %>% sum (#683, @Yousa-Mirage).

  • Prevent incorrect dplyr_filter_out fixes caused by matching is.na() guard
    arguments as substrings of other identifiers (#681, @Yousa-Mirage).

  • In R Markdown and Quarto documents, unreachable_code no longer reports code
    in chunks following a chunk that would stop evaluation but is either unevaluated or
    has error: 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 | sh

Install 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