Skip to content

Point to args for import in error of deps-in-desc #254

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
May 15, 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
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@
- `{renv}` infra files are not checked anymore by default (#237).
- `deps-in-desc` now checks `.Rprofile`, `.Rmd` and `.Rnw` files in addition to
`.R` files (#216).
- The location of the pre-commit executable is now also recognised on Apple Silicon
- The location of the pre-commit executable is now also recognized on Apple Silicon
when installed with Homebrew (#240).
- The `deps-in-desc` hook now points to the hook argument
`--allow_private_imports` when the hook fails due to private imports (#254).
- Hook dependency updates are proposed by an automatic monthly pull request
(#430).

Expand Down
11 changes: 9 additions & 2 deletions inst/bin/deps-in-desc
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,16 @@ deps_in_desc <- function(file, arguments) {
)
if (length(private) > 0) {
cat(
"You should not call any function with `:::` unless it's a function you ",
"You should generally not call any function with `:::` unless it's a function you ",
"define yourself in this package. The following files have such function calls: ",
paste0(file, collapse = ", "),
paste0(file, collapse = ", "), "\n\n",
"If you still think `:::` is a good idea, you can ",
"allow private imports in your `.pre-commit-config.yaml` like this:

- id: deps-in-desc
args: [--allow_private_imports]

",
sep = ""
)
out <- FALSE
Expand Down