Created
December 18, 2018 12:40
-
-
Save jeroenjanssens/acde46b6e3ac1ad39ac31d048fbd4034 to your computer and use it in GitHub Desktop.
Script that tests your #rstats code before committing to git. When you have failed tests the commit will be aborted. Requires the devtools, testthat, and purrr packages. Name this script `pre-commit`, make it executable, and place it in the .git/hooks subdirectory of your git repository.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env RScript | |
messages <- purrr::map_chr(devtools::test(), | |
list("results", 1, "message")) | |
q("no", status = sum(messages != "success")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment