Non-Invasive Pretty Printing of R Code
Overview
Pretty-prints R code without changing the user's formatting intent.
This release fixes a bug related that prevented {styler} to format code with
comments in curly-curly expressions {{ (#1269).
@IndrajeetPatil is now a package
author. Thanks for your many contributions.
**New features**
- Add support for {webr} code chunks in Rmd/qmd documents (#1229).
- Add colored output to R API (#1187).
**Major changes**
- Ensure {styler} can format code with comment in curly-curly (#1269).
- Adapt to single indent semantics in style guide (#1235).
- Remove excessive line breaks between top-level expressions (#1239).
- Remove blank lines after opening and before closing braces (#1995).
Show all changes in 1.11.0Hide the rest of the changes in 1.11.0
- Empty curly have no spaces around (#1234).
- Remove spaces around dollar operator (#1246).
- Improve stack trace styler throws on parse error (#1216).
- Use Bootstrap 5 template for pkgdown website (#1209).
- Complete third-party style guide documentation (#1201).
- Document package options (#1193).
- Bump minimum needed R version to 4.0 (#1197).
**Minor changes**
- Ensure formatted token is a call before forcing line breaks (#1254).
- Fix lints (#1260), update
.lintrfile. - Use
all_linters()instead of using tags (#1207). - Fix
paste_linter()lints (#1204). - Turn off
strings_as_factors_linter()(#1217). - Update precommit config (#1205).
- Remove unused
extend_if_comment()internal (#1250). - Remove unused internal utility:
calls_sys()(#1213). - Remove unused testing helper:
generate_test_samples()(#1212). - Improve a few function names (#1249).
- Use
expect_no_warning()(#1248). - Update WORDLIST (#1240, #1210).
- Check for warnings in examples and tests (#1219).
- Use stable version of {purrr} (#1215).
- Don't store code tree structures in tests (#1208).
- Update touchstone config (#1203).
- Add non-US locale and use pak to upgrade packages in GHA (#1200).
- Welcome Indrajeet as author (#1198).
Thanks for everyone who contributed to this release:
@wiper8, and
From NEWS.md in the release
Install
Health
ERRORtestsr-release-windows-x86_64
Running 'testthat.R' [38s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
> library(testthat)
> library(styler)
> test_check("styler") # checks multiple files, in parallel
Starting 2 test processes.
> test-curly-curly.R: mixed-in.R was identical to mixed-out.R
> test-detect-alignment.R: cols-with-one-row-in.R was identical to cols-with-one-row-out.R
> test-detect-alignment.R: fun-decs-in.R was identical to fun-decs-out.R
> test-detect-alignment.R: named-in.R was identical to named-out.R
> test-detect-alignment.R: one-col-some-named-in.R was identical to one-col-some-named-out.R
> test-detect-alignment.R: quoted-names-in.R was identical to quoted-names-out.R
> test-detect-alignment.R: tribble-in.R was identical to tribble-out.R
> test-detect-alignment.R: tribble-three-cols-in.R was identical to tribble-three-cols-out.R
> test-escaping.R: basic-escape-in.R was identical to basic-escape-out.R
> test-fun_dec.R: fun_dec_scope_spaces-in.R was ide
...[truncated]...
code -1073741819
Backtrace:
▆
1. └─testthat::test_check("styler")
2. └─testthat::test_dir(...)
3. └─testthat:::test_files(...)
4. └─testthat:::test_files_parallel(...)
5. ├─withr::with_dir(...)
6. │ └─base::force(code)
7. ├─testthat::with_reporter(...)
8. │ └─base::tryCatch(...)
9. │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
10. │ └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
11. │ └─base (local) doTryCatch(return(expr), name, parentenv, handler)
12. └─testthat:::parallel_event_loop_chunky(queue, reporters, ".")
13. └─queue$poll(Inf)
14. └─base::lapply(...)
15. └─testthat (local) FUN(X[[i]], ...)
16. └─private$handle_error(msg, i)
17. └─cli::cli_abort(...)
18. └─rlang::abort(...)
Execution halted- ERROR12 OK, 1 ERROR2026-10-20
- OK13 OK2026-08-04
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-09
- ERROR12 OK, 1 ERROR2026-06-07
Show 1 earlier changeHide 1 earlier change
- OK14 OK2026-03-10
Documentation
- Help pages
- 209 (187 internal)includes a package overview page
- Examples that run
- 94%44 run in a plain check (5 of them under a condition) · 2 never run · 1 hold no code
- Exported functions with examples
- 82%
- Documented parameters
- 92%
- Return-value docs
- 6%
- Help pages citing references
- 0%
- Get started HTML
- Alignment detection HTML
- Caching HTML
- Customizing styler HTML
- Distribute custom style guides HTML
- Remove rules HTML
- The effect of `strict = FALSE` HTML
- Third-party integrations HTML
Downloads
Repository
- PRs merged (all time)
- 92%
- Median days to close, 50 most recently updated closed issues
- 20
- Median days to close, 50 most recently updated closed PRs
- 4
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
Commits over time
Commit identities over time
13 development-tooling and community-health practices detected across 8 families in the upstream repository
Checks run against github.com/r-lib/styler on 2026-10-18.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2026-09-29 · The repository has a site deploy workflow
pkgdown site last built 2026-06-10
Show all practicesHide 4 practices
This repository shows signs of AI coding tools.
- Claude Codefirst seen on or before 2026-09-20Commits: at least 5 crediting it in the message
- Copilot code reviewCommits: at least 1 accepting its review suggestions
- Claude CodePull requests: 3 from outside contributors, first on 2026-09-27, 3 from forks
- Claude Opus 55 commits · Sep 2026
Dependencies
Installing styler adds 14 packages (7 with compiled code, 4.3 MB of source tarballs). Heaviest: vctrs 1.0 MB, rlang 766 KB, cli 629 KB.
Show the 48 most downloaded packagesHide the 48 most downloaded packages
Code & Tests
People & History
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- 1.11.0Latest
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- 1.10.32024-04-08 · diff ↗
- 1.10.22023-08-29 · diff ↗
- 1.10.12023-06-05 · diff ↗
- 1.10.02023-05-24 · diff ↗
- RR 4.3.0 released · 2023-04-21
- 1.9.12023-03-05 · diff ↗
- 1.9.02023-01-15 · diff ↗
- 1.8.12022-11-08 · diff ↗ ·
added 14 exports
compute_parse_data_nested, is_asymmetric_tilde_expr, is_comment, is_conditional_expr, is_curly_expr, is_for_expr, is_function_call, is_function_declaration, is_symmetric_tilde_expr, is_tilde_expr, is_while_expr, next_non_comment, previous_non_comment, scope_normalize - 1.8.02022-10-23 · diff ↗
- RR 4.2.0 released · 2022-04-22
- 1.7.02022-03-14 · diff ↗
- 1.6.22021-09-23 · diff ↗
Show 18 earlier eventsHide 18 earlier events
- 1.6.12021-09-17 · diff ↗
- 1.5.12021-07-13 · diff ↗
- RR 4.1.0 released · 2021-05-18
- 1.4.12021-03-30 · diff ↗
- 1.4.0
- RR 4.0.0 released · 2020-04-24
- 1.3.22020-02-23 · diff ↗
- 1.3.12020-02-13 · diff ↗
- 1.3.0
- 1.2.02019-10-17 · diff ↗
- 1.1.12019-05-06 · diff ↗
- RR 3.6.0 released · 2019-04-26
- 1.1.02018-11-20 · diff ↗
- 1.0.22018-06-26 · diff ↗
- RR 3.5.0 released · 2018-04-23
- 1.0.12018-03-09 · diff ↗
- 1.0.02017-12-11
- RR 3.4.0 released · 2017-04-21
Package metadata
- First published
- 2017-12-11
- Total releases
- 24 / 9 yrs
- License
- MIT + file LICENSE OSI · relicensed from GPL-3 in 1.4.0
- Minimum R
- ≥ 4.0.0
- Download size
- 422 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("styler")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-21, which the citation names so these numbers can be found later. More on citing and the projects behind them.