Overview
Arity is a formatter, linter, and language server for R. It keeps your code consistent and gives you feedback as you write.
What Arity does
- Format consistently. Format R code, roxygen documentation, and package
DESCRIPTIONfiles. - Find problems early. Catch common mistakes, apply safe fixes, and run the same checks locally and in CI.
- Work in your editor. Get completions, diagnostics, navigation, and refactoring through the language server, with formatting on save.
Built on your code
Arity parses your code into a lossless syntax tree and updates its analysis as you type. Formatting is deterministic, and formatting an already-formatted file changes nothing. The same parser powers the formatter, linter, and language server.
See the performance comparisons for measurements of the formatter, linter, and language server.
Choose your setup
- VS Code or Positron: install the Arity extension. It includes the binary and starts the language server for you.
- RStudio: use the R package to format code inside RStudio or from the R console.
- Other editors: follow Editor setup to connect your editor to the language server. The guide includes Neovim, Zed, and Helix.
- Terminal or CI: install the CLI, then follow Getting started to check and format an existing R project.
The Installation page covers the standalone installer, package managers, and source builds.
Where to go next
- Getting started: a workflow for an existing R project.
- Formatting and Linting: use each tool on files, projects, and standard input.
- Configuration: share project settings in
arity.toml. - Integrations: run checks in CI or a pre-commit hook.
For individual commands, settings, and diagnostics, see the CLI reference, Configuration reference, and Lint rules.
