File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 33
44" Run lintr on R files during a precommit.
55Usage:
6- lintr [--warn_only] <files>...
6+ lintr [--warn_only] [--root=<root_>] <files>...
77Options:
88 --warn_only Print lint warnings instead of blocking the commit. Should be
99 used with `verbose: True` in `.pre-commit-config.yaml`.
1010 Otherwise, lints will never be shown to the user.
11+ --root=<root_> Path relative to the git root that contains the R package root [default: .].
1112" - > doc
1213
1314arguments <- precommit :: precommit_docopt(doc )
15+ arguments $ files <- normalizePath(arguments $ files ) # because working directory changes to root
16+ setwd(normalizePath(arguments $ root ))
1417
1518lintr_staged <- grepl(
1619 " modified:.*\\ .lintr" , system2(" git" , " status" , stdout = TRUE )
You can’t perform that action at this time.
0 commit comments