Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ on:
- '!.oxfmtrc.jsonc'
- '!.oxlintrc.jsonc'
- '!**/.lintr'
- '!arity.toml'
- '!.vscode/**'
- '!.agents/**'
- '!.claude/**'
Expand Down
35 changes: 34 additions & 1 deletion .github/workflows/r.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@ on:
branches:
- main
paths: &r-paths
- '**/*.R'
- 'R/**'
- 'sess/**'
- 'arity.toml'
- 'package.json'
- 'pnpm-lock.yaml'
- 'pnpm-workspace.yaml'
# Arity file discovery honours .gitignore.
- '.gitignore'
- '.github/workflows/r.yml'
pull_request:
branches:
Expand All @@ -22,7 +29,33 @@ permissions:
contents: read

jobs:
lint:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- name: Check R formatting
run: pnpm run format:r:check

lint-arity:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- name: Lint R code with Arity
run: pnpm run lint:r

lint-lintr:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
Expand Down
11 changes: 10 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ Run `pnpm run format` to format TypeScript files with Oxfmt, and
`pnpm run format:check` to check formatting without changing files. CI runs the
same check for pull requests and pushes to `main`. Formatting currently applies
to TypeScript files only (`.ts`, `.tsx`, `.mts`, and `.cts`); other file types,
including JavaScript, JSON, Markdown, YAML, R, C, and EJS files, are not formatted.
including JavaScript, JSON, Markdown, YAML, C, and EJS files, are not formatted.
R files are formatted separately, as described below.

The checked-in `.oxfmtrc.jsonc` is shared by the CLI and the recommended Oxc
VS Code extension, and its `ignorePatterns` restrict both to TypeScript files.
Expand All @@ -46,6 +47,14 @@ Workspace settings select Oxc as the formatter and enable format on save for
TypeScript. Run `pnpm run lint` and `pnpm run typecheck` separately to check
TypeScript code.

R files are formatted and linted with [Arity](https://arity.cc), which
`pnpm install` provides, so no R installation is needed. Run `pnpm run format:r`
to format them, `pnpm run format:r:check` to check formatting without changing
files, and `pnpm run lint:r` to lint them. `pnpm exec arity lint --fix .` applies
the safe fixes. The configuration is in `arity.toml`. CI runs both checks, and
also runs lintr with the `.lintr` files in `R/` and `sess/`; layout is left to
the formatter, so lintr does not check line length or indentation.

## Building bundled sess

Builds require Git and a checkout with HEAD. `scripts/prepare-sess.js` fingerprints
Expand Down
4 changes: 2 additions & 2 deletions R/.lintr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
linters: linters_with_defaults(
line_length_linter(120),
indentation_linter(4),
line_length_linter = NULL,
indentation_linter = NULL,
return_linter = NULL,
object_name_linter = NULL,
object_usage_linter = NULL)
Loading
Loading