Skip to content

Commit 38f8c25

Browse files
Less text in warning, refer to help page
wq
1 parent 46fd77b commit 38f8c25

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

R/stylerignore.R

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,9 @@ add_stylerignore <- function(pd_flat) {
4949
pd_flat$indicator_off <- cumsum_start + cumsum_stop
5050
is_invalid <- cumsum_start - cumsum_stop < 0 | cumsum_start - cumsum_stop > 1
5151
if (any(is_invalid)) {
52-
rlang::warn(c(
53-
"Invalid stylerignore sequences found. The order in which the markers",
54-
"must appear in code is `# styler: off`, always followed by",
55-
"`# styler: on`. Multiple sequences are allowed but can't be nested,",
56-
"the very last `# styler: on` can be omitted. stylerignore markers are",
57-
"ignored after the first invalid marker."
52+
warn(paste0(
53+
"Invalid stylerignore sequences found, potentially ignoring some of the ",
54+
"markers set.\nSee `help(\"stylerignore\", \"styler\")`."
5855
))
5956
}
6057

tests/testthat/test-stylerignore.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ test_that("works with other markers", {
9292
as.character()
9393
}
9494
),
95-
"Multiple"
95+
"Invalid stylerignore sequence"
9696
)
9797
})
9898

0 commit comments

Comments
 (0)