Skip to content

Commit 5339648

Browse files
committed
refactor: rename flag to --read-only
1 parent a317937 commit 5339648

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

inst/hooks/exported/spell-check.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
"Spell check for files
44
Usage:
5-
spell-check [--lang=<language>] [--no-update] <files>...
5+
spell-check [--lang=<language>] [--read-only] <files>...
66
77
Options:
88
--lang=<language> Passed to `spelling::spell_check_files()` [default: en_US]
9-
--no-update Don't update inst/WORDLIST with errors (new words)
9+
--read-only Don't update inst/WORDLIST with errors (new words)
1010
1111
" -> doc
1212

@@ -17,7 +17,7 @@ if (file.exists(path_wordlist)) {
1717
ignore <- readLines(path_wordlist, encoding = "UTF-8")
1818
action <- "update"
1919
} else {
20-
if (isFALSE(arguments$no_update)) {
20+
if (isFALSE(arguments$read_only)) {
2121
if (!dir.exists(dirname(path_wordlist))) {
2222
dir.create(dirname(path_wordlist))
2323
}
@@ -37,8 +37,8 @@ spelling_errors <- spelling::spell_check_files(
3737
if (nrow(spelling_errors) > 0) {
3838
cat("The following spelling errors were found:\n")
3939
print(spelling_errors)
40-
if (isTRUE(arguments$no_update)) {
41-
cat("Hint: you can enable an automatic updating of WORDLIST with errors (new words) by removing the --no-update flag.\n")
40+
if (isTRUE(arguments$read_only)) {
41+
cat("Hint: you can enable an automatic updating of WORDLIST with errors (new words) by removing the --read-only flag.\n")
4242
} else {
4343
ignore_df <- data.frame(
4444
original = unique(c(ignore, spelling_errors$word))
@@ -55,7 +55,7 @@ if (nrow(spelling_errors) > 0) {
5555
"- remove it again manually from inst/WORDLIST to make sure it's not\n",
5656
" ignored in the future.\n",
5757
"Then, try committing again.\n",
58-
"Hint: you can disable this behavior by providing a --no-update flag.\n"
58+
"Hint: you can disable this behavior by providing a --read-only flag.\n"
5959
)
6060
}
6161
stop("Spell check failed", call. = FALSE)

tests/testthat/test-hooks.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ run_test(
224224
"spell-check",
225225
suffix = "-fail.md",
226226
std_err = "Spell check failed",
227-
cmd_args = "--no-update",
227+
cmd_args = "--read-only",
228228
read_only = TRUE
229229
)
230230

@@ -233,7 +233,7 @@ run_test(
233233
"spell-check",
234234
suffix = "-fail-2.md",
235235
std_err = "Spell check failed",
236-
cmd_args = "--no-update",
236+
cmd_args = "--read-only",
237237
artifacts = c("inst/WORDLIST" = test_path("in/WORDLIST")),
238238
read_only = TRUE
239239
)

0 commit comments

Comments
 (0)