Skip to content

Commit 0f9d71b

Browse files
Merge pull request #628 from lorenzwalthert/issue-626
- Remove trainling spaces before processing text (#628).
2 parents 9fc8c18 + 9824e7f commit 0f9d71b

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

NEWS.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# styler 1.3.2.9000 (Development)
2+
3+
## Major changes
4+
5+
6+
## Minor chnages and fixes
7+
8+
- overhaul pgkdown site: Add search (#623), group function in Reference (#625).
9+
- always strip trailing spaces and make cache insensitive to it (#626).
10+
- typos in documentation (#618, #614).
11+
12+
13+
114
# styler 1.3.2
215

316
Release upon request by the CRAN team.

R/transform-files.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ make_transformer <- function(transformers,
8080
assert_transformers(transformers)
8181

8282
function(text) {
83+
text <- trimws(text, which = "right")
8384
should_use_cache <- cache_is_activated()
8485

8586
if (should_use_cache) {

tests/testthat/test-stylerignore.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ test_that("gives warning markers are not correct", {
66
)))
77
})
88

9-
test_that("trailing spaces are stripped when checking marker, but not written back", {
9+
test_that("trailing spaces are stripped when checking marker and written back", {
1010
expect_equal(
1111
style_text(c(
1212
"# styler: off ",
1313
"1+1",
1414
"# styler: on "
1515
)) %>%
1616
as.character(),
17-
c("# styler: off ", "1+1", "# styler: on")
17+
c("# styler: off", "1+1", "# styler: on")
1818
)
1919
})
2020

0 commit comments

Comments
 (0)