Skip to content

Commit

Permalink
Merge pull request #275 from pharmaverse/devel
Browse files Browse the repository at this point in the history
0.4 release (related to admiral 0.11.0)
  • Loading branch information
zdz2101 authored Jun 6, 2023
2 parents c0a814e + 1347b68 commit 355c461
Show file tree
Hide file tree
Showing 78 changed files with 6,821 additions and 1,301 deletions.
12 changes: 11 additions & 1 deletion .Rprofile
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
if (Sys.getenv("GITHUB_ACTIONS") == "" || (Sys.getenv("GITHUB_ACTIONS") == "true" && getRversion()$major == 3 && getRversion()$minor == 6)) {
# Set renv profile base on R version.
if ((Sys.getenv("GITHUB_ACTIONS") == "") && (Sys.getenv("DOCKER_CONTAINER_CONTEXT") == "")) {
renv_profile <- paste(R.version$major, substr(R.version$minor, 1, 1), sep = ".")
if (file.exists("./renv/profile")) {
message("Using renv profile from `renv/profile` file.")
} else if (renv_profile %in% c("4.1", "4.2", "4.3")) {
message("Set renv profile to `", renv_profile, "`")
Sys.setenv("RENV_PROFILE" = renv_profile)
} else {
message("This repository do not contains the renv profile for your R version.")
}
source("renv/activate.R")
} else {
options(repos = c(CRAN = "https://cran.rstudio.com"))
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,25 @@ jobs:
uses: pharmaverse/admiralci/.github/workflows/style.yml@main
if: github.event_name == 'pull_request'
with:
r-version: "4.0"
r-version: "4.1"
spellcheck:
name: Spelling
uses: pharmaverse/admiralci/.github/workflows/spellcheck.yml@main
if: github.event_name == 'pull_request'
with:
r-version: "4.0"
r-version: "4.1"
readme:
name: Render README
uses: pharmaverse/admiralci/.github/workflows/readme-render.yml@main
if: github.event_name == 'push'
with:
r-version: "4.0"
r-version: "4.1"
validation:
name: Validation
uses: pharmaverse/admiralci/.github/workflows/r-pkg-validation.yml@main
if: github.event_name == 'release'
with:
r-version: "4.0"
r-version: "4.1"
check:
name: Check
uses: pharmaverse/admiralci/.github/workflows/r-cmd-check.yml@main
Expand All @@ -73,7 +73,7 @@ jobs:
uses: pharmaverse/admiralci/.github/workflows/pkgdown.yml@main
if: github.event_name == 'push'
with:
r-version: "4.0"
r-version: "4.1"
# Whether to skip multiversion docs
# Note that if you have multiple versions of docs,
# your URL links are likely to break due to path changes
Expand All @@ -85,7 +85,7 @@ jobs:
uses: pharmaverse/admiralci/.github/workflows/lintr.yml@main
if: github.event_name == 'pull_request'
with:
r-version: "4.0"
r-version: "4.1"
links:
name: Links
uses: pharmaverse/admiralci/.github/workflows/links.yml@main
Expand All @@ -97,7 +97,7 @@ jobs:
if: >
github.event_name == 'push' || github.event_name == 'pull_request'
with:
r-version: "4.0"
r-version: "4.1"
# Whether to skip code coverage badge creation
# Setting to 'false' will require you to create
# an orphan branch called 'badges' in your repository
Expand All @@ -107,4 +107,4 @@ jobs:
uses: pharmaverse/admiralci/.github/workflows/man-pages.yml@main
if: github.event_name == 'pull_request'
with:
r-version: "4.0"
r-version: "4.1"
13 changes: 11 additions & 2 deletions .lintr
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
linters: with_defaults(line_length_linter(100), object_usage_linter=NULL, cyclocomp_linter(complexity_limit = 20))
exclusions: list("R/data.R")
linters: linters_with_defaults(
line_length_linter(100),
object_usage_linter=NULL,
cyclocomp_linter(complexity_limit = 20),
undesirable_function_linter = undesirable_function_linter()
)
exclusions: list(
"R/data.R" = Inf,
"inst" = list(undesirable_function_linter = Inf),
"vignettes" = list(undesirable_function_linter = Inf)
)
3 changes: 3 additions & 0 deletions .lycheeignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ tj-actions/[email protected]
file:///home/runner/work/admiraldev/admiraldev/.github/workflows/pkgdown
file:///home/runner/work/admiraldev/admiraldev/.github/workflows/style.yml%60
file:///home/runner/work/admiraldev/admiraldev/.github/workflows/sd-repo
https://packagemanager.posit.co/cran/2021-05-03/
https://packagemanager.posit.co/cran/2022-01-03/
https://packagemanager.posit.co/cran/2023-04-20/
7 changes: 4 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: admiraldev
Type: Package
Title: Utility Functions and Development Tools for the Admiral Package Family
Version: 0.3.0
Version: 0.4.0
Authors@R: c(
person("Ben", "Straub", email = "[email protected]", role = c("aut", "cre")),
person("Stefan", "Bundfuss", role = "aut"),
Expand All @@ -22,15 +22,16 @@ Description: Utility functions to check data, variables and conditions for funct
'admiral' and 'admiral' extension packages. Additional utility helper functions to assist developers
with maintaining documentation, testing and general upkeep of 'admiral' and 'admiral' extension packages.
License: Apache License (>= 2)
BugReports: https://github.com/pharmaverse/admiraldev/issues
URL: https://pharmaverse.github.io/admiraldev/main/, https://github.com/pharmaverse/admiraldev/
Encoding: UTF-8
Language: en-US
LazyData: false
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.1
RoxygenNote: 7.2.3
Depends: R (>= 3.5)
Imports:
dplyr (>= 0.8.4),
dplyr (>= 1.0.5),
hms (>= 0.5.3),
lifecycle (>= 0.1.0),
lubridate (>= 1.7.4),
Expand Down
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export(assert_data_frame)
export(assert_date_var)
export(assert_date_vector)
export(assert_expr)
export(assert_expr_list)
export(assert_filter_cond)
export(assert_function)
export(assert_function_param)
Expand All @@ -20,6 +21,7 @@ export(assert_integer_scalar)
export(assert_list_element)
export(assert_list_of)
export(assert_logical_scalar)
export(assert_named)
export(assert_named_exprs)
export(assert_numeric_vector)
export(assert_one_to_one)
Expand Down
30 changes: 30 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
# admiraldev 0.4.0

## New Features

- New function `assert_named()` to check if all elements of an argument are
named (#241)
- New function `assert_expr_list()` to check if an argument is a list of
expressions (#241)

- Added a **Report a bug** link on `admiraldev` website (#257)

## Updates of Existing Functions

## Breaking Changes

- `assert_order_vars()` was deprecated in favor of `assert_expr_list()`. (#241)
- The following functions have been deprecated from previous admiral versions using the next phase of the deprecation process: (#272)

- `quo_c()`
- `quo_not_missing()`
- `replace_symbol_in_quo()`
- The `quosures` argument was replaced by the `expressions` argument in `replace_values_by_names()`.

## Documentation

- The deprecation strategy was updated regarding unit tests for deprecated
functions/arguments in phase 1. (#247)

- The programming strategy was updated regarding permitted values and calling functions from package dependencies (#72, #253)

# admiraldev 0.3.0

## New Features
Expand Down
3 changes: 1 addition & 2 deletions R/addin_format_testthat.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Returns the call for updating a given test_that test file
# by adding a function name, a test number, and a section.
# Call the function either by using RStudio Addin "format_test_that_file" or
Expand All @@ -13,7 +12,7 @@ prepare_test_that_file <- function(path) {
}

# check that testthat is used and testing file is opened
uses_test_file <- grepl("tests/testthat/test-", path, fixed = T)
uses_test_file <- grepl("tests/testthat/test-", path, fixed = TRUE)
if (!uses_test_file) {
stop("This Addin works only on unit test files that follow a testthat structure.")
}
Expand Down
Loading

0 comments on commit 355c461

Please sign in to comment.