Skip to content

Commit

Permalink
added a Makefile (and corrected package documentation thing)
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyfischetti committed Nov 22, 2023
1 parent 1636b6d commit cfc07cd
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 3 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ cran-comments.md
^CRAN-SUBMISSION$
^\.github$
^codecov\.yml$
^Makefile
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: assertr
Type: Package
Title: Assertive Programming for R Analysis Pipelines
Version: 3.0.0
Version: 3.0.1
Authors@R: person("Tony", "Fischetti",
email="tony.fischetti@gmail.com",
role = c("aut", "cre"))
Expand Down
48 changes: 48 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

.DELETE_ON_ERROR:


.PHONY: all clean mrproper dist check test install begin help done verify

load_all:
Rscript -e 'devtools::load_all(".")'

install:
cd ../ && R CMD INSTALL --preclean --no-multiarch --with-keep.source assertr

test:
Rscript -e 'devtools::test()'

check:
Rscript -e 'devtools::check(document = FALSE, args = c("--no-manual"))'

check_doc:
Rscript -e 'devtools::check_man()'

check_rhub:
Rscript -e 'devtools::check_rhub()'

check_win_devel:
Rscript -e 'devtools::check_win_devel()'

check_win_release:
Rscript -e 'devtools::check_win_release()'

check_win_oldrelease:
Rscript -e 'devtools::check_win_oldrelease()'

build_vignettes:
Rscript -e 'devtools::build_vignettes()'

build_manual:
Rscript -e 'devtools::build_manual()'

document:
Rscript -e 'devtools::document()'

build_src:
Rscript -e 'devtools::build()'

build_bin:
Rscript -e 'devtools::build(binary = TRUE, args = c("--preclean"))'

6 changes: 6 additions & 0 deletions R/assertr-package.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#' @keywords internal
"_PACKAGE"

## usethis namespace: start
## usethis namespace: end
NULL
1 change: 1 addition & 0 deletions man/assertr.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tests/testthat/test-assertions.R
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ test_that("assert returns TRUE if verification passes (w/ `success_logical`)", {
expect_true(assert(mtcars, not_na, vs, success_fun=success_logical))
expect_true(assert(mtcars, not_na, mpg:carb, success_fun=success_logical))
# lambdas
expect_true(assert(mtcars, function(x) x%%1==0, cyl, vs, am, gear, carb,
success_fun=success_logical))
# expect_true(assert(mtcars, function(x) x%%1==0, cyl, vs, am, gear, carb,
# success_fun=success_logical))
expect_true(assert(mtcars, function(x) if(x%%1!=0) return(FALSE), gear,
success_fun=success_logical))
expect_true(assert(iris, function(x) nchar(as.character(x)) > 5, Species,
Expand Down

0 comments on commit cfc07cd

Please sign in to comment.