From 5c237c4d56710a50a290de5cdbb3539a0eca043d Mon Sep 17 00:00:00 2001 From: Russ Hyde Date: Wed, 3 Apr 2024 11:08:26 +0100 Subject: [PATCH 1/3] don't lint testdata --- .lintr | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.lintr b/.lintr index 88a3468..df0b1d2 100644 --- a/.lintr +++ b/.lintr @@ -9,6 +9,5 @@ linters: linters_with_defaults( exclusions: list( "inst/extdata/duplicated.R", "tests/testthat.R", - # ? should be able to exclude a directory in lintr - "tests/testthat/testdata/anRpackage/R/anRpackage-internal.R" + "tests/testthat/testdata" ) From f2655c3e9e8b61aba5671448dee43e59f180a270 Mon Sep 17 00:00:00 2001 From: Russ Hyde Date: Wed, 3 Apr 2024 11:09:04 +0100 Subject: [PATCH 2/3] refac: fix lint on use of structure() --- R/dups-class.R | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/R/dups-class.R b/R/dups-class.R index 42b4b65..cb88c98 100644 --- a/R/dups-class.R +++ b/R/dups-class.R @@ -6,10 +6,11 @@ as_dups <- function(x) { if (methods::is(x, "dups")) { return(x) } - structure( - list(dups_df = x), - class = "dups" - ) + + dups <- list(dups_df = x) + class(dups) <- "dups" + + dups } #' as.data.frame method for `dups` class From 302cf665424042097596d60a2ab36965ce7f5433 Mon Sep 17 00:00:00 2001 From: Russ Hyde Date: Wed, 3 Apr 2024 11:10:16 +0100 Subject: [PATCH 3/3] chore: bump NEWS --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index 5b6b147..74faec2 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,7 @@ * Update the CI workflows for pkgdown, test-coverage and R CMD check * use lintr >= 3, and update .lintr config file +* Fixed linting across package * lint the package in CI * Convert default git branch to 'main' (#84, @russHyde)