Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/skills/create-issue/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ If `gh` is not authenticated, stop and ask the user to authenticate before conti

## Looking up IDs

The hardcoded IDs below are correct for this repo as of 2026-04-28 13:47:49 UTC. If they ever change, or if you're working in a fork, re-run these queries to get fresh values:
The hardcoded IDs below are correct for this repo as of 2026-05-15 13:34:15 UTC. If they ever change, or if you're working in a fork, re-run these queries to get fresh values:

```bash
# Repository node ID
Expand Down
6 changes: 3 additions & 3 deletions .github/skills/r-code/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Guide for writing R code. Use when writing new functions, designing

# R code

This skill covers how to design and write R functions — including naming conventions, signatures, API conventions, input validation, error handling, and common pitfalls. For documenting functions, use the `document` skill. For tests, use the `tdd-workflow` skill.
This skill covers how to design and write R functions — including naming conventions, signatures, API conventions, input validation, condition handling, and common pitfalls. For documenting functions, use the `document` skill. For tests, use the `tdd-workflow` skill.

## Naming conventions

Expand Down Expand Up @@ -184,9 +184,9 @@ Keep a function internal when:

Internal helpers use a dot prefix (e.g. `.parse_response()`).

## Error handling
## Condition handling

Use `.pkg_abort()` (defined in `R/aaa-conditions.R`) rather than calling `cli::cli_abort()` directly. This wraps `stbl::pkg_abort()` and ensures consistent error class formatting:
Use `.pkg_abort()`, `.pkg_warn()`, and `.pkg_inform()` (defined in `R/aaa-conditions.R`) rather than calling `cli::cli_abort()`, `cli::cli_warn()`, or `cli::cli_inform()` directly. These wrap `stbl` condition helpers and ensure consistent class formatting:

```r
.pkg_abort(
Expand Down
27 changes: 25 additions & 2 deletions .github/skills/tdd-workflow/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,31 @@ test_that("process_data() errors on empty input (#42)", {
})
```

Pass `transform = stbl::.transform_path(path)` to scrub volatile values (e.g. temp
paths) from the snapshot before comparison.
**Warnings thrown by this package** (via `.pkg_warn()`) should be tested with
`stbl::expect_pkg_warning_snapshot()`:

```r
test_that("process_data() warns on dropped rows (#42)", {
stbl::expect_pkg_warning_snapshot(
process_data(data.frame(value = c(1, NA))),
"rapid",
"dropped_rows"
)
})
```

**Messages thrown by this package** (via `.pkg_inform()`) should be tested with
`stbl::expect_pkg_message_snapshot()`:

```r
test_that("process_data() informs on defaults used (#42)", {
stbl::expect_pkg_message_snapshot(
process_data(data.frame(value = 1)),
"rapid",
"used_defaults"
)
})
```

**Errors thrown by `stbl`** (via `stbl::to_*()` / `stbl::stabilize_*()`)
should be tested with `stbl::expect_pkg_error_classes()`. Since the message
Expand Down
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Imports:
rlang (>= 1.1.0),
S7 (>= 0.2.0),
snakecase,
stbl (>= 0.3.0),
stbl (>= 0.3.0.9000),
tibble,
tibblify (>= 0.4.0),
xml2,
Expand All @@ -33,8 +33,8 @@ Suggests:
httr2,
testthat (>= 3.0.0)
Remotes:
stbl=wranglezone/stbl,
tibblify=wranglezone/tibblify
wranglezone/stbl,
wranglezone/tibblify
Config/roxygen2/version: 8.0.0
Config/testthat/edition: 3
Config/testthat/parallel: true
Expand Down
58 changes: 55 additions & 3 deletions R/aaa-conditions.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' Raise a package-scoped error
#' Signal a package-scoped error
#'
#' @inheritParams .shared-params
#' @inheritParams stbl::pkg_abort
Expand All @@ -7,8 +7,9 @@
.pkg_abort <- function(
message,
subclass,
call = rlang::caller_env(),
message_env = rlang::caller_env(),
parent = NULL,
call = caller_env(),
message_env = caller_env(),
...
) {
stbl::pkg_abort(
Expand All @@ -17,6 +18,57 @@
subclass,
call = call,
message_env = message_env,
parent = parent,
...
)
}

#' Signal a package-scoped warning
#'
#' @inheritParams .shared-params
#' @inheritParams stbl::pkg_warn
#' @returns `NULL`, invisibly (called for warning side effect).
#' @keywords internal
.pkg_warn <- function(
message,
subclass,
parent = NULL,
call = caller_env(),
message_env = caller_env(),
...
) {
stbl::pkg_warn(
"rapid",
message,
subclass,
call = call,
message_env = message_env,
parent = parent,
...
)
}

#' Signal a package-scoped message
#'
#' @inheritParams .shared-params
#' @inheritParams stbl::pkg_inform
#' @returns `NULL`, invisibly (called for warning side effect).
#' @keywords internal
.pkg_inform <- function(
message,
subclass,
parent = NULL,
call = caller_env(),
message_env = caller_env(),
...
) {
stbl::pkg_inform(
"rapid",
message,
subclass,
call = call,
message_env = message_env,
parent = parent,
...
)
}
12 changes: 8 additions & 4 deletions man/dot-pkg_abort.Rd

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

40 changes: 40 additions & 0 deletions man/dot-pkg_inform.Rd

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

40 changes: 40 additions & 0 deletions man/dot-pkg_warn.Rd

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

Loading