@@ -38,14 +38,14 @@ knitr::opts_chunk$set(
38
38
comment = ""
39
39
)
40
40
41
- helper_tabulate <- function(x, caption = "", col_widths = c("10cm","5cm")){
41
+ helper_tabulate <- function(x, caption = "", col_widths = c("10cm", "5cm")) {
42
42
x %>%
43
43
kbl(
44
44
caption = caption,
45
45
booktabs = TRUE, longtable = TRUE
46
46
) %>%
47
47
kable_styling(
48
- latex_options = c("striped","repeat_header")
48
+ latex_options = c("striped", "repeat_header")
49
49
) %>%
50
50
column_spec(
51
51
1, width = col_widths[1]
@@ -80,7 +80,7 @@ data.frame(
80
80
R.version$platform,
81
81
R.version$system,
82
82
format(Sys.time(), tz = "UTC", usetz = TRUE)
83
- )) %>% helper_tabulate("System info",col_widths = c("6cm","6cm"))
83
+ )) %>% helper_tabulate("System info", col_widths = c("6cm", "6cm"))
84
84
```
85
85
86
86
## Package installed
@@ -97,10 +97,18 @@ wt <- sprintf("--work-tree='%s'", params$pkg_dir)
97
97
data.frame(
98
98
Field = c("branch", "commit `SHA1`", "commit date"),
99
99
Value = c(
100
- system2("git", list(gd, wt, "rev-parse", "--abbrev-ref", "HEAD"), stdout = TRUE),
100
+ system2(
101
+ "git",
102
+ list(gd, wt, "rev-parse", "--abbrev-ref", "HEAD"),
103
+ stdout = TRUE
104
+ ),
101
105
system2("git", list(gd, wt, "rev-parse", "HEAD"), stdout = TRUE),
102
- system2("git", list(gd, wt, "show", "-s", "--format=%ci", "HEAD"), stdout = TRUE)
103
- )) %>% helper_tabulate("Git information",col_widths = c("5cm","8cm"))
106
+ system2(
107
+ "git",
108
+ list(gd, wt, "show", "-s", "--format=%ci", "HEAD"),
109
+ stdout = TRUE
110
+ )
111
+ )) %>% helper_tabulate("Git information", col_widths = c("5cm", "8cm"))
104
112
```
105
113
106
114
## R Session Info
@@ -118,22 +126,22 @@ The following metrics are derived from the `riskmetric` R package. Metrics overl
118
126
d_riskmetric <- params$pkg_dir %>%
119
127
riskmetric::pkg_ref() %>%
120
128
riskmetric::pkg_assess() %>%
121
- purrr::map(1) %>%
129
+ purrr::map(1) %>%
122
130
lapply(as.character) %>%
123
- tibble::enframe() %>%
131
+ tibble::enframe() %>%
124
132
tidyr::unnest(cols = dplyr::everything()) %>%
125
133
# add labels
126
134
dplyr::left_join(
127
135
lapply(riskmetric::all_assessments(), attributes) %>%
128
136
purrr::map_df(tibble::as_tibble),
129
137
by = c("name" = "column_name")
130
- )
138
+ )
131
139
132
140
d_riskmetric %>%
133
141
dplyr::filter(
134
142
name %in% c(
135
- "news_current","has_vignettes",
136
- "license","downloads_1yr"
143
+ "news_current", "has_vignettes",
144
+ "license", "downloads_1yr"
137
145
)
138
146
) %>%
139
147
dplyr::select(Metric = label, Status = value) %>%
@@ -186,20 +194,22 @@ if (require("covtracer", quietly = TRUE)) {
186
194
alias,
187
195
test_name,
188
196
file,
189
- is_exported,doctype,direct
197
+ is_exported,
198
+ doctype,
199
+ direct
190
200
) %>%
191
201
dplyr::filter(!doctype %in% c("data", "class")) %>% # ignore objects without testable code
192
202
dplyr::filter(is_exported == TRUE) %>% # Only exported
193
203
dplyr::filter(!duplicated(.)) %>%
194
- dplyr::mutate(alias = paste0(alias,"()")) %>%
195
- dplyr::mutate(file = paste0("man/",file))
204
+ dplyr::mutate(alias = paste0(alias, "()")) %>%
205
+ dplyr::mutate(file = paste0("man/", file))
196
206
197
207
covtracer_df_clean %>%
198
208
dplyr::filter(!duplicated(.)) %>%
199
209
dplyr::filter(!is.na(test_name)) %>%
200
210
dplyr::filter(!is.na(file)) %>% # unexported?
201
211
dplyr::arrange(file) %>%
202
- dplyr::select(`Test Description` = test_name, Documentation = file) %>%
212
+ dplyr::select(`Test Description` = test_name, Documentation = file) %>%
203
213
helper_tabulate(
204
214
caption = "Tracebility matrix mapping unit tests to documented behaviours."
205
215
)
0 commit comments