Skip to content

Commit

Permalink
Pre-release activities (prepare for CRAN release) (#176)
Browse files Browse the repository at this point in the history
# Pull Request

<!--- Replace `#nnn` with your issue link for reference. -->

Fixes #172 

### Summary

* Review and update:
    * [x] README.md (check example code)
    * [x] NEWS.md
      * one liner change
* Review functions:
    * [x] @example tag, make sure it runs, fix if otherwise
* [x] Make sure functions has @return tag to document the return value
    * [x] no \dontrun tag, replace with if(interactive()) if needed
      * `merge_datasets` example is insufficient
* [x] Package `Title` is not duplicated in Package `Description` in
DESCRIPTION file (e.g. this happens in teal.slice currently)
* [x] You have checked the Package Release Template
https://github.com/insightsengineering/teal.reporter/pull/205/files
* [x] Make sure there are no `:::` in examples
* if you need to retain the example that uses `:::`, use
`getFromNamespace()` function.
* [x] remove package:: call and depend package:: call from example.
@kartikeyakirar
* [x] Make sure all `teal.*` mentions are lower-cased and quoted
* [x] Make sure each link to our documentation hosted with pkgdown on
github pages do not have `/main/` in the address
  * it should have has `/latest-tag/` instead
* so we always expose the documentation of the latest release and not
what's currently on main branch but not yet released
* [x] Remove old rd syntax
* [x] Switch from title case into sentence case for title and
description of functions.
* [x] All package names in `Title` and `Description` fields of
DESCRIPTION file are quoted with `'` _(not backtick)_
* [x] Sanity check of all vignettes, make sure there is no typo, no
wrong format, etc. @kartikeyakirar

#### New

* [x] Remove prefixes from data calls `rADRS`, `rADTTE`, etc... (just
like `{teal.data}`)
* [x] Remove `return` wrapper if it is the last expression (per NEST
guidelines)
  * #177
* [x] Remove  exception in `.lintr`: `indentation_linter = NULL` 
* [x] ~Test for unused functions (in package and overall in NEST)~
@averissimo
    * PR request against this feature branch 
* 🛑 This should not be done on this release as it may have unintended
consequences.
* [See this
comment](#176 (comment))
with possible candidates
 * [x] Standard order of roxygen2 tags 
   * `@title ➡️ @doctype ➡️ @description ➡️ @details ➡️ @Rdname ➡️ `
* `➡️ @inheritParams ➡️ @params ➡️ @return ➡️ @Seealso ➡️ @references
➡️`
   * `➡️ @examples ➡️ @export ➡️ @Keywords  ➡️  @noRd`
* [x] Remove `@noMd` (in favor of `Roxygen: list(markdown = TRUE)` in
`DESCRIPTION`)

#### To consider?
* [x] Convert "# nolint" to specific rule exception
  * #178
* [x] ~Added `resolve()` to the list of exported functions as the
sub-functions are exported (`resolve.delayed_variable_choices`, ...).~
  * Let's discuss if this needs to be reverted.
* Edit: this is a trick to have S3methods internally as `resolve` should
not be exported see aff0f35

#### Move to its own issue

* [x] Make sure non-exported functions do not have examples
  * #181

#### After checklist is completed _(🚨 blocked until checklist is
completed)_
* [x] Run urlchecker::url_check() to identify broken links and fix
* [x] Run R CMD check --as-cran make sure everything pass
* [x] Make Sure `inst/WORDLIST` is minimalized

#### Content review _(🚨 blocked for now)_

All tasks above are mostly focused on structure, standards and cleanup.
Here is to look at content

What to look for:

* Review content of titles, descriptions, params, etc.
  * They should be clear to the reader 
* Review vignettes
  * Review content
  * All chunks of code are runnable

Content-related tasks should have a PR against this feature branch.

---------

Signed-off-by: André Veríssimo <[email protected]>
Signed-off-by: Marcin <[email protected]>
Signed-off-by: kartikeya kirar <[email protected]>
Co-authored-by: 27856297+dependabot-preview[bot]@users.noreply.github.com <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: unknown <[email protected]>
Co-authored-by: m7pr <[email protected]>
Co-authored-by: Marcin <[email protected]>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
6 people authored Feb 14, 2024
1 parent f7ee2bc commit f3c05c6
Show file tree
Hide file tree
Showing 141 changed files with 3,456 additions and 2,500 deletions.
3 changes: 2 additions & 1 deletion .lintr
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
linters: linters_with_defaults(
line_length_linter = line_length_linter(120),
cyclocomp_linter = NULL,
object_usage_linter = NULL
object_usage_linter = NULL,
object_name_linter = object_name_linter(styles = c("snake_case", "symbols"), regexes = c(ANL = "^ANL_?[0-9]*$", ADaM = "^r?AD[A-Z]{2,3}_?[0-9]*$"))
)
33 changes: 19 additions & 14 deletions R/Queue.R
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
# Queue ====

#' @title R6 Class - A First-In-First-Out Abstract Data Type
#' R6 Class - A First-In-First-Out Abstract Data Type
#' @docType class
#'
#' @description
#' `r lifecycle::badge("experimental")`
#'
#' @description `r lifecycle::badge("experimental")`\cr
#' Abstract data type that stores and returns any number of elements.
#'
#' @details
#' A `Queue` object stores all elements in a single vector,
#' thus all data types can be stored, but silent coercion may occur.
#'
#' Elements are returned in the same order that they were added.
#'
#' @name Queue
#' @keywords internal
#'
Queue <- R6::R6Class( # nolint
Queue <- R6::R6Class( # nolint: object_name_linter.
classname = "Queue",
# public methods ----
public = list(
#' @description
#' Adds element(s) to `Queue`.
#'
#' @param new_elements vector of elements to add
#' @param new_elements vector of elements to add.
#'
#' @return self invisibly
#' @return `self`, invisibly.
#'
push = function(new_elements) {
for (i in seq_along(new_elements)) {
Expand All @@ -34,16 +39,16 @@ Queue <- R6::R6Class( # nolint
#' @description
#' Returns all contents of the `Queue` object.
#'
#' @return single vector containing all `Queue` contents
#' @return Single vector containing all `Queue` contents.
#'
get = function() {
private$array
},
#' @description
#' Returns the first (oldest) element of the `Queue` and removes it.
#'
#' @return
#' vector of length 1 containing the first element of `Queue` or NULL if `Queue` is empty
#' @return vector of length 1 containing the first element of `Queue`
#' or `NULL` if `Queue` is empty.
#'
pop = function() {
returned_element <- self$get()[1L]
Expand All @@ -54,9 +59,9 @@ Queue <- R6::R6Class( # nolint
#' Removes the oldest occurrence of specified element(s) from `Queue`.
#' Relies on implicit type conversions of R identify elements to remove.
#'
#' @param elements vector of elements to remove from `Queue`
#' @param elements vector of elements to remove from `Queue`.
#'
#' @return self invisibly
#' @return `self`, invisibly.
#'
remove = function(elements) {
for (el in elements) {
Expand All @@ -68,7 +73,7 @@ Queue <- R6::R6Class( # nolint
#' @description
#' Removes all elements from `Queue`.
#'
#' @return self invisibly
#' @return `self`, invisibly.
#'
empty = function() {
private$array <- c()
Expand All @@ -77,17 +82,17 @@ Queue <- R6::R6Class( # nolint
#' @description
#' Returns the number of elements in `Queue`.
#'
#' @return integer of length 1
#' @return `integer(1)`.
#'
size = function() {
length(self$get())
},
#' @description
#' Prints this `Queue`.
#'
#' @param ... additional arguments to this method, ignored
#' @param ... Additional arguments to this method, ignored.
#'
#' @return invisibly self
#' @return `self`, invisibly.
print = function(...) {
cat(
sprintf(
Expand Down
12 changes: 8 additions & 4 deletions R/all_choices.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#' An S3 structure representing the selection of all
#' possible choices in a `filter_spec`, `select_spec` or `choices_selected` object.
#' Bare constructor for `all_choices` object
#'
#' @description `r lifecycle::badge("experimental")`
#' @description
#' `r lifecycle::badge("experimental")`
#'
#' @return `all_choices` object
#' An S3 structure representing the selection of all possible choices in a
#' `filter_spec`, `select_spec` or `choices_selected` object.
#'
#' @return `all_choices` object.
#'
#' @examples
#' # Both structures are semantically identical
Expand All @@ -22,6 +25,7 @@
#' choices_selected(choices = letters, selected = letters)
#' choices_selected(choices = letters, selected = all_choices())
#' @export
#'
all_choices <- function() {
structure(list(), class = "all_choices")
}
Loading

0 comments on commit f3c05c6

Please sign in to comment.