Skip to content

Commit

Permalink
move test outside loop (#2339)
Browse files Browse the repository at this point in the history
Co-authored-by: Indrajeet Patil <[email protected]>
  • Loading branch information
MichaelChirico and IndrajeetPatil authored Nov 23, 2023
1 parent 3fd1bd6 commit 1c36e0d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions R/backport_linter.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
#' @export
backport_linter <- function(r_version = getRversion(), except = character()) {
r_version <- normalize_r_version(r_version)

if (all(r_version >= R_system_version(names(backports)))) {
return(Linter(function(source_expression) list()))
}

backport_blacklist <- backports[r_version < R_system_version(names(backports))]
backport_blacklist <- lapply(backport_blacklist, setdiff, except)

Expand All @@ -44,9 +49,6 @@ backport_linter <- function(r_version = getRversion(), except = character()) {
if (!is_lint_level(source_expression, "expression")) {
return(list())
}
if (all(r_version >= R_system_version(names(backports)))) {
return(list())
}

xml <- source_expression$xml_parsed_content

Expand Down

0 comments on commit 1c36e0d

Please sign in to comment.