Skip to content

Commit

Permalink
resolve merge conflicts
Browse files Browse the repository at this point in the history
Merge branch 'main' into f-2386-use-cli

# Conflicts:
#	R/addins.R
  • Loading branch information
IndrajeetPatil committed Mar 23, 2024
2 parents b65b498 + d946143 commit 316e9ca
Showing 1 changed file with 6 additions and 19 deletions.
25 changes: 6 additions & 19 deletions R/addins.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,21 @@ addin_lint <- function() {
return("Current source has no path. Please save before continuing.")
}

config_file <- (get("find_config", asNamespace("lintr")))(filename$path)
if (length(config_file) == 0L) {
config_linters <- NULL
} else {
config <- read.dcf(config_file, all = TRUE)
config_linters <- config[["linters"]]
}
linters <- if (length(config_linters) == 0L) {
cli_inform("No configuration found. Using default linters.")
default_linters
} else {
eval(parse(text = config_linters))
}

lintr::lint(filename$path, linters = linters)
lint(filename$path)
}

addin_lint_package <- function() {
if (!requireNamespace("rstudioapi", quietly = TRUE)) {
cli_abort("{.pkg rstudioapi} is required for add-ins.")
}
project <- rstudioapi::getActiveProject()
project_path <- if (is.null(project)) getwd() else project

if (is.null(project)) {
cli_inform("No project found, passing current directory")
cli_inform("No configuration found. Using default linters.")
project_path <- getwd()
} else {
project_path <- project
}

lintr::lint_package(project_path)
lint_package(project_path)
}
# nocov end

0 comments on commit 316e9ca

Please sign in to comment.