We have a git version controlled repository (created with checklist::create_project) where we want renv package management only for code belonging to a specific analysis pipeline created with the targetspackage. We would therefore need a way to tell checklist::check_lintr() to exclude that renv folder, which is in our case in a subfolder like so: source/targets/pipeline1/renv.
keep the line, but execute it conditionally based on an the value of an extra argument to check_lintr to use the checklist .lintr config file or not
add extra lines of code to search for any renv or packrat folders and exclude them all by passing them to the exclusions argument of lintr::lint_dir(..., exclusions = list("source/targets/pipeline1/renv)) (which is called by checklist::check_dir()).
I think the last approach is the best for this particular problem.
tagging @EmmaCartuyvels1 and @wlangera so they can follow along.
Problem:
check_lintr()
calls https://github.com/inbo/checklist/blob/3413f5fec507f8039063f7573fabc0e1bc20adab/R/check_lintr.R#L21C16-L21C16 which forces the function to use the hard coded linter options which are delivered with the checklist package. These lintr options include exclusion of lintr checks for foldersrenv
andpackrat
directly beneath the root of the project.We have a git version controlled repository (created with
checklist::create_project
) where we wantrenv
package management only for code belonging to a specific analysis pipeline created with thetargets
package. We would therefore need a way to tellchecklist::check_lintr()
to exclude thatrenv
folder, which is in our case in a subfolder like so:source/targets/pipeline1/renv
.Possible solutions?
check_lintr()
calls https://github.com/inbo/checklist/blob/3413f5fec507f8039063f7573fabc0e1bc20adab/R/check_lintr.R#L21C16-L21C16? This option is already in ourRprofile.site
. In that way, we can set a project specific.lintr
config file ourselves and add the renv folder paths to the exclusions listcheck_lintr
to use the checklist.lintr
config file or notrenv
orpackrat
folders and exclude them all by passing them to the exclusions argument oflintr::lint_dir(..., exclusions = list("source/targets/pipeline1/renv))
(which is called bychecklist::check_dir()
).I think the last approach is the best for this particular problem.
tagging @EmmaCartuyvels1 and @wlangera so they can follow along.