[mirror] Opinionated R package quickstart
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Updated GHA step; updated readme

VisruthSK 76477cb4 05eee300

+41 -59
+2 -2
.github/workflows/test-coverage.yaml
··· 45 45 files: ./cobertura.xml 46 46 plugins: noop 47 47 disable_search: true 48 - token: ${{ secrets.CODECOV_TOKEN }} 48 + use_oidc: true 49 49 50 50 - name: Show testthat output 51 51 if: always() ··· 56 56 57 57 - name: Upload test results 58 58 if: failure() 59 - uses: actions/upload-artifact@v4 59 + uses: actions/upload-artifact@v6 60 60 with: 61 61 name: coverage-test-failures 62 62 path: ${{ runner.temp }}/package
+15 -15
R/bootstrapper.R
··· 16 16 #' @export 17 17 bootstrapper <- function( 18 18 path = ".", 19 - fields, 19 + fields = getOption( 20 + "usethis.description", 21 + list( 22 + "Authors@R" = person( 23 + "Visruth", 24 + "Srimath Kandali", 25 + , 26 + "public@visruth.com", 27 + role = c("aut", "cre", "cph"), 28 + comment = c(ORCID = "0009-0005-9097-0688") 29 + ) 30 + ) 31 + ), 20 32 private = TRUE, 21 33 setup_gha = TRUE, 22 34 setup_dependabot = TRUE, ··· 44 56 #' @export 45 57 create_package <- function( 46 58 path = ".", 47 - fields = getOption( 48 - "usethis.description", 49 - list( 50 - "Authors@R" = person( 51 - "Visruth", 52 - "Srimath Kandali", 53 - , 54 - "public@visruth.com", 55 - role = c("aut", "cre", "cph"), 56 - comment = c(ORCID = "0009-0005-9097-0688") 57 - ) 58 - ) 59 - ), 59 + fields = getOption("usethis.description"), 60 60 private = TRUE, 61 61 ... 62 62 ) { ··· 183 183 #' @export 184 184 setup_gha <- function() { 185 185 usethis::use_github_action("check-standard", badge = TRUE) 186 - usethis::use_github_action("test-coverage", badge = TRUE) 186 + usethis::use_github_action("test-coverage") 187 187 usethis::use_github_action( 188 188 url = "https://github.com/visruthsk/bootstrapper/blob/main/.github/workflows/format-suggest.yaml" 189 189 )
+20 -38
README.md
··· 3 3 <!-- badges: start --> 4 4 [![R-CMD-check](https://github.com/VisruthSK/bootstrapper/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/VisruthSK/bootstrapper/actions/workflows/R-CMD-check.yaml) 5 5 [![Codecov test coverage](https://codecov.io/gh/VisruthSK/bootstrapper/graph/badge.svg)](https://app.codecov.io/gh/VisruthSK/bootstrapper) 6 - [![test-coverage](https://github.com/VisruthSK/bootstrapper/actions/workflows/test-coverage.yaml/badge.svg)](https://github.com/VisruthSK/bootstrapper/actions/workflows/test-coverage.yaml) 7 6 <!-- badges: end --> 8 7 9 - The goal of bootstrapper is to ... 8 + The goal of bootstrapper is to quickly setup a modern R package with appropriate actions and assorted setup. Mostly for my own usage, pretty opinionated. 10 9 11 10 ## Installation 12 11 ··· 14 13 15 14 ``` r 16 15 # FILL THIS IN! HOW CAN PEOPLE INSTALL YOUR DEV PACKAGE? 16 + pak::pak("VisruthSK/bootstrapper") 17 17 ``` 18 18 19 - ## Example 19 + ## Usage 20 20 21 - This is a basic example which shows you how to solve a common problem: 21 + The package is optimized for my usage by default, so calling the main function bare is not advised unless you are me. 22 22 23 - ``` r 24 - library(bootstrapper) 25 - ## basic example code 23 + ```r 24 + bootstrapper:bootstrapper() 26 25 ``` 27 26 28 - ## IMPLEMENT THIS WORKFLOW: 27 + The main thing to set is the fields option, where you should put your own name, email, etc. instead. 29 28 30 29 ```r 31 - usethis::create_package(".") 32 - # publish repo to GitHub 33 - usethis::use_readme_md() 34 - unlink("*.Rproj") 35 - usethis::use_testthat() 36 - 37 - # GitHub Actions Setup 38 - usethis::use_github_action("check-standard", badge = TRUE) 39 - usethis::use_github_action("test-coverage", badge = TRUE) 40 - usethis::use_github_action( 41 - url = "https://github.com/visruthsk/bootstrapper/blob/main/.github/workflows/format-suggest.yaml" 42 - ) 43 - usethis::use_pkgdown_github_pages() 44 - c( 45 - "version: 2", 46 - "updates:", 47 - " - package-ecosystem: \"github-actions\"", 48 - " directory: \"/\"", 49 - " schedule:", 50 - " interval: \"weekly\"" 51 - ) |> 52 - write_to_path(fs::path(".github", "dependabot.yml")) 53 - 54 - find_replace_in_dir("actions/checkout@v4", "actions/checkout@v6") 55 - find_replace_in_dir( 56 - "JamesIves/github-pages-deploy-action@v4.5.0", 57 - "JamesIves/github-pages-deploy-action@v4" 30 + bootstrapper:bootstrapper( 31 + fields = list( 32 + "Authors@R" = person( 33 + "Visruth", 34 + "Srimath Kandali", 35 + , 36 + "public@visruth.com", 37 + role = c("aut", "cre", "cph"), 38 + comment = c(ORCID = "0009-0005-9097-0688") 39 + ) 40 + ) 58 41 ) 42 + ``` 59 43 60 - usethis::use_tidy_description() 61 - # pick a license 62 - ``` 44 + There are some flags you can set to flip on/off certain features like publishing the repository as private/public on GitHub, copying over some GitHub Actions, using Dependabot for GHA, an `AGENTS.md` file, and a precommit hook for `air` and `jarl` formatting.
+3 -1
man/bootstrapper.Rd
··· 6 6 \usage{ 7 7 bootstrapper( 8 8 path = ".", 9 - fields, 9 + fields = getOption("usethis.description", list(`Authors@R` = person("Visruth", 10 + "Srimath Kandali", , "public@visruth.com", role = c("aut", "cre", "cph"), comment = 11 + c(ORCID = "0009-0005-9097-0688")))), 10 12 private = TRUE, 11 13 setup_gha = TRUE, 12 14 setup_dependabot = TRUE,
+1 -3
man/create_package.Rd
··· 6 6 \usage{ 7 7 create_package( 8 8 path = ".", 9 - fields = getOption("usethis.description", list(`Authors@R` = person("Visruth", 10 - "Srimath Kandali", , "public@visruth.com", role = c("aut", "cre", "cph"), comment = 11 - c(ORCID = "0009-0005-9097-0688")))), 9 + fields = getOption("usethis.description"), 12 10 private = TRUE, 13 11 ... 14 12 )