Skip to content

Commit

Permalink
update checks on version parameter
Browse files Browse the repository at this point in the history
Co-authored-by: Josiah Parry <josiah.parry@gmail.com>
  • Loading branch information
kbvernon and JosiahParry committed Sep 7, 2024
1 parent 91495af commit 5d5a69f
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions R/use_msrv.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,18 @@
#'

Check warning on line 17 in R/use_msrv.R

View workflow job for this annotation

GitHub Actions / lint

file=R/use_msrv.R,line=17,col=3,[trailing_whitespace_linter] Trailing whitespace is superfluous.
use_msrv <- function(version = NULL, path = "."){

Check warning on line 18 in R/use_msrv.R

View workflow job for this annotation

GitHub Actions / lint

file=R/use_msrv.R,line=18,col=49,[brace_linter] There should be a space before an opening curly brace.

Check warning on line 18 in R/use_msrv.R

View workflow job for this annotation

GitHub Actions / lint

file=R/use_msrv.R,line=18,col=49,[paren_body_linter] There should be a space between a right parenthesis and a body expression.

if (is.null(version)){
if (length(version) != 1L) {
cli::cli_abort("Version must be a character scalar", class = "rextendr_error")
}

Check warning on line 23 in R/use_msrv.R

View workflow job for this annotation

GitHub Actions / lint

file=R/use_msrv.R,line=23,col=1,[trailing_whitespace_linter] Trailing whitespace is superfluous.
msrv_call <- rlang::caller_call()
version <- tryCatch(numeric_version(version), error = function(e) {
cli::cli_abort(
"Minimum supported Rust {.arg version} not specified.",
class = "rextendr_error"
"Invalid version provided",
class = "rextendr_error",
call = msrv_call
)
}
})

desc_path <- rprojroot::find_package_root_file("DESCRIPTION", path = path)

Expand Down

0 comments on commit 5d5a69f

Please sign in to comment.