Skip to content

0.13.0

Latest

Choose a tag to compare

@github-actions github-actions released this 02 Nov 16:04

Release Notes

  • Air no longer utilizes tree-sitter-r
    for parsing R files. Instead, Air now ships with a completely custom R parser
    written entirely in Rust. This comes with a number of benefits!

    • Air is now roughly 2x faster. Formatting all of dplyr has gone from 300ms to
      150ms on an M2 Mac. The actual parsing stage is around 7x faster.

    • Air now emits precise error messages when a file fails to parse due to
      syntax errors.

    • Air no longer has C in its dependency chain. This means that we'll be able
      to add WASM support for Air much easier now.

    If you are building a Rust based project that needs to parse R files, we
    encourage you to use our air_r_parser crate (pinned to a git SHA since we
    haven't put it on crates.io yet).

  • We've fixed a number of minor issues through the new parser:

    • Air more accurately accepts certain syntax:

      • r"|...|", which are raw strings using the undocumented | delimiter

      • %a\b% where previously the \ failed to parse

      • for loops with ... or ..1 as the loop variable, like
        for (... in x)

      • Unary ? and ~ now have correct precedence when mixed with their binary
        counterparts (#565).

    • Air more accurately rejects certain syntax errors:

      • 1 2, which are two expressions side by side without a semicolon or
        newline

      • Stray top-level ;

      • pkg:: without a right-hand side

      • x$1 where the right-hand side is not an identifier

      • = assignment where R doesn't allow it, i.e. in argument values,
        parameter defaults, if and while conditions, and for loop sequences
        (#563)

  • Air now emits much improved diagnostics at the command line. In particular,
    syntax errors in both R files and your air.toml are reported with a code
    frame
    that shows the exact location of the issue (#558):

    > air format .
    
    R/arrange.R:137:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
    
      ✖ Expected a loop sequence but instead found ')'.
    
        135 │   names(cols) <- as.character(seq_dots)
        136 │
      > 137 │   for (i in ) {
            │             ^
        138 │     name <- vec_paste0("..", i)
        139 │     dot <- dots[[i]]
    
    
    R/case-when.R:301:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
    
      ✖ Expected `,` but instead found `values`.
    
        299 │   .size <- case_when_size_common(
        300 │     conditions = conditions
      > 301 │     values = values,
            │     ^^^^^^
        302 │     size = .size
        303 │   )
    
    
    format ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
    
      ✖ Found 2 errors.
    

    And for an air.toml issue:

    > air format . --check
    
    air.toml:2:15 configuration ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
    
      ✖ unknown variant `aut`, expected one of `auto`, `lf`, `crlf`, `native`
    
        1 │ [format]
      > 2 │ line-ending = "aut"
          │               ^^^^^
    
    
    format ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
    
      ✖ Found 1 error.
    
  • Air no longer emits colored output when stderr is not a terminal, such as when
    stderr is redirected to a file.

Install air 0.13.0

Install prebuilt binaries via shell script

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/posit-dev/air/releases/download/0.13.0/air-installer.sh | sh

Install prebuilt binaries via powershell script

powershell -ExecutionPolicy Bypass -c "irm https://github.com/posit-dev/air/releases/download/0.13.0/air-installer.ps1 | iex"

Download air 0.13.0

File Platform Checksum
air-aarch64-apple-darwin.tar.gz Apple Silicon macOS checksum
air-x86_64-apple-darwin.tar.gz Intel macOS checksum
air-aarch64-pc-windows-msvc.zip ARM64 Windows checksum
air-x86_64-pc-windows-msvc.zip x64 Windows checksum
air-aarch64-unknown-linux-gnu.tar.gz ARM64 Linux checksum
air-x86_64-unknown-linux-gnu.tar.gz x64 Linux checksum