Skip to content

Commit

Permalink
Merge branch 'r-lib:main' into s7
Browse files Browse the repository at this point in the history
  • Loading branch information
olivroy authored Jul 10, 2024
2 parents 6ea8980 + 2fb076e commit 9726cc3
Show file tree
Hide file tree
Showing 108 changed files with 881 additions and 524 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ on:

name: R-CMD-check

permissions: read-all

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}
Expand All @@ -25,24 +27,22 @@ jobs:
- {os: macos-latest, r: 'release'}

- {os: windows-latest, r: 'release'}
# Use 3.6 to trigger usage of RTools35
- {os: windows-latest, r: '3.6'}
# use 4.1 to check with rtools40's older compiler
- {os: windows-latest, r: '4.1'}

- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}
- {os: ubuntu-latest, r: 'oldrel-2'}
- {os: ubuntu-latest, r: 'oldrel-3'}
- {os: ubuntu-latest, r: 'oldrel-4'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}
- {os: ubuntu-latest, r: 'oldrel-2'}
- {os: ubuntu-latest, r: 'oldrel-3'}
- {os: ubuntu-latest, r: 'oldrel-4'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

Expand All @@ -60,3 +60,4 @@ jobs:
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
8 changes: 6 additions & 2 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ on:

name: pkgdown

permissions: read-all

jobs:
pkgdown:
runs-on: ubuntu-latest
Expand All @@ -19,8 +21,10 @@ jobs:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

Expand All @@ -39,7 +43,7 @@ jobs:

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4.4.1
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
clean: false
branch: gh-pages
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/pr-commands.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:

name: Commands

permissions: read-all

jobs:
document:
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/document') }}
Expand All @@ -14,7 +16,7 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/pr-fetch@v2
with:
Expand Down Expand Up @@ -51,7 +53,7 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/pr-fetch@v2
with:
Expand Down
23 changes: 17 additions & 6 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,54 @@ on:

name: test-coverage

permissions: read-all

jobs:
test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr
extra-packages: any::covr, any::xml2
needs: coverage

- name: Test coverage
run: |
covr::codecov(
cov <- covr::package_coverage(
quiet = FALSE,
clean = FALSE,
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
covr::to_cobertura(cov)
shell: Rscript {0}

- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }}
file: ./cobertura.xml
plugin: noop
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ revdep/cloud.noindex
src/config.h
docs/
.vscode
compile_commands.json
.cache
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: rlang
Version: 1.1.3.9000
Version: 1.1.4.9000
Title: Functions for Base Types and Core R and 'Tidyverse' Features
Description: A toolbox for working with base types, core R features
like the condition system, and core 'Tidyverse' features like tidy
Expand Down Expand Up @@ -44,10 +44,11 @@ Suggests:
Enhances:
winch
Encoding: UTF-8
RoxygenNote: 7.2.3
RoxygenNote: 7.3.2
Roxygen: list(markdown = TRUE)
URL: https://rlang.r-lib.org, https://github.com/r-lib/rlang
BugReports: https://github.com/r-lib/rlang/issues
Config/build/compilation-database: true
Config/testthat/edition: 3
Config/Needs/website:
dplyr,
Expand Down
17 changes: 15 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# rlang (development version)

* `env_browse()` and `env_is_browsed()` are now defunct as they require an API
that is no longer available to packages (#1727).

* `env_unlock()` is now defunct because recent versions of R no long
make it possible to unlock an environment (#1705). Make sure to use an
up-to-date version of pkgload (>= 1.4.0) following this change.


# rlang 1.1.4

* Added missing C level `r_dyn_raw_push_back()` and `r_dyn_chr_push_back()`
utilities (#1699).

* `last_trace()` hyperlinks now use the modern `x-r-run` format (#1678).


Expand Down Expand Up @@ -1217,7 +1230,7 @@ extensive changes to the display of error messages.

* Infix operators now stick to their LHS when deparsed by
`expr_deparse()` (#890).


# rlang 0.4.2

Expand Down Expand Up @@ -2002,7 +2015,7 @@ error reporting, tidy eval, and tidy dots.
* `env_get()` now evaluates promises and active bindings since these are
internal objects which should not be exposed at the R level (#554)

* `env_print()` calls `get_env()` on its argument, making it easier to
* `env_print()` calls `get_env()` on its argument, making it easier to
see the environment of closures and quosures (#567).

* `env_get()` now supports retrieving missing arguments when `inherit`
Expand Down
16 changes: 12 additions & 4 deletions R/aaa.R
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ the <- new.env(parent = emptyenv())
#' `on_load()` is implemented via `.onLoad()` and requires
#' `run_on_load()` to be called from that hook.
#'
#' The expressions inside `on_load()` do not undergo static analysis
#' by `R CMD check`. Therefore, it is advisable to only use
#' simple function calls inside `on_load()`.
#'
#' @examples
#' quote({ # Not run
#'
Expand All @@ -79,16 +83,20 @@ the <- new.env(parent = emptyenv())
#' }
#'
#' # Register a method on load
#' on_load(s3_register("foo::bar", "my_class"))
#' on_load({
#' s3_register("foo::bar", "my_class")
#' })
#'
#' # Assign an object on load
#' var <- NULL
#' on_load(
#' on_load({
#' var <- foo()
#' )
#' })
#'
#' # To use `on_package_load()` at top level, wrap it in `on_load()`
#' on_load(on_package_load("foo", message("foo is loaded")))
#' on_load({
#' on_package_load("foo", message("foo is loaded"))
#' })
#'
#' # In functions it can be called directly
#' f <- function() on_package_load("foo", message("foo is loaded"))
Expand Down
22 changes: 22 additions & 0 deletions R/c-lib.R
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,28 @@ dyn_list_poke <- function(x, i, value) {
invisible(.Call(ffi_dyn_list_poke, x, i, value))
}

dyn_lgl_push_back <- function(x, value) {
invisible(.Call(ffi_dyn_lgl_push_back, x, value))
}
dyn_int_push_back <- function(x, value) {
invisible(.Call(ffi_dyn_int_push_back, x, value))
}
dyn_dbl_push_back <- function(x, value) {
invisible(.Call(ffi_dyn_dbl_push_back, x, value))
}
dyn_cpl_push_back <- function(x, value) {
invisible(.Call(ffi_dyn_cpl_push_back, x, value))
}
dyn_raw_push_back <- function(x, value) {
invisible(.Call(ffi_dyn_raw_push_back, x, value))
}
dyn_chr_push_back <- function(x, value) {
invisible(.Call(ffi_dyn_chr_push_back, x, value))
}
dyn_list_push_back <- function(x, value) {
invisible(.Call(ffi_dyn_list_push_back, x, value))
}

# https://github.com/r-lib/rlang/issues/1556
has_size_one_bool <- function() {
.Call(ffi_has_size_one_bool)
Expand Down
2 changes: 1 addition & 1 deletion R/call.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
#' functions that expect symbolic arguments. The objects may also leak
#' in representations of the call stack, such as [traceback()].
#'
#' @seealso call_modify
#' @seealso [call_modify()]
#' @examples
#' # fn can either be a string, a symbol or a call
#' call2("f", a = 1)
Expand Down
11 changes: 11 additions & 0 deletions R/cnd-abort.R
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,17 @@
#' })
#' )
#'
#' # You can also hard-code the call when it's not easy to
#' # forward it from the caller
#' f <- function() {
#' abort("my message", call = call("my_function"))
#' }
#' g <- function() {
#' f()
#' }
#' # Shows that the error occured in `my_function()`
#' try(g())
#'
#' }
#' @export
abort <- function(message = NULL,
Expand Down
3 changes: 3 additions & 0 deletions R/dots-ellipsis.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#' @param env Environment in which to look for `...` and to set up handler.
#' @inheritParams args_error_context
#'
#' @family dots checking functions
#' @details
#' In packages, document `...` with this standard tag:
#'
Expand Down Expand Up @@ -91,6 +92,7 @@ check_dots <- function(env = caller_env(), error, action, call) {
#' fail with an error when named arguments are detected.
#'
#' @inheritParams check_dots_used
#' @family dots checking functions
#' @param env Environment in which to look for `...`.
#' @export
#' @examples
Expand Down Expand Up @@ -139,6 +141,7 @@ check_dots_unnamed <- function(env = caller_env(),
#' @inheritParams check_dots_used
#' @param env Environment in which to look for `...`.
#'
#' @family dots checking functions
#' @details
#' In packages, document `...` with this standard tag:
#'
Expand Down
Loading

0 comments on commit 9726cc3

Please sign in to comment.