sonatype-nexus-community / oysteR

Create purls from the filtered sands of your dependencies, powered by OSS Index
https://sonatype-nexus-community.github.io/oysteR/
Apache License 2.0
40 stars 9 forks source link

[FEATURE] Default to version = packageVersion(pkg) and type = "cran" #66

Open ColinFay opened 3 years ago

ColinFay commented 3 years ago
> oysteR::audit("shiny")
Error in oysteR::audit("shiny") : 
  argument "version" is missing, with no default

> oysteR::audit("shiny", version = packageVersion("shiny"))
Error in generate_purls(pkg, version, type) : 
  argument "type" is missing, with no default

> oysteR::audit("shiny", version = packageVersion("shiny"), type = "cran")
ℹ Using cached results for 1 package
Error: Can't combine `version` <character> and `version` <package_version>.

It would be nice to default to version = packageVersion(pkg) and type = "cran", which seems to be the most common use case (auditing package version installed on the machine, and for CRAN).

Happy to PR this.

cc @bhamail / @DarthHater / @brittanybelle / @adrianpowell / @csgillespie

csgillespie commented 3 years ago

Thanks @ColinFay

  1. Doing a behind the scenes conversion of packageVersion to character seems like a good idea. Just test for class, then convert.
  2. I've been unsure about defaults because the API works for other languages
audit("pandas", version = "0.1.0", type = "pypi")
  1. My gut feeling is to have a new function: audit_r_pkg that defaults to CRAN, and tests all dependencies as well.
  2. Thoughts?

ColinFay commented 3 years ago

yeah I suppose that does make sense to have an audit_r_pkg with these default :)

Will draft a PR if that's ok with you !

csgillespie commented 3 years ago

That would be great!

Thanks Dr Colin Gillespie http://www.mas.ncl.ac.uk/~ncsg3/

On Tue, 13 Jul 2021 at 14:57, Colin Fay @.***> wrote:

yeah I suppose that does make sense to have an audit_r_pkg with these default :)

Will draft a PR if that's ok with you !

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sonatype-nexus-community/oysteR/issues/66#issuecomment-879111613, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJVQI7PZOV2H7ELGM54Y43TXRA5DANCNFSM5AIQ4K2A .