Skip to content

GH-46646: [dev][R] Replace linr with jarl for R linting / pre-commit check - #50851

Open
jorisvandenbossche wants to merge 2 commits into
apache:mainfrom
jorisvandenbossche:gh-47937-jarl
Open

GH-46646: [dev][R] Replace linr with jarl for R linting / pre-commit check#50851
jorisvandenbossche wants to merge 2 commits into
apache:mainfrom
jorisvandenbossche:gh-47937-jarl

Conversation

@jorisvandenbossche

@jorisvandenbossche jorisvandenbossche commented Aug 11, 2026

Copy link
Copy Markdown
Member

Rationale for this change

Fix #46646 by replacing the lintr pre-commit hook (which requires system R/Rscript to bootstrap, causing hard failures when R isn't installed, end even if installed still gives errors when using conda (#47997)) with jarl (https://jarl.etiennebacher.com/, a Rust-native R linter distributed as a standalone binary or as a python package).

What changes are included in this PR?

  • .pre-commit-config.yaml: swapped the local lintr hook for etiennebacher/jarl-pre-commit (jarl-check, rev 0.5.0)
  • r/jarl.toml: new config file, excludes the same generated files that r/.lintr and r/air.toml already exclude
    • NOTE: for now I did not remove r/.lintr in case people would use that locally or through their IDE, so it might be useful to keep. But for our CI it could be removed.
  • .github/workflows/dev.yml: dropped r-base from the CI apt install and the now-unused ~/.local/share/renv/cache from the pre-commit cache path, since no pre-commit hook needs R anymore
  • r/vignettes/developers/workflow.Rmd and docs/source/developers/guide/step_by_step/styling.rst: updated references from lintr to jarl

At the moment, running jarl check gives 42 pre-existing errors (13 auto-fixable), so CI will be failing at the moment.
Those should be fixed (or temporarily suppressed) in a next commit. EDIT: for now I added those to the configuration as ignored rules, so CI would be green. Those can be fixed as a follow-up issue.

Also note the differences between lintr and jarl listed at #46646 (comment). Especially no cyclocomp (complexity) or object_length equivalent exists in jarl, so we have to see if we are fine with dropping those checks.

Code changes are largely generated by Claude, I did review everything, but I am no R developer ..

Are these changes tested?

pre-commit runs on CI

Are there any user-facing changes?

No

Copilot AI lite review requested due to automatic review settings August 11, 2026 14:01
@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #47937 has been automatically assigned in GitHub to PR creator.

@github-actions github-actions Bot added the awaiting committer review Awaiting committer review label Aug 11, 2026
@jorisvandenbossche jorisvandenbossche changed the title GH-47937: [dev][R] Replace linr with jarl for R linting / pre-commit … GH-47937: [dev][R] Replace linr with jarl for R linting / pre-commit check Aug 11, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Replaces the R linting pre-commit hook that depended on system R (lintr via Rscript) with the Rust-native jarl hook, and updates CI/docs accordingly to avoid hard failures when R isn’t installed.

Changes:

  • Swap the local lintr pre-commit hook for etiennebacher/jarl-pre-commit (jarl-check).
  • Add an initial r/jarl.toml configuration and update developer docs to reference jarl instead of lintr.
  • Simplify the dev GitHub Actions lint job by removing r-base install and the renv cache path.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
r/vignettes/developers/workflow.Rmd Updates R developer workflow docs to use jarl instead of lintr.
r/jarl.toml Adds Jarl configuration (notably excludes for generated files).
docs/source/developers/guide/step_by_step/styling.rst Updates styling docs to reference jarl.
.pre-commit-config.yaml Replaces the R lint hook implementation from lintr to jarl.
.github/workflows/dev.yml Removes r-base and renv cache entries now that pre-commit no longer needs R.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .pre-commit-config.yaml Outdated
Comment on lines 191 to 198
- repo: https://github.com/etiennebacher/jarl-pre-commit
rev: "0.5.0"
hooks:
- id: lintr
- id: jarl-check
alias: r
name: R Lint
language: r
additional_dependencies:
- cyclocomp
- lintr
- testthat
entry: |
Rscript -e "Sys.setenv(NOT_CRAN = 'TRUE'); lintr::expect_lint_free('r')"
pass_filenames: false
files: >-
^r/.*\.(R|Rmd)$

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pre-commit logs in the failing CI clearly indicates Used '/home/runner/work/arrow/arrow/r/jarl.toml', so it seems the config file is correctly used

@github-actions github-actions Bot added awaiting changes Awaiting changes and removed awaiting committer review Awaiting committer review labels Aug 11, 2026
Copilot AI review requested due to automatic review settings August 11, 2026 14:31
@github-actions github-actions Bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Aug 11, 2026
@jorisvandenbossche jorisvandenbossche changed the title GH-47937: [dev][R] Replace linr with jarl for R linting / pre-commit check GH-46646: [dev][R] Replace linr with jarl for R linting / pre-commit check Aug 11, 2026
@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #46646 has been automatically assigned in GitHub to PR creator.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Dev] Pre-commit fails if R is not installed

2 participants