ropensci / spelling

Tools for Spell Checking in R
https://docs.ropensci.org/spelling
Other
107 stars 25 forks source link

spell_check_package returns error in read_xml.raw #52

Closed mps9506 closed 3 years ago

mps9506 commented 4 years ago

This might be related to #6, I've been unable to successfully troubleshoot the issue on my end. The following spelling.R file is setup to run spell check my package:

if(requireNamespace('spelling', quietly = TRUE))
  spelling::spell_check_test(error = FALSE,
                             skip_on_cran = TRUE)

When I run devtools::check(args = c('--as-cran')):

    Error in read_xml.raw(charToRaw(enc2utf8(x)), "UTF-8", ..., as_html = as_html,  : 
       PCDATA invalid Char value 27 [9]
     Calls: <Anonymous> ... xml_find_all -> <Anonymous> -> read_xml.character -> read_xml.raw
     Execution halted

This isn't too informative. I don't know if spelling checks the html vignettes, but that was my initial thought. So I tried:

if(requireNamespace('spelling', quietly = TRUE))
  spelling::spell_check_test(vignettes = FALSE, error = FALSE,
                             skip_on_cran = TRUE)

And the check is successful.

My final check was to run spelling::spell_check_files() on the Rmd, html, and .r vignette files. These printed spelling errors but did not fail like above.

My big question is how do I troubleshoot this message? For reference the package is tbrf and the test failures are shown: https://github.com/mps9506/tbrf/runs/686572191?check_suite_focus=true#step:10:152

jeroen commented 3 years ago

Thanks. This turns out to be a problem in commommark/xml conversion. Moving to -> https://github.com/jeroen/commonmark/issues/14