r-lib / urlchecker

Run CRAN URL checks from older versions of R
https://urlchecker.r-lib.org/
GNU General Public License v3.0
45 stars 5 forks source link

Use cli errors or file an issue if you don't have time to do it now #39

Open gaborcsardi opened 9 months ago

cicdguy commented 8 months ago

Would this involve adding a non-zero exit code for URLs that are non-conformant?

gaborcsardi commented 8 months ago

No, but you can do that already, like this:

❯ R -q -e 'if (nr <- nrow(print(urlchecker::url_check()))) stop(nr, " bad URL(s)")'
> if (nr <- nrow(print(urlchecker::url_check()))) stop(nr, " bad URL(s)")
✖ Error: DESCRIPTION:14:65 404: Not Found
URL: https://github.com/r-lib/ps#readme, https://ps.r-lib.org/, https://httpbin.org/status/404
                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: 1 bad URL(s)
Execution halted
❯ echo $?
1

If this is what you meant.

cicdguy commented 8 months ago

Yeah that's exactly what I was referring to.

Was hoping this would be sort of built-in and controlled via a parameter to url_check, but this works too.

Thanks!

gaborcsardi commented 8 months ago

We can add an argument to fail I guess, can you please open an issue?