Skip to content
This repository has been archived by the owner on Oct 2, 2021. It is now read-only.

Commit

Permalink
Merge branch 'master' into mlr-style
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzwalthert committed May 12, 2019
2 parents 2a8af7c + a98b289 commit 463100f
Showing 110 changed files with 3,762 additions and 1,809 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -16,3 +16,4 @@ CONTRIBUTING.md
^gitsum$
revdep
^cran-comments\.md$
^tests/testmanual$
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -30,10 +30,10 @@ latex: false

matrix:
include:
- r: 3.1
- r: 3.2
- r: 3.3
- r: 3.4
- r: 3.5
- r: release
env:
- BUILD_PKGDOWN: true
13 changes: 8 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: styler
Type: Package
Title: Non-Invasive Pretty Printing of R Code
Version: 1.1.0.9000
Version: 1.1.1.9000
Authors@R:
c(person(given = "Kirill",
family = "Müller",
@@ -18,16 +18,16 @@ URL: https://github.com/r-lib/styler
BugReports: https://github.com/r-lib/styler/issues
Imports:
backports (>= 1.1.0),
cli,
cli (>= 1.1.0),
magrittr (>= 1.0.1),
purrr (>= 0.2.3),
rematch2,
rematch2 (>= 2.0.1),
rlang (>= 0.1.1),
rprojroot (>= 1.1),
tibble (>= 1.4.2),
tools,
withr,
xfun
withr (>= 1.0.0),
xfun (>= 0.1)
Suggests:
data.tree (>= 0.1.6),
dplyr,
@@ -78,6 +78,9 @@ Collate:
'transform-files.R'
'ui.R'
'unindent.R'
'utils-files.R'
'utils-navigate-nest.R'
'utils-strings.R'
'utils.R'
'vertical.R'
'visit.R'
132 changes: 123 additions & 9 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,94 @@
# styler 1.1.1

This is primarily a maintenance release upon the request of the CRAN team
(#490).

## Major changes

- Users can now control style configurations for styler Addins (#463, #500),
using the `Set style` Addin. See `?styler::styler_addins` for details.

- `return()` is now always put in braces and put on a new line when used in
a conditional statement (#492).

- `%>%` almost always causes a line break now for `strict = TRUE` (#503).

## Minor changes

- `style_pkg()` now also styles the "demo" directory by default (#453).

- multi-line strings are now styled more consistently (#459).

- indention in roxygen code example styling (#455) and EOF spacing (#469) was
fixed.

- indention for for loop edge case (#457) and comments in pipe chain (#482)
were fixed.

- line-break styling around comma is improved (#479).

- bug that can cause an error when the variable `text` in any name space
before styler on the search path was defined and did not have length 1 is
fixed (#484).

- slightly confusing warning about empty strings caused with roxygen code
examples and Rmd was removed.

- right apostrophe to let package pass R CMD Check in strict Latin-1
locale was removed (#490, reason for release).

## Adaption of styler

Since it's never been mentioned in the release notes, we also mention here where
else you can use styler functionality:

* `usethis::use_tidy_style()` styles your project according to the tidyverse
style guide.

* `reprex::reprex(style = TRUE)` to prettify reprex code before printing. To
permanently use `style = TRUE` without specifying it every time, you can add
the following line to your `.Rprofile` (via `usethis::edit_r_profile()`):
`options(reprex.styler = TRUE)`.

* you can pretty-print your R code in RMarkdown reports without having styler
modifying the source. This feature is implemented as a code chunk option in
knitr. use `tidy = "styler"` in the header of a code chunks (e.g. ` ```{r
name-of-the-chunk, tidy = "styler"}`), or `knitr::opts_chunk$set(tidy =
"styler")` at the top of your RMarkdown script.

* pretty-printing of [drake](https://github.com/ropensci/drake) workflow data
frames with `drake::drake_plan_source()`.

* Adding styler as a fixer to the [ale
Plug-in](https://github.com/w0rp/ale/pull/2401#issuecomment-485942966) for
VIM.

Thanks to all contributors involved, in particular
[@ArthurPERE](https://github.com/ArthurPERE),
[@hadley](https://github.com/hadley),
[@igordot](https://github.com/igordot),
[@IndrajeetPatil](https://github.com/IndrajeetPatil),
[@jackwasey](https://github.com/jackwasey),
[@jcrodriguez1989](https://github.com/jcrodriguez1989),
[@jennybc](https://github.com/jennybc),
[@jonmcalder](https://github.com/jonmcalder),
[@katrinleinweber](https://github.com/katrinleinweber),
[@krlmlr](https://github.com/krlmlr),
[@lorenzwalthert](https://github.com/lorenzwalthert),
[@michaelquinn32](https://github.com/michaelquinn32),
[@msberends](https://github.com/msberends),
[@raynamharris](https://github.com/raynamharris),
[@riccardoporreca](https://github.com/riccardoporreca),
[@rjake](https://github.com/rjake),
[@Robinlovelace](https://github.com/Robinlovelace),
[@skirmer](https://github.com/skirmer),
[@thalesmello](https://github.com/thalesmello),
[@tobiasgerstenberg](https://github.com/tobiasgerstenberg),
[@tvatter](https://github.com/tvatter),
[@wdearden](https://github.com/wdearden),
[@wmayner](https://github.com/wmayner), and
[@yech1990](https://github.com/yech1990).

# styler 1.1.0

This release introduces new features and is fully backward-compatible. It also
@@ -7,27 +98,36 @@ adapts to changes in the R parser committed into R devel (#419).

* styler can now style roxygen code examples in the source code of package
(#332) as well as Rnw files (#431).

* the print method for the output of `style_text()` (`print.vertical()`) now
returns syntax-highlighted code by default, controllable via the option
returns syntax-highlighted code by default, controllable via the option
`styler.colored_print.vertical` (#417).

* the README was redesigned (#413).

* semi-colon expression that contained multiple assignments was fixed (#404).

## Minor Changes

* cursor position is remembered for styling via Addin (#416).
* adapt spacing around tilde for multi-token expressions(#424) and brace
edge case (#425).

* adapt spacing around tilde for multi-token expressions(#424) and brace edge
case (#425).

* only add brackets to piped function call if RHS is a symbol (#422).
* increase coverage again to over 90% (#412).

* increase coverage again to over 90% (#412).

* move rule that turns single quotes into double quotes to token modifier in
`tidyverse_style_guide() (#406).

* remove line-breaks before commas (#405).

* removed package dependency enc in favor of xfun (#442).

Thanks to all contributors for patches, issues and the like:
@jonmcalder, @krlmlr, @IndrajeetPatil, @kalibera, @Hasnep, @kiranmaiganji,
@dirkschumacher, @ClaytonJY, @wlandau, @maurolepore
Thanks to all contributors for patches, issues and the like: @jonmcalder,
@krlmlr, @IndrajeetPatil, @kalibera, @Hasnep, @kiranmaiganji, @dirkschumacher,
@ClaytonJY, @wlandau, @maurolepore

# styler 1.0.2

@@ -36,18 +136,24 @@ This is a maintenance release without any breaking API changes.
## Major Changes

* Fixed indention for named multi-line function calls (#372).

* Non-R code chunks in `.Rmd` files are now respected and won't get styled
(#386).

## Minor Changes

* Fixing an edge case in which, if very long strings were present in the code,
tokens could be replaced with wrong text (#384).

* Spacing around tilde in formulas depends now on whether there is a LHS in the
formula (#379).

* Spaces are now also added around `EQ_SUB` (`=`) (#380).

* Added `CONTRIBUTING.md` to outline guidelines for contributing to styler.

* More informative error messages for parsing problems (#401, #400).

* Improved documentation (#387).

Thanks to all contributors for patches, issues and the like: @katrinleinweber,
@@ -62,11 +168,14 @@ This is a maintenance release without any breaking API changes.

* Removed implicit `dplyr` dependency via `purrr:::map_dfr()` (thanks
@jimhester, #324).

* Added required minimal version dependency for purr (`>= 0.2.3`) (#338).

* We rely on the tibble package which was optimized for speed in `v1.4.2` so
styler should run ~2x as fast
[(#348)](https://github.com/tidyverse/tibble/pull/348). For that reason, styler
now depends on `tibble >= 1.4.2`.
[(#348)](https://github.com/tidyverse/tibble/pull/348). For that reason,
styler now depends on `tibble >= 1.4.2`.

* In the dependency `enc`, a bug was fixed that removed/changed non-ASCII
characters. Hence, styler now depends on `enc >= 0.2` (#348).

@@ -75,12 +184,16 @@ This is a maintenance release without any breaking API changes.
* We're now recognizing and respecting more DSLs used in R comments: rplumber
(`#*`, #306), shebang `#/!` (#345), knitr chunk headers for spinning (`#+` /
`#-`, #362).

* Named arguments can stay on the first line if call is multi-line (#318).

* No space anymore with `tidyverse_style()` after `!!` since with `rlang 0.2`,
`!!` now binds tighter (#322), spacing around `~` (#316), no space anymore
around `^` (#308).

* Code chunks in Rmd documents that don't use the R engine are no longer
formatted (#313).

* Various bug fixes and edge case improvements.

Thanks to all contributors for patches, issues and the like: @devSJR, @klrmlr,
@@ -158,3 +271,4 @@ specify_reindention(
)
initialize_default_attributes(pd_flat)
```

Loading

0 comments on commit 463100f

Please sign in to comment.