Skip to content

Commit d9c22b6

Browse files
authored
Upkeep 2024-10 (#473)
1 parent fda519e commit d9c22b6

40 files changed

+1601
-120
lines changed

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

+14-13
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ on:
1010
pull_request:
1111
branches: [main, master]
1212

13-
name: R-CMD-check
13+
name: R-CMD-check.yaml
14+
15+
permissions: read-all
1416

1517
jobs:
1618
R-CMD-check:
@@ -25,24 +27,22 @@ jobs:
2527
- {os: macos-latest, r: 'release'}
2628

2729
- {os: windows-latest, r: 'release'}
28-
# Use 3.6 to trigger usage of RTools35
29-
- {os: windows-latest, r: '3.6'}
30-
# use 4.1 to check with rtools40's older compiler
31-
- {os: windows-latest, r: '4.1'}
32-
33-
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
34-
- {os: ubuntu-latest, r: 'release'}
35-
- {os: ubuntu-latest, r: 'oldrel-1'}
36-
- {os: ubuntu-latest, r: 'oldrel-2'}
37-
- {os: ubuntu-latest, r: 'oldrel-3'}
38-
- {os: ubuntu-latest, r: 'oldrel-4'}
30+
# use 4.0 or 4.1 to check with rtools40's older compiler
31+
- {os: windows-latest, r: 'oldrel-4'}
32+
33+
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
34+
- {os: ubuntu-latest, r: 'release'}
35+
- {os: ubuntu-latest, r: 'oldrel-1'}
36+
- {os: ubuntu-latest, r: 'oldrel-2'}
37+
- {os: ubuntu-latest, r: 'oldrel-3'}
38+
- {os: ubuntu-latest, r: 'oldrel-4'}
3939

4040
env:
4141
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
4242
R_KEEP_PKG_SOURCE: yes
4343

4444
steps:
45-
- uses: actions/checkout@v3
45+
- uses: actions/checkout@v4
4646

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

@@ -60,3 +60,4 @@ jobs:
6060
- uses: r-lib/actions/check-r-package@v2
6161
with:
6262
upload-snapshots: true
63+
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'

.github/workflows/pkgdown.yaml

+5-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ on:
99
types: [published]
1010
workflow_dispatch:
1111

12-
name: pkgdown
12+
name: pkgdown.yaml
13+
14+
permissions: read-all
1315

1416
jobs:
1517
pkgdown:
@@ -22,7 +24,7 @@ jobs:
2224
permissions:
2325
contents: write
2426
steps:
25-
- uses: actions/checkout@v3
27+
- uses: actions/checkout@v4
2628

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

@@ -41,7 +43,7 @@ jobs:
4143

4244
- name: Deploy to GitHub pages 🚀
4345
if: github.event_name != 'pull_request'
44-
uses: JamesIves/github-pages-deploy-action@v4.4.1
46+
uses: JamesIves/github-pages-deploy-action@v4.5.0
4547
with:
4648
clean: false
4749
branch: gh-pages

.github/workflows/pr-commands.yaml

+9-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ on:
44
issue_comment:
55
types: [created]
66

7-
name: Commands
7+
name: pr-commands.yaml
8+
9+
permissions: read-all
810

911
jobs:
1012
document:
@@ -13,8 +15,10 @@ jobs:
1315
runs-on: ubuntu-latest
1416
env:
1517
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
18+
permissions:
19+
contents: write
1620
steps:
17-
- uses: actions/checkout@v3
21+
- uses: actions/checkout@v4
1822

1923
- uses: r-lib/actions/pr-fetch@v2
2024
with:
@@ -50,8 +54,10 @@ jobs:
5054
runs-on: ubuntu-latest
5155
env:
5256
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
57+
permissions:
58+
contents: write
5359
steps:
54-
- uses: actions/checkout@v3
60+
- uses: actions/checkout@v4
5561

5662
- uses: r-lib/actions/pr-fetch@v2
5763
with:

.github/workflows/test-coverage.yaml

+17-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ on:
66
pull_request:
77
branches: [main, master]
88

9-
name: test-coverage
9+
name: test-coverage.yaml
10+
11+
permissions: read-all
1012

1113
jobs:
1214
test-coverage:
@@ -15,36 +17,45 @@ jobs:
1517
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1618

1719
steps:
18-
- uses: actions/checkout@v3
20+
- uses: actions/checkout@v4
1921

2022
- uses: r-lib/actions/setup-r@v2
2123
with:
2224
use-public-rspm: true
2325

2426
- uses: r-lib/actions/setup-r-dependencies@v2
2527
with:
26-
extra-packages: any::covr
28+
extra-packages: any::covr, any::xml2
2729
needs: coverage
2830

2931
- name: Test coverage
3032
run: |
31-
covr::codecov(
33+
cov <- covr::package_coverage(
3234
quiet = FALSE,
3335
clean = FALSE,
3436
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
3537
)
38+
covr::to_cobertura(cov)
3639
shell: Rscript {0}
3740

41+
- uses: codecov/codecov-action@v4
42+
with:
43+
fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }}
44+
file: ./cobertura.xml
45+
plugin: noop
46+
disable_search: true
47+
token: ${{ secrets.CODECOV_TOKEN }}
48+
3849
- name: Show testthat output
3950
if: always()
4051
run: |
4152
## --------------------------------------------------------------------
42-
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
53+
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
4354
shell: bash
4455

4556
- name: Upload test results
4657
if: failure()
47-
uses: actions/upload-artifact@v3
58+
uses: actions/upload-artifact@v4
4859
with:
4960
name: coverage-test-failures
5061
path: ${{ runner.temp }}/package

DESCRIPTION

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Package: scales
22
Title: Scale Functions for Visualization
33
Version: 1.3.0.9000
44
Authors@R: c(
5-
person("Hadley", "Wickham", , "[email protected]", role = c("aut")),
5+
person("Hadley", "Wickham", , "[email protected]", role = "aut"),
66
person("Thomas Lin", "Pedersen", , "[email protected]", role = c("cre", "aut"),
77
comment = c(ORCID = "0000-0002-5147-4711")),
88
person("Dana", "Seidel", role = "aut"),
@@ -14,7 +14,7 @@ License: MIT + file LICENSE
1414
URL: https://scales.r-lib.org, https://github.com/r-lib/scales
1515
BugReports: https://github.com/r-lib/scales/issues
1616
Depends:
17-
R (>= 3.6)
17+
R (>= 4.0)
1818
Imports:
1919
cli,
2020
farver (>= 2.0.3),
@@ -35,6 +35,7 @@ Suggests:
3535
testthat (>= 3.0.0)
3636
Config/Needs/website: tidyverse/tidytemplate
3737
Config/testthat/edition: 3
38+
Config/usethis/last-upkeep: 2024-10-24
3839
Encoding: UTF-8
3940
LazyLoad: yes
4041
Roxygen: list(markdown = TRUE, r6 = FALSE)

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
YEAR: 2023
1+
YEAR: 2024
22
COPYRIGHT HOLDER: scales authors

LICENSE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MIT License
22

3-
Copyright (c) 2023 scales authors
3+
Copyright (c) 2024 scales authors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

NAMESPACE

+3
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ S3method(rescale_mid,logical)
4848
S3method(rescale_mid,numeric)
4949
S3method(round_any,POSIXct)
5050
S3method(round_any,numeric)
51+
S3method(toPaletteFunc,"function")
52+
S3method(toPaletteFunc,character)
53+
S3method(toPaletteFunc,matrix)
5154
export(ContinuousRange)
5255
export(DiscreteRange)
5356
export(Range)

R/colour-mapping.R

+3
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ toPaletteFunc <- function(pal, alpha, nlevels) {
318318

319319
# Strings are interpreted as color names, unless length is 1 and it's the name
320320
# of an RColorBrewer palette that is marked as qualitative
321+
#' @export
321322
toPaletteFunc.character <- function(pal, alpha, nlevels) {
322323
if (length(pal) == 1 && pal %in% row.names(RColorBrewer::brewer.pal.info)) {
323324
paletteInfo <- RColorBrewer::brewer.pal.info[pal, ]
@@ -338,11 +339,13 @@ toPaletteFunc.character <- function(pal, alpha, nlevels) {
338339
}
339340

340341
# Accept colorRamp style matrix
342+
#' @export
341343
toPaletteFunc.matrix <- function(pal, alpha, nlevels) {
342344
toPaletteFunc(farver::decode_colour(pal), alpha = alpha)
343345
}
344346

345347
# If a function, just assume it's already a function over [0-1]
348+
#' @export
346349
toPaletteFunc.function <- function(pal, alpha, nlevels) {
347350
pal
348351
}

R/label-number.R

+4-1
Original file line numberDiff line numberDiff line change
@@ -469,14 +469,17 @@ cut_time_scale <- function(space = FALSE) {
469469
out <- c(
470470
0,
471471
"ns" = 1e-9,
472-
"\u03BCs" = 1e-6,
472+
"us" = 1e-6,
473473
"ms" = 1e-3,
474474
"s" = 1,
475475
"m" = 60,
476476
"h" = 3600,
477477
"d" = 24 * 3600,
478478
"w" = 7 * 24 * 3600
479479
)
480+
if (l10n_info()[["UTF-8"]]) {
481+
names(out)[3] <- "\u03BCs"
482+
}
480483
if (space) {
481484
names(out) <- paste0(" ", names(out))
482485
}

0 commit comments

Comments
 (0)