Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"No suitable spell-checker program found" #2376

Closed
bersbersbers opened this issue Sep 29, 2021 · 3 comments · Fixed by #2424
Closed

"No suitable spell-checker program found" #2376

bersbersbers opened this issue Sep 29, 2021 · 3 comments · Fixed by #2424
Labels
feature a feature request or enhancement

Comments

@bersbersbers
Copy link

Is your feature request related to a problem? Please describe.
Running devtools::check(incoming = T, quiet = T) simply returns 0 errors ✔ | 0 warnings ✔ | 0 notes ✔ although the package I am checking has numerous problems.

The reason can (only) be seen with devtools::check(incoming = T, quiet = F):

...
─  checking CRAN incoming feasibility ...Error in aspell(files, filter = list("dcf", ignore = ignore), control = control,  : 
     No suitable spell-checker program found
   Execution halted
   
── R CMD check results ──...
Duration: 1.3s

0 errors ✔ | 0 warnings ✔ | 0 notes ✔
> 

Describe the solution you'd like
Indicate that checks have not been completed, maybe by adding an error.

@bersbersbers bersbersbers added the feature a feature request or enhancement label Sep 29, 2021
@bersbersbers
Copy link
Author

bersbersbers commented Sep 29, 2021

Just adding a few bits of information here:

  • R -q -e "utils::aspell('run.R')" works fine, and so does ... "utils::aspell(NULL)"
  • aspell is not installed globally as far as I can see:
$ aspell
If 'aspell' is not a typo you can use command-not-found to lookup the package that contains it, like this:
    cnf aspell
  • utils:::aspell_find_program(NULL) returns
           hunspell 
"/usr/bin/hunspell" 

@bersbersbers
Copy link
Author

The second problem is this:

R CMD check uses utils::aspell(program = "aspell"):
https://github.com/wch/r-source/blob/b6b0a445f44b51507281ef48e032b18606c25ebc/src/library/tools/R/QC.R#L7102-L7108

But devtools checks for utils::aspell(program = NULL):

devtools/R/check.R

Lines 241 to 246 in d5901f8

aspell_env_var <- function() {
tryCatch({
utils::aspell(NULL)
c("_R_CHECK_CRAN_INCOMING_USE_ASPELL_" = "TRUE")
}, error = function(e) character())
}

In my case,

> utils:::aspell_find_program(NULL)
           hunspell 
"/usr/bin/hunspell" 
> utils:::aspell_find_program("aspell")
<NA> 
  NA 

So utils::aspell("run.R", program = NULL) works, but utils::aspell("run.R", program = "aspell") does not.

So in summary, there is two issues:

  1. devtools should (also?) check !is.na(utils:::aspell_find_program("aspell"))
  2. If _R_CHECK_CRAN_INCOMING_USE_ASPELL_ is set (for whatever reason - even manually by the user) R CMD check fails due to aspell failing, this should be reported as an error.

hadley added a commit that referenced this issue May 21, 2022
@hadley hadley changed the title "No suitable spell-checker program found" results in "0 errors ✔ | 0 warnings ✔ | 0 notes ✔" "No suitable spell-checker program found" May 21, 2022
@hadley
Copy link
Member

hadley commented May 24, 2022

PR fixes 1; rcmdcheck issue tracks 2.

hadley added a commit that referenced this issue May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants