-
Notifications
You must be signed in to change notification settings - Fork 2
Description
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 folders renv
and packrat
directly beneath the root of the project.
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 targets
package. 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
.
Possible solutions?
- delete the line where
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 list - 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
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.