Skip to content

Commit

Permalink
Merge pull request #13 from katilingban/dev
Browse files Browse the repository at this point in the history
create add issue template functions
  • Loading branch information
ernestguevarra authored Apr 22, 2024
2 parents 70ba49d + 2cd9433 commit 2cf3f75
Show file tree
Hide file tree
Showing 13 changed files with 205 additions and 5 deletions.
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/initial-cran-release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: Initial CRAN release
about: Checklist of tasks for initial CRAN release
title: Checklist of tasks for initial CRAN release
labels: documentation
assignees: ernestguevarra
---

* [ ] `usethis::use_news_md()`
* [ ] `usethis::use_cran_comments()`
* [ ] Update (aspirational) install instructions in `README`
* [ ] Proofread `Title:` and `Description:`
* [ ] Check that all exported functions have `@returns` and `@examples`
* [ ] Check that `Authors@R:` includes a copyright holder (role 'cph')
* [ ] Check licensing of included files
* [ ] Review https://github.com/DavisVaughan/extrachecks
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
export(add_badge_codefactor)
export(add_badge_status)
export(add_contributing)
export(add_issue_template)
export(add_logo)
export(add_zenodo_badge)
importFrom(jsonlite,fromJSON)
Expand Down
2 changes: 1 addition & 1 deletion R/add_contributing.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#'
#' Add contributing document
#' Add contributing markdown
#'
#' @param repo Short remote git repository name. If NULL, is determined based
#' on current git settings.
Expand Down
55 changes: 55 additions & 0 deletions R/add_issue_templates.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#'
#' Add issue templates
#'
#' @param issue A character value of type of issue template to create. Choices
#' are *"initial-cran-release"*, *"update-cran-release"*,
#' *"submission-cran"*, and *"acceptance-cran"*.
#' @param path Path to file to add issue template into. Set to
#' ".github/ISSUE_TEMPLATE" which is the default location specified by
#' GitHub.
#' @param overwrite Logical. If an exising issue template with the same file
#' name is found, should it be overwritten? Default to FALSE.
#'
#' @returns A specified issue template markdown file in the specified `path`.
#'
#' @examples
#' if (interactive()) add_issue_template("initial-cran-release")
#'
#' @rdname add_issue
#' @export
#'

add_issue_template <- function(issue,
path = ".github/ISSUE_TEMPLATE",
overwrite = FALSE) {
## Create path ----
if (!dir.exists(path)) dir.create(path)

## Get issue template file name ----
template_file_name <- paste0(issue, ".md")

## Check if file already exists ----
if (file.exists(file.path(path, template_file_name)) & !overwrite) {
message(
"Issue template already exists and overwrite = FALSE. No changes made."
)
} else {
## Get template ----
issue_template <- readLines(
con = system.file("templates", template_file_name, package = "pakete")
)

withr::with_output_sink(
new = file.path(path, template_file_name),
code = writeLines(
text = issue_template, con = file.path(path, template_file_name)
)
)

message(
paste0(
"Issue template created at ", file.path(path, template_file_name), ".")
)
}
}

8 changes: 7 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Currently, `pakete` includes functions for:

5. adding `repostatus` badge;

## Installation·
## Installation

