|
1 |
| -# styler 1.1.1.9000 |
| 1 | +# styler 1.3.2.9000 (Development) |
| 2 | + |
| 3 | +## Major changes |
| 4 | + |
| 5 | +- blank lines in function calls and headers are now removed, for the former only |
| 6 | + when there are no comments before or after the blank line (#629, #630, #635). |
| 7 | + |
| 8 | +## Minor chnages and fixes |
| 9 | + |
| 10 | +- overhaul pgkdown site: Add search (#623), group function in Reference (#625). |
| 11 | +- always strip trailing spaces and make cache insensitive to it (#626). |
| 12 | +- typos in documentation (#618, #614). |
| 13 | + |
| 14 | + |
| 15 | +# styler 1.3.2 |
| 16 | + |
| 17 | +Release upon request by the CRAN team. |
| 18 | + |
| 19 | +## Minor changes and fixes |
| 20 | + |
| 21 | +- Add search and reference sections to pkgdown webpage (#623, #625). |
| 22 | +- various fixes to handle special cases for caching and stylerignore and their |
| 23 | + interaction (#611, #610, #609, #607, #602, #600). |
| 24 | +- also test on macOS (#604). |
| 25 | +- skip timing tests on CRAN as requested by CRAN team because they did not pass |
| 26 | + on all machines (#603). |
| 27 | + |
| 28 | +# styler 1.3.1 |
| 29 | + |
| 30 | +Emergency release. In case multiple expressions are on one line and only |
| 31 | +some of them are cached, styler can remove code. To reach this state, |
| 32 | +some of the expressions must have been styled previously alone and the cache |
| 33 | +must be active. Example: |
| 34 | + |
| 35 | +``` |
| 36 | +library(styler) |
| 37 | +cache_activate() |
| 38 | +#> Using cache 1.3.0 at ~/.Rcache/styler/1.3.0. |
| 39 | +style_text("1") |
| 40 | +#> 1 |
| 41 | +style_text("1 # comment") |
| 42 | +#> # comment |
| 43 | +``` |
| 44 | + |
| 45 | +This is obviously detrimental. We have added additional tests and fixed the |
| 46 | +problem (#593, #595), but we want repeat the warning from `?style_file` that all |
| 47 | +style APIs apart from `style_text()` overwrite code and that styler can only |
| 48 | +check the AST remains valid with `scope < "tokens"`. So use this if you are |
| 49 | +conservative. Or deactivate the cache with `deactivate_cache()` until it has |
| 50 | +fully matured. |
| 51 | + |
| 52 | +We thank the people who have contributed to this release: |
| 53 | + |
| 54 | +[@ellessenne](https://github.com/ellessenne) and |
| 55 | +[@renkun-ken](https://github.com/renkun-ken). |
| 56 | + |
| 57 | +# styler 1.3.0 |
| 58 | + |
| 59 | +## Breaking changes |
| 60 | + |
| 61 | +* `style_pkg()` and `style_dir()` gain a new argument `exclude_dirs` to exclude |
| 62 | + directories from styling, by default `renv` and `packrat`. Note that the |
| 63 | + defaults won't change the behavior of `style_pkg()` because it does anyways |
| 64 | + does not style these directories and they were set for consistency. |
| 65 | + |
| 66 | +* `style_file()` and friends now strip `./` in file paths returned invisibly, |
| 67 | + i.e. `./script.R` becomes `script.R` (#568). |
| 68 | + |
| 69 | +## New features |
| 70 | + |
| 71 | +* ignore certain lines using `# styler: off` and `#styler: on` or custom |
| 72 | + markers, see `?stylerignore` (#560). |
| 73 | + |
| 74 | +* styler caches results of styling, so applying styler to code it has styled |
| 75 | + before will be instantaneous. This brings large speed boosts in many |
| 76 | + situations, e.g. when `style_pkg()` is run but only a few files have changed |
| 77 | + since the last styling or when using the [styler pre-commit |
| 78 | + hook](https://github.com/lorenzwalthert/precommit). Because styler caches by |
| 79 | + expression, you will also get speed boosts in large files with many |
| 80 | + expressions when you only change a few of them. See `?caching` for details |
| 81 | + (#538, #578). |
| 82 | + |
| 83 | +* `create_style_guide()` gains two arguments `style_guide_name` and |
| 84 | + `style_guide_version` that are carried as meta data, in particular to version |
| 85 | + third-party style guides and ensure the proper functioning of caching. This |
| 86 | + change is completely invisible to users who don't create and distribute their |
| 87 | + own style guide like `tidyverse_style()` (#572). |
| 88 | + |
| 89 | +## Minor changes and fixes |
| 90 | + |
| 91 | +* lines are now broken after `+` in `ggplot2` calls for `strict = TRUE` (#569). |
| 92 | + |
| 93 | +* function documentation now contains many more line breaks due to roxygen2 |
| 94 | + update to version 7.0.1 (#566). |
| 95 | + |
| 96 | +* spaces next to the braces in subsetting expressions `[` and `[[` are now |
| 97 | + removed (#580). |
| 98 | + |
| 99 | +* Adapt to changes in the R parser to make styler pass R CMD check again. |
| 100 | + (#583). |
| 101 | + |
| 102 | +Thanks to all contributors involved, in particular |
| 103 | +[@colearendt](https://github.com/colearendt), |
| 104 | +[@davidski](https://github.com/davidski), |
| 105 | +[@IndrajeetPatil](https://github.com/IndrajeetPatil), |
| 106 | +[@pat-s](https://github.com/pat-s), and |
| 107 | +[@programming-wizard](https://github.com/programming-wizard). |
| 108 | + |
| 109 | +# styler 1.2.0 |
2 | 110 |
|
3 | 111 | ## Breaking changes
|
4 | 112 |
|
|
8 | 116 |
|
9 | 117 | * `style_file()` and friends do not write content back to a file when styling
|
10 | 118 | does not cause any changes in the file. This means the modification date of
|
11 |
| - files styled is only changed when the content is changed (#532). |
| 119 | + styled files is only changed when the content is changed (#532). |
12 | 120 |
|
13 | 121 | ## New features
|
14 | 122 |
|
15 |
| -* Aligned function calls are detected and kept as is if they match the styler |
16 |
| - [definition for aligned function calls](https://styler.r-lib.org/articles/detect-alignment.html) |
17 |
| - (#537). |
| 123 | +* Aligned function calls are detected and remain unchanged if they match the |
| 124 | + styler [definition for aligned function |
| 125 | + calls](https://styler.r-lib.org/articles/detect-alignment.html) (#537). |
18 | 126 |
|
19 |
| -* curlyl-curly (`{{`) syntactic sugar introduced with rlang 0.4.0 is now |
20 |
| - explicitly handled, as opposed previously where it was just treated as two |
21 |
| - consequtive curly braces (#528). |
| 127 | +* curly-curly (`{{`) syntactic sugar introduced with rlang 0.4.0 is now |
| 128 | + explicitly handled, where previously it was just treated as two consecutive |
| 129 | + curly braces (#528). |
22 | 130 |
|
23 | 131 | * `style_pkg()`, `style_dir()` and the Addins can now style `.Rprofile`, and
|
24 | 132 | hidden files are now also styled (#530).
|
25 | 133 |
|
26 | 134 | ## Minor improvements and fixes
|
27 | 135 |
|
28 |
| -* brace expressions in function calls are formatted in a less compact way. This |
29 |
| - improves the formatting of `tryCatch()` in many cases (#543). |
30 |
| - |
31 |
| -* escape characters in roxygen code examples are now correctly escaped (#512). |
| 136 | +* Brace expressions in function calls are formatted in a less compact way to |
| 137 | + improve readability. Typical use case: `tryCatch()` (#543). |
| 138 | + |
| 139 | +* Arguments in function declarations in a context which is indented multiple |
| 140 | + times should now be correct. This typically affects `R6::R6Class()` (#546). |
| 141 | + |
| 142 | +* Escape characters in roxygen code examples are now correctly escaped (#512). |
32 | 143 |
|
33 |
| -* style selection Addin now preserves line break when the last line selected is |
| 144 | +* Special characters such as `\n` in strings are now preserved in text and not |
| 145 | + turned into literal values like a line break (#554). |
| 146 | + |
| 147 | +* Style selection Addin now preserves line break when the last line selected is |
34 | 148 | an entire line (#520).
|
35 | 149 |
|
36 |
| -* style file Addin can now properly handle cancelling (#511). |
| 150 | +* Style file Addin can now properly handle cancelling (#511). |
37 | 151 |
|
38 | 152 | * The body of a multi-line function declaration is now indented correctly for
|
39 | 153 | `strict = FALSE` and also wrapped in curly braces for `strict = TRUE` (#536).
|
40 | 154 |
|
41 |
| -* advice for contributors in `CONTRIBUTING.md` was updated (#508). |
| 155 | +* Advice for contributors in `CONTRIBUTING.md` was updated (#508). |
42 | 156 |
|
43 | 157 | ## Adaption
|
44 | 158 |
|
45 | 159 | * styler is now available through the pre-commit hook `style-files` in
|
46 | 160 | https://github.com/lorenzwalthert/pre-commit-hooks.
|
47 | 161 |
|
| 162 | +Thanks to all contributors involved, in particular |
| 163 | + |
| 164 | +[@Banana1530](https://github.com/Banana1530), [@batpigandme](https://github.com/batpigandme), [@cpsievert](https://github.com/cpsievert), [@ellessenne](https://github.com/ellessenne), [@Emiller88](https://github.com/Emiller88), [@hadley](https://github.com/hadley), [@IndrajeetPatil](https://github.com/IndrajeetPatil), [@krlmlr](https://github.com/krlmlr), [@lorenzwalthert](https://github.com/lorenzwalthert), [@lwjohnst86](https://github.com/lwjohnst86), [@michaelquinn32](https://github.com/michaelquinn32), [@mine-cetinkaya-rundel](https://github.com/mine-cetinkaya-rundel), [@Moohan](https://github.com/Moohan), [@nxskok](https://github.com/nxskok), [@oliverbeagley](https://github.com/oliverbeagley), [@pat-s](https://github.com/pat-s), [@reddy-ia](https://github.com/reddy-ia), and [@russHyde](https://github.com/russHyde) |
| 165 | + |
48 | 166 | # styler 1.1.1
|
49 | 167 |
|
50 | 168 | This is primarily a maintenance release upon the request of the CRAN team
|
@@ -318,4 +436,3 @@ specify_reindention(
|
318 | 436 | )
|
319 | 437 | initialize_default_attributes(pd_flat)
|
320 | 438 | ```
|
321 |
| - |
|
0 commit comments