From 811baf2b0adeb7c2cc6f2e345df4944074a7481d Mon Sep 17 00:00:00 2001 From: Will Beasley Date: Thu, 11 Aug 2022 23:12:20 -0500 Subject: [PATCH] lintr & other checks ref #9 --- .Rbuildignore | 1 + .lintr | 5 ++++ CRAN-RELEASE | 2 -- documentation-for-developers/refresh.R | 38 ++++++++++++++++++++++---- 4 files changed, 39 insertions(+), 7 deletions(-) create mode 100644 .lintr delete mode 100644 CRAN-RELEASE diff --git a/.Rbuildignore b/.Rbuildignore index d91dc4b..d2dd944 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -12,6 +12,7 @@ documentation-for-developers/ playgrounds/ utility/ ^\.github$ +^\.lintr$ ^\.markdownlist\.json$ ^\.travis\.yml$ ^appveyor\.yml$ diff --git a/.lintr b/.lintr new file mode 100644 index 0000000..7bd9b0e --- /dev/null +++ b/.lintr @@ -0,0 +1,5 @@ +linters: linters_with_defaults( + line_length_linter(120), + commas_linter = NULL, + commented_code_linter = NULL + ) diff --git a/CRAN-RELEASE b/CRAN-RELEASE deleted file mode 100644 index d780e1c..0000000 --- a/CRAN-RELEASE +++ /dev/null @@ -1,2 +0,0 @@ -This package was submitted to CRAN on 2018-09-12. -Once it is accepted, delete this file and tag the release (commit de657690f5). diff --git a/documentation-for-developers/refresh.R b/documentation-for-developers/refresh.R index 2956958..2be540f 100644 --- a/documentation-for-developers/refresh.R +++ b/documentation-for-developers/refresh.R @@ -1,14 +1,36 @@ -rm(list=ls(all=TRUE)) +rm(list = ls(all = TRUE)) # library(devtools) -deviceType <- ifelse(R.version$os=="linux-gnu", "X11", "windows") -options(device = deviceType) #http://support.rstudio.org/help/discussions/problems/80-error-in-function-only-one-rstudio-graphics-device-is-permitted +# deviceType <- ifelse(R.version$os=="linux-gnu", "X11", "windows") +# options(device = deviceType) #http://support.rstudio.org/help/discussions/problems/80-error-in-function-only-one-rstudio-graphics-device-is-permitted + +spelling::spell_check_package() +# spelling::update_wordlist() +lintr::lint_package() +urlchecker::url_check(); urlchecker::url_update() devtools::document() devtools::check_man() #Should return NULL devtools::build_vignettes() + +checks_to_exclude <- c( + "covr", + # "cyclocomp"#, + "lintr_line_length_linter" +) +gp <- + goodpractice::all_checks() |> + purrr::discard(~(. %in% checks_to_exclude)) |> + { + \(checks) + goodpractice::gp(checks = checks) + }() +goodpractice::results(gp) +gp + +devtools::document() pkgdown::clean_site() pkgdown::build_site() -system("R CMD Rd2pdf --no-preview --force --output=./documentation-peek.pdf ." ) +# system("R CMD Rd2pdf --no-preview --force --output=./documentation-peek.pdf ." ) devtools::run_examples(); #dev.off() #This overwrites the NAMESPACE file too # devtools::run_examples(, "table-nih-enrollment.Rd") @@ -18,7 +40,13 @@ test_results_checked <- devtools::test(filter = "table-nih-enrollment") test_results_not_checked <- testthat::test_dir("./tests/manual/") # devtools::check(force_suggests = FALSE) +devtools::check(cran=TRUE) +devtools::check( # Equivalent of R-hub + manual = TRUE, + remote = TRUE, + incoming = TRUE +) +devtools::check_rhub(email="wibeasley@hotmail.com") # devtools::check_win_devel() #CRAN submission policies encourage the development version -# devtools::check_rhub(email="wibeasley@hotmail.com") # devtools::revdep_check(pkg="codified", recursive=TRUE) # devtools::release(check=FALSE) #Careful, the last question ultimately uploads it to CRAN, where you can't delete/reverse your decision.