arity 0.6.0

An LSP, formatter, and linter for R
docs.rs failed to build arity-0.6.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: arity-0.2.0

Arity

Build and Test Crates.io License: MIT

Arity is a language server, formatter, and linter for the R programming language, built in Rust on a lossless, incremental parser. It provides a fast, deterministic development experience that integrates with popular code editors and IDEs.

  • Formatter --- deterministic, rule-based formatting toward the tidyverse style guide, with idempotent output and roxygen support.
  • Linter --- a growing set of correctness, readability, and performance rules, many with safe autofixes.
  • Language server --- formatting, diagnostics with quick fixes, hover, completion, signature help, go-to-definition and references, rename, document and workspace symbols, semantic tokens, folding, and call hierarchy.

Runs on Linux, macOS, and Windows (x86_64 and arm64).

Installation

Arity is available from several sources:

  • crates.io --- cargo install arity
  • npm --- npm install -g arity-cli (bundles a prebuilt binary)
  • PyPI --- uv tool install arity / pipx install arity
  • Prebuilt binaries --- from the releases page
  • VS Code / Open VSX --- the Arity extension (also works in Positron)

From npm

Install with npx or npm:

# One-shot run, no install:
npx arity-cli format file.R

# Persistent install:
npm install -g arity-cli

The package detects your platform at install time and pulls in a prebuilt binary via npm's optional dependencies --- no Rust toolchain required.

From crates.io

If you have Rust installed:

cargo install arity

Formatter

To format your code, you can use:

  • arity format [file]
  • arity format --verify [file]
  • arity format --check <path> [<path> ...]

Linter

To lint your code, you can use:

  • arity lint <path> [<path> ...]

arity lint reads from stdin when given no paths, and exits non-zero when it reports any findings.

Configuration

Arity reads an optional arity.toml, discovered by walking up from each file's directory to the repository root. Run arity init to scaffold a commented starter file. See the configuration reference for every key.

Editor integration

arity lsp starts a stdio-based language server offering formatting, diagnostics with quick fixes, hover, completion, signature help, go-to-definition and references, rename, document and workspace symbols, semantic tokens, folding, and call hierarchy.

The Arity extension for VS Code / Open VSX (and Positron) bundles the binary and starts the server automatically. For Neovim, Helix, and other editors, see the editor setup guide.

Documentation

Full documentation lives at arity.cc: