Skip to content

Commit

Permalink
fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
olivroy committed Jan 2, 2025
1 parent 519fe28 commit 3acff69
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion .lintr
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
linters: linters_with_defaults(object_name_linter=NULL, cyclocomp_linter=NULL, object_length_linter=NULL) # see vignette("lintr")
linters: linters_with_defaults(object_name_linter=NULL, cyclocomp_linter=NULL, object_length_linter=NULL, object_usage_linter = NULL) # see vignette("lintr")
encoding: "UTF-8"
exclusions: list(
"R/import-standalone-obj-type.R",
"R/import-standalone-types-check.R"
)
3 changes: 2 additions & 1 deletion R/remove_labels.R
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ remove_user_na.haven_labelled_spss <- function(x,

if (length(val_to_tag) > 26) {
cli::cli_warn(c(
"{length(val_to_tag)} different user-defined missing values found in 'x'.",
"{length(val_to_tag)} different user-defined missing
values found in 'x'.",
i = "A maximum of 26 could be tagged.",
"!" = "'user_na_to_tagged_na' has been ignored.",
i = "'user_na_to_na = TRUE' has been used instead."
Expand Down
5 changes: 2 additions & 3 deletions tests/testthat/test-to_labelled.r
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,8 @@ test_that("foreign_to_labelled works correctly", {
function(x) {
if (x$type == "none") {
return(NULL)
} else {
return(x$value)
}
x$value
}
)
expect_equal(sapply(tl_spss_list, na_values), miss_list)
Expand Down Expand Up @@ -197,7 +196,7 @@ test_that("memisc_to_labelled works correctly", {
}
vals <- vlabs@values
names(vals) <- vlabs@.Data
return(vals)
vals
})
expect_identical(val_labels(tl_ds), val_labels_ds)
}
Expand Down

0 comments on commit 3acff69

Please sign in to comment.