Skip to content

Commit 214e8e3

Browse files
committed
lint: adjust indentation, nolint objects only in cli interpolation
1 parent 3e3c0e4 commit 214e8e3

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

R/revision_analysis.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ revision_summary <- function(epi_arch,
243243

244244
# time_type_unit_pluralizer[[time_type]] is a format string controlled by us
245245
# and/or downstream devs, so we can paste it onto our format string safely:
246-
units_plural <- pluralize(paste0("{qty(2)}", time_type_unit_pluralizer[[time_type]]))
246+
units_plural <- pluralize(paste0("{qty(2)}", time_type_unit_pluralizer[[time_type]])) # nolint: object_usage_linter
247247
cli_inform("{toTitleCase(units_plural)} until within {within_latest*100}% of the latest value:")
248248
time_delta_summary(revision_behavior[["lag_near_latest"]], time_type) %>% print()
249249
}

R/time-utils.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ time_type_unit_pluralizer <- c(
271271
#'
272272
#' @keywords internal
273273
format_time_delta <- function(x, time_type) {
274-
n_steps <- time_delta_to_n_steps(x, time_type)
274+
n_steps <- time_delta_to_n_steps(x, time_type) # nolint: object_usage_linter
275275
# time_type_unit_pluralizer[[time_type]] is a format string controlled by us
276276
# and/or downstream devs, so we can paste it onto our format string safely:
277277
pluralize(paste0("{n_steps} ", time_type_unit_pluralizer[[time_type]]))

tests/testthat/test-time-utils.R

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,12 @@ test_that("difftime_approx_ceiling_time_delta works as expected", {
241241
) %>%
242242
mutate(across(expected_wrapped_friendly_result, purrr::list_flatten)) %>%
243243
rowwise() %>%
244-
mutate(wrapped_friendly_result = as.difftime(x_amount, units = x_units) %>%
245-
difftime_approx_ceiling_time_delta(time_type) %>%
246-
time_delta_standardize(time_type, format = "friendly") %>%
247-
list()) %>%
244+
mutate(
245+
wrapped_friendly_result = as.difftime(x_amount, units = x_units) %>%
246+
difftime_approx_ceiling_time_delta(time_type) %>%
247+
time_delta_standardize(time_type, format = "friendly") %>%
248+
list()
249+
) %>%
248250
ungroup()
249251

250252
expect_equal(

0 commit comments

Comments
 (0)