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
11 changes: 8 additions & 3 deletions .github/skills/create-issue/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ 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-05-11 21:33:53 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:57:23 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
gh api graphql -f query='{ repository(owner: "jonthegeek", name: "beekeeper") { id } }'
gh api graphql -f query='{ repository(owner: "api2r", name: "beekeeper") { id } }'

# Available issue type IDs
gh api graphql -f query='{ repository(owner: "jonthegeek", name: "beekeeper") { issueTypes(first: 20) { nodes { id name description } } } }'
gh api graphql -f query='{ repository(owner: "api2r", name: "beekeeper") { issueTypes(first: 20) { nodes { id name description } } } }'
```

## Issue type
Expand All @@ -29,6 +29,11 @@ Choose the type that best fits the issue:

| Type | ID | Use for |
|---|---|---|
| Task | `IT_kwDOCPuMJs4BPtRZ` | A specific piece of work |
| Bug | `IT_kwDOCPuMJs4BPtRc` | An unexpected problem or behavior |
| Feature | `IT_kwDOCPuMJs4BPtRe` | A request, idea, or new functionality |
| Documentation | `IT_kwDOCPuMJs4B5OL_` | Explanations of how or why to do things |
| Infrastructure | `IT_kwDOCPuMJs4B5OMn` | Infrastructure of a project, like GitHub Actions |

## Issue title

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))),
"beekeeper",
"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)),
"beekeeper",
"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
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Imports:
rprojroot,
S7,
snakecase,
stbl (>= 0.3.0),
stbl (>= 0.3.0.9000),
stringr,
testthat,
tibble,
Expand All @@ -49,7 +49,8 @@ VignetteBuilder:
knitr
Remotes:
api2r/nectar,
api2r/rapid
api2r/rapid,
wranglezone/stbl
Config/roxygen2/version: 8.0.0
Config/testthat/edition: 3
Encoding: UTF-8
Expand Down
54 changes: 53 additions & 1 deletion 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,6 +7,7 @@
.pkg_abort <- function(
message,
subclass,
parent = NULL,
call = rlang::caller_env(),
message_env = rlang::caller_env(),
...
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 = rlang::caller_env(),
message_env = rlang::caller_env(),
...
) {
stbl::pkg_warn(
"beekeeper",
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 message side effect).
#' @keywords internal
.pkg_inform <- function(
message,
subclass,
parent = NULL,
call = rlang::caller_env(),
message_env = rlang::caller_env(),
...
) {
stbl::pkg_inform(
"beekeeper",
message,
subclass,
call = call,
message_env = message_env,
parent = parent,
...
)
}
8 changes: 6 additions & 2 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