-
Notifications
You must be signed in to change notification settings - Fork 27
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
refactor cargo-processx functions #397
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JosiahParry
reviewed
Nov 19, 2024
JosiahParry
reviewed
Nov 19, 2024
codcov is being a bit extreme here. We can address the coverage later on. It is actually penalizing this PR for adding more checks funnily enough. Good work @kbvernon |
JosiahParry
approved these changes
Nov 21, 2024
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR tries to bring consistency to how functions call
processx::run()
. The main goal is to unburden this package by lettingprocessx
do the heavy lifting wherever possible. Changes include:error_on_status = TRUE
everywhereecho
parameter and passing it toecho_cmd = echo
(print cargo command to console) andecho = echo
(print stdout to console). The default isTRUE
to ensure that maximum information is printed to the console.env = get_cargo_envvars()
. I'm not sure this one is strictly necessary. I believe the function was originally written to handle issues with rtools and windows, but functions that don't use this still pass CI on all OS.wd
. This is now done with a single call torprojroot::find_package_root_file()
.jsonlite::parse_json(simplifyDataFrame = TRUE)
whenever cargo command returns json formatted strings in stdout. If we can always assume data.frames rather than lists, I think this will simplify future maintenance.At the same time, I took the liberty of adding standalone type checks, reformatting to ensure scripts past lintr tests, removing magrittr pipes, and replacing redundant code.
Right now, there are seven files with calls to
processx::run()
, but I only updated four of them:I'm ignoring cran-compliance.R because I think Josiah's recent work will make that code obsolete. I think the myriad issues in
source.R
are substantial enough that they call for their own PR. And the call inutils.R
is only really there to check for third party cargo tools, so maybe not worth messing with.