You can install `pakete` via the [Katilingban R-universe](https://katilingban.r-universe.dev) as follows:

Expand All @@ -54,6 +54,12 @@ install.packages(

## Citation

If you find the `pakete` package useful please cite using the suggested citation provided by a call to the `citation()` function as follows:

```{r citation}
citation("pakete")
```

## Community guidelines

Feedback, bug reports and feature requests are welcome; file issues or seek support [here](https://github.com/katilingban/pakete/issues). If you would like to contribute to the package, please see our [contributing guidelines](https://katilingban.io/pakete/CONTRIBUTING.html).
Expand Down
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Currently, `pakete` includes functions for:

5. adding `repostatus` badge;

## Installation·
## Installation

You can install `pakete` via the [Katilingban
R-universe](https://katilingban.r-universe.dev) as follows:
Expand All @@ -51,6 +51,27 @@ install.packages(

## Citation

If you find the `pakete` package useful please cite using the suggested
citation provided by a call to the `citation()` function as follows:

``` r
citation("pakete")
#> To cite pakete in publications use:
#>
#> Ernest Guevarra (2024). _pakete: Utilities for Package Development_.
#> R package version 0.0.9000, <https://katilingban.io/pakete/>.
#>
#> A BibTeX entry for LaTeX users is
#>
#> @Manual{,
#> title = {pakete: Utilities for Package Development},
#> author = {{Ernest Guevarra}},
#> year = {2024},
#> note = {R package version 0.0.9000},
#> url = {https://katilingban.io/pakete/},
#> }
```

## Community guidelines

Feedback, bug reports and feature requests are welcome; file issues or
Expand Down
10 changes: 10 additions & 0 deletions inst/CITATION
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
bibentry(
bibtype = "Manual",
header = "To cite pakete in publications use:",
title = "pakete: Utilities for Package Development",
author = person("Ernest Guevarra"),
year = "2024",
note = "R package version 0.0.9000",
url = "https://katilingban.io/pakete/",
doi = ""
)
15 changes: 15 additions & 0 deletions inst/templates/acceptance-cran.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: Post-CRAN acceptance
about: Checklist of tasks for post-CRAN acceptance
title: Checklist of tasks for post-CRAN acceptance
labels: documentation
assignees: ernestguevarra
---

* [ ] Accepted
* [ ] `git push`
* [ ] `usethis::use_github_release()`
* [ ] `usethis::use_dev_version()`
* [ ] `git push`
* { ] Finish blog post, share on social media, etc.
* [ ] Add link to blog post in `pkgdown` news menu
16 changes: 16 additions & 0 deletions inst/templates/initial-cran-release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: Initial CRAN release
about: Checklist of tasks for initial CRAN release
title: Checklist of tasks for initial CRAN release
labels: documentation
assignees: ernestguevarra
---

* [ ] `usethis::use_news_md()`
* [ ] `usethis::use_cran_comments()`
* [ ] Update (aspirational) install instructions in `README`
* [ ] Proofread `Title:` and `Description:`
* [ ] Check that all exported functions have `@returns` and `@examples`
* [ ] Check that `Authors@R:` includes a copyright holder (role 'cph')
* [ ] Check licensing of included files
* [ ] Review https://github.com/DavisVaughan/extrachecks
13 changes: 13 additions & 0 deletions inst/templates/submission-cran.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: CRAN submission
about: Checklist of tasks for CRAN submission
title: Checklist of tasks for CRAN submission
labels: documentation
assignees: ernestguevarra
---

* [ ] `usethis::use_version('minor')` (or ‘patch’ or ‘major’)
* [ ] `devtools::submit_cran()`
* [ ] Approve email


17 changes: 17 additions & 0 deletions inst/templates/update-cran-release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Update CRAN release
about: Checklist of tasks for update CRAN release
title: Checklist of tasks for update CRAN release
labels: documentation
assignees: ernestguevarra
---

* [ ] Check current CRAN check results
* [ ] Check if any deprecation processes should be advanced, as described in [Gradual deprecation](https://lifecycle.r-lib.org/articles/communicate.html#gradual-deprecation)
* [ ] [Polish NEWS](https://style.tidyverse.org/news.html#news-release)
* [ ] `urlchecker::url_check()`
* [ ] `devtools::build_readme()`
* [ ] `devtools::check(remote = TRUE, manual = TRUE)`
* [ ] `devtools::check_win_devel()`
* [ ] `usethis::use_revdep()` then `revdepcheck::revdep_check(num_workers = 4)`
* [ ] Update `cran-comments.md`
4 changes: 2 additions & 2 deletions man/add_contributing.Rd

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

30 changes: 30 additions & 0 deletions man/add_issue.Rd

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

0 comments on commit 2cf3f75

Please sign in to comment.