Currently, we only support analysis of r project which are using renv package manager.
Files | Direct Deps | Deep Deps | Edges | Classifies Dev & Test Deps | Container Scanning |
---|---|---|---|---|---|
renv.lock |
(included but not classified as direct) | ✅ | ✅ | ❌ | ✅ |
DESCRIPTION & renv.lock |
✅ | ✅ | ✅ | ❌ | ✅ |
Find a file named DESCRIPTION
, and optionally look for renv.lock
in the same directory as DESCRIPTION
. Discovery will not look for
projects inside renv
directory, if renv.lock
or DESCRIPTION
files are discovered.
- Parse
DESCRIPTION
file to identify direct dependencies - we look for packages inDepends
,Imports
,Suggests
,Enhances
,LinkingTo
. - Parse
renv.lock
file to identify deep dependencies, and edges among them.
- If only
DESCRIPTION
file is accessible, FOSSA CLI will ignore version constraints, and will always default to latest version.
- Create
DESCRIPTION
file:
Type: project
Description: My project
Depends: tidyverse
- Create
main.R
file:
# you may need to execute following:
# if you do not have renv installed
# >> install.packages("renv", repos = "http://cran.us.r-project.org")
# initiate project
# ref: https://rstudio.github.io/renv/reference/init.html
options(renv.config.install.verbose = TRUE)
options(renv.config.install.transactional = FALSE)
renv::init(bare = TRUE)
renv::install("[email protected]")
renv::install()
# some example code
Square <- function(x) {
return(x^2)
}
print(Square(4))
# create renv.lock
# ref: https://rstudio.github.io/renv/reference/snapshot.html
renv::snapshot()
- execute
rscript main.R
- execute
fossa analyze --only-target renv --output
(run analysis onlyrenv
, but do not upload result to an endpoint)
fossa-cli
cannot identify test or development dependencies, and by default includes all dependencies in the analysis.fossa-cli
will ignore version constraint ifrenv.lock
file is not present.fossa-cli
cannot analyze path dependencies.- Please refer to vendored dependencies for workaround.
Explicitly specify an analysis target in .fossa.yml
file. The example below excludes all other analysis targets:
# .fossa.yml
version: 3
targets:
only:
- type: renv
Please file a ticket at FOSSA support portal.
Make sure to attach following for quick response from support or development team.
DESCRIPTION
filerenv.lock
file (if any)- stdout of
renv::diagnostics()