Skip to content

Commit 737a513

Browse files
authored
Upkeep 2026-05 (#680)
* `use_tidy_github_actions()` * `use_tidy_description()` * `use_claude_code()` * Test upkeep
1 parent d683435 commit 737a513

11 files changed

Lines changed: 70 additions & 28 deletions

File tree

.claude/CLAUDE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ air format .
4444
- All new code should have an accompanying test.
4545
- If there are existing tests, place new tests next to similar existing tests.
4646
- Strive to keep your tests minimal with few comments.
47+
- Avoid `expect_true()` and `expect_false()` in favour of a specific expectation which will give a better failure message. A few expectations in newer releases that you might not know about are `expect_all_true()`, `expect_all_equal()`, and `expect_r6_class()`.
48+
- When testing errors and warnings, don't us `expect_error()` or `expect_warning()`. Instead, use `expect_snapshot(error = TRUE)` for errors and `expect_snapshot()` for warnings because these allow the user to review the full text of the output.
49+
- Avoid the `.package` argument to `local_mocked_bindings()`; this modifies the namespace of another package which is not good practice. Instead create a mockable version of the function in the current package. See `?local_mocked_bindings` for more details.
4750

4851
### Documentation
4952

.claude/settings.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2+
"$schema": "https://json.schemastore.org/claude-code-settings.json",
23
"permissions": {
3-
"$schema": "https://json.schemastore.org/claude-code-settings.json",
44
"defaultMode": "acceptEdits",
55
"allow": [
66
"Bash(air:*)",
@@ -18,13 +18,13 @@
1818
"Bash(rm:*)",
1919
"Bash(Rscript:*)",
2020
"Bash(sed:*)",
21-
"Skill(*)",
21+
"Skill",
2222
"WebFetch(domain:cran.r-project.org)",
2323
"WebFetch(domain:github.com)",
2424
"WebFetch(domain:raw.githubusercontent.com)"
2525
],
2626
"deny": [
27-
"Read(.Renviron)",
27+
"Read(.Renviron)",
2828
"Read(.env)"
2929
]
3030
}

.github/workflows/R-CMD-check.yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@ jobs:
2424
matrix:
2525
config:
2626
- {os: macos-latest, r: 'release'}
27-
2827
- {os: windows-latest, r: 'release'}
29-
# use 4.0 or 4.1 to check with rtools40's older compiler
30-
- {os: windows-latest, r: 'oldrel-4'}
31-
3228
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
3329
- {os: ubuntu-latest, r: 'release'}
3430
- {os: ubuntu-latest, r: 'oldrel-1'}
@@ -41,15 +37,14 @@ jobs:
4137
R_KEEP_PKG_SOURCE: yes
4238

4339
steps:
44-
- uses: actions/checkout@v4
40+
- uses: actions/checkout@v6
4541

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

4844
- uses: r-lib/actions/setup-r@v2
4945
with:
5046
r-version: ${{ matrix.config.r }}
5147
http-user-agent: ${{ matrix.config.http-user-agent }}
52-
use-public-rspm: true
5348

5449
- uses: r-lib/actions/setup-r-dependencies@v2
5550
with:
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Workflow derived from https://github.com/posit-dev/setup-air/tree/main/examples
2+
3+
on:
4+
# Using `pull_request_target` over `pull_request` for elevated `GITHUB_TOKEN`
5+
# privileges, otherwise we can't set `pull-requests: write` when the pull
6+
# request comes from a fork, which is our main use case (external contributors).
7+
#
8+
# `pull_request_target` runs in the context of the target branch (`main`, usually),
9+
# rather than in the context of the pull request like `pull_request` does. Due
10+
# to this, we must explicitly checkout `ref: ${{ github.event.pull_request.head.sha }}`.
11+
# This is typically frowned upon by GitHub, as it exposes you to potentially running
12+
# untrusted code in a context where you have elevated privileges, but they explicitly
13+
# call out the use case of reformatting and committing back / commenting on the PR
14+
# as a situation that should be safe (because we aren't actually running the untrusted
15+
# code, we are just treating it as passive data).
16+
# https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/
17+
pull_request_target:
18+
19+
name: format-suggest.yaml
20+
21+
jobs:
22+
format-suggest:
23+
name: format-suggest
24+
runs-on: ubuntu-latest
25+
26+
permissions:
27+
# Required to push suggestion comments to the PR
28+
pull-requests: write
29+
30+
steps:
31+
- uses: actions/checkout@v4
32+
with:
33+
ref: ${{ github.event.pull_request.head.sha }}
34+
35+
- name: Install
36+
uses: posit-dev/setup-air@v1
37+
38+
- name: Format
39+
run: air format .
40+
41+
- name: Suggest
42+
uses: reviewdog/action-suggester@v1
43+
with:
44+
level: error
45+
fail_level: error
46+
tool_name: air

.github/workflows/pkgdown.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,11 @@ jobs:
2323
permissions:
2424
contents: write
2525
steps:
26-
- uses: actions/checkout@v4
26+
- uses: actions/checkout@v6
2727

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

3030
- uses: r-lib/actions/setup-r@v2
31-
with:
32-
use-public-rspm: true
3331

3432
- uses: r-lib/actions/setup-r-dependencies@v2
3533
with:
@@ -42,7 +40,7 @@ jobs:
4240

4341
- name: Deploy to GitHub pages 🚀
4442
if: github.event_name != 'pull_request'
45-
uses: JamesIves/github-pages-deploy-action@v4.5.0
43+
uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0
4644
with:
4745
clean: false
4846
branch: gh-pages

.github/workflows/test-coverage.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@ jobs:
1616
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1717

1818
steps:
19-
- uses: actions/checkout@v4
19+
- uses: actions/checkout@v6
2020

2121
- uses: r-lib/actions/setup-r@v2
22-
with:
23-
use-public-rspm: true
2422

2523
- uses: r-lib/actions/setup-r-dependencies@v2
2624
with:
@@ -38,7 +36,7 @@ jobs:
3836
covr::to_cobertura(cov)
3937
shell: Rscript {0}
4038

41-
- uses: codecov/codecov-action@v5
39+
- uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6
4240
with:
4341
# Fail if error if not on PR, or if on PR and token is given
4442
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
@@ -56,7 +54,7 @@ jobs:
5654

5755
- name: Upload test results
5856
if: failure()
59-
uses: actions/upload-artifact@v4
57+
uses: actions/upload-artifact@v7
6058
with:
6159
name: coverage-test-failures
6260
path: ${{ runner.temp }}/package

DESCRIPTION

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ Imports:
2626
jsonlite,
2727
lifecycle,
2828
methods,
29+
nanoparquet (>= 0.3.1),
2930
prettyunits,
3031
rlang (>= 1.1.0),
31-
tibble,
32-
nanoparquet (>= 0.3.1)
32+
tibble
3333
Suggests:
3434
bigrquerystorage (>= 1.2.1),
3535
blob,
@@ -40,16 +40,16 @@ Suggests:
4040
readr,
4141
sodium,
4242
testthat (>= 3.1.5),
43-
wk (>= 0.3.2),
44-
withr
43+
withr,
44+
wk (>= 0.3.2)
4545
LinkingTo:
4646
cli,
4747
cpp11,
4848
rapidjsonr
4949
Config/Needs/website: tidyverse/tidytemplate
5050
Config/testthat/edition: 3
5151
Config/testthat/parallel: TRUE
52-
Config/testthat/start-first: bq-table, dplyr
52+
Config/testthat/start-first: bq-table, dplyr, dbi-connection
5353
Encoding: UTF-8
5454
Roxygen: list(markdown = TRUE)
5555
RoxygenNote: 7.3.3

tests/testthat/_snaps/bq-download.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
Code
1717
. <- bq_table_download(tb, api = "arrow", page_size = 1, start_index = 1,
18-
max_connections = 1)
18+
max_connections = 1, quiet = TRUE)
1919
Condition
2020
Warning in `bq_table_download()`:
2121
`page_size` is ignored when `api == "arrow"`

tests/testthat/test-bq-download.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ test_that("warns if supplying unnused arguments", {
8787
api = "arrow",
8888
page_size = 1,
8989
start_index = 1,
90-
max_connections = 1
90+
max_connections = 1,
91+
quiet = TRUE
9192
)
9293
)
9394
})

tests/testthat/test-bq-job.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
test_that("can control chattiness of bq_job_wait", {
2+
withr::local_options(cli.progress_show_after = Inf)
23
job <- bq_perform_query("SELECT 1 + 1", bq_test_project())
34

45
expect_snapshot({
@@ -8,7 +9,7 @@ test_that("can control chattiness of bq_job_wait", {
89
})
910

1011
test_that("informative errors on failure", {
11-
withr::local_options(cli.progress_show_after = 10)
12+
withr::local_options(cli.progress_show_after = Inf)
1213
ds <- bq_test_dataset()
1314

1415
tb <- bq_test_table()

0 commit comments

Comments
 (0)