Skip to content

exclude R from roxygen snippet generation #358

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: precommit
Title: Pre-Commit Hooks
Version: 0.2.2.9007
Version: 0.2.2.9008
Author: Lorenz Walthert
Maintainer: Lorenz Walthert <[email protected]>
Description: Useful git hooks for R building on top of the multi-language
Expand Down
5 changes: 2 additions & 3 deletions R/setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,9 @@ snippet_generate <- function(snippet = "",
"\n"
))
deps <- desc::desc_get_deps()
hard_dependencies <- deps[(deps$type %in% c("Depends", "Imports")), "package"]
hard_dependencies_vec <- hard_dependencies %>%
hard_dependencies <- deps[(deps$type %in% c("Depends", "Imports")), "package"] %>%
setdiff("R")
if (length(hard_dependencies_vec) < 1) {
if (length(hard_dependencies) < 1) {
cli::cli_alert_success(paste0(
"According to {.code DESCRIPTION}`, there are no hard dependencies of ",
"your package. You are set."
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ test_that("snippet generation works", {
out <- capture_output(snippet_generate("additional-deps-roxygenize")),
NA,
)
expect_equal(out, "")
usethis::use_package("styler")
expect_error(
out <- capture_output(snippet_generate("additional-deps-roxygenize")),
Expand Down