devtools::check() only gives error on missing dependencies

Hi,

I am trying to run a devtools::check() on R packages created by users on our platform. We have set the error_on argument to "error" since devs were annoyed if they had to remove ALL warnings before being able to publish a package.

I now had some packages published, that were missing imports for packages referenced with :: in the code. When devtools::check() is run, this problem is indicated with a warning:

W  checking dependencies in R code (944ms)
   '::' or ':::' imports not declared from:
     ‘lubridate’

But because we have error_on="error" the check is passed.

My question is: This import error is a significant error, which should be caught by our pipeline and the package not be allowed to be published. Is my only option to have devtools::check() fail on all warnings?

My main problem with that is, that devtools::check() also gives a warning on files with non-ASCII characters, and my users would HATE to have to remove those.

Is there a way let devtools::check() give an error on dependency errors? I think a missing dependency is a much more serious problem compared to the other warnings I get from devtools::check(). It seems strange to me, that it only generates a warning?

Right now I am considering using an ugly hack, where I search the output from devtools::check() and fail the package if I find the string
'::' or ':::' imports not declared from
but that is a really ugly solution.

Any ideas on this is really appriciated.