Skip to content

Commit c20a15e

Browse files
committed
Type check
1 parent aa863ac commit c20a15e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

R/check-files.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#' pattern = "\\.(Rnw|Rmd|html)$", full.names = TRUE)
1414
#' spell_check_files(files)
1515
spell_check_files <- function(path, ignore = character(), lang = "en_GB"){
16+
stopifnot(is.character(ignore))
1617
dict <- hunspell::dictionary(lang, add_words = ignore)
1718
path <- normalizePath(path, mustWork = TRUE)
1819
lines <- lapply(sort(path), spell_check_file_one, dict = dict)
@@ -37,6 +38,7 @@ spell_check_file_one <- function(path, dict){
3738
#' @export
3839
#' @param text character vector with plain text
3940
spell_check_text <- function(text, ignore = character(), lang = "en_GB"){
41+
stopifnot(is.character(ignore))
4042
dict <- hunspell::dictionary(lang, add_words = ignore)
4143
bad_words <- hunspell::hunspell(text, dict = dict)
4244
words <- sort(unique(unlist(bad_words)))

0 commit comments

Comments
 (0)