Skip to content

Commit 51e692e

Browse files
Merge pull request #172 from lorenzwalthert/issue-171
- Better roxygen2 cache (#172).
2 parents ef26f40 + 82ef59c commit 51e692e

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

NEWS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
Initial CRAN release. See https://lorenzwalthert.github.io/precommit/.
44

5+
# precommit v0.0.0.9049 (development)
6+
7+
- Roxygen hook cache only includes files that are part of the index and
8+
will hence be able to use the cache in cases it was previously invalidated
9+
without need (#171).
10+
511

612
# precommit v0.0.0.9048
713

inst/WORDLIST

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ EOF
2929
exlucded
3030
fs
3131
getOption
32+
getwd
3233
gh
3334
github
3435
gitignore
@@ -46,19 +47,22 @@ knitr
4647
lang
4748
Lifecycle
4849
lintr
50+
loadCache
4951
lorenz
5052
lorenzwalthert
5153
macOS
5254
magrittr
5355
maxkb
5456
md
5557
miniconda
58+
mtime
5659
navbar
5760
netlify
5861
nrow
5962
oneliner
6063
os
6164
overscope
65+
packageVersion
6266
params
6367
parsable
6468
pkgapi
@@ -89,6 +93,7 @@ roclet
8993
roclets
9094
ropenscilabs
9195
roxygen
96+
roxygenise
9297
roxygenize
9398
RoxygenNote
9499
Rprofile
@@ -99,11 +104,13 @@ Rr
99104
Rscript
100105
RStudio
101106
rstudioapi
107+
saveCache
102108
seealso
103109
stderr
104110
stdout
105111
stopifnot
106112
styler
113+
Sys
107114
testthat
108115
tidyverse
109116
travis
@@ -115,6 +122,7 @@ usr
115122
VignetteBuilder
116123
walthert
117124
Walthert
125+
wd
118126
withr
119127
wordlist
120128
writeLines

inst/bin/roxygenize

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ wd <- list(getwd())
3838
cache <- loadCache(key = wd, dirs = path_relative_cache)
3939

4040
if (!is.null(cache)) {
41-
candidates <- list.files(c("R", "man"), full.names = TRUE)
41+
candidates <- intersect(
42+
list.files(c("R", "man"), full.names = TRUE),
43+
arguments$files
44+
)
4245
all_files <- file.info(candidates)
4346
last_modified <- max(all_files$mtime)
4447
if (last_modified > cache[[1]]) {

0 commit comments

Comments
 (0)