Skip to content

Commit 88769f2

Browse files
topepomarlycormar‘topepo’
authored
2023 spring cleaning (#35)
* pkgdown and GHA updates * usethis::use_tidy_style() * usethis::use_tidy_description() * regenerate snapshots with newer rlang * rstudio -> posit, fix urls * re-regenerate snapshots * move imports to package docs * udpate testthat and other pkg version * update imports * retrigger checks * update GHA --------- Co-authored-by: Marly Gotti <marlygotti@gmail.com> Co-authored-by: ‘topepo’ <‘mxkuhn@gmail.com’>
1 parent b0321ec commit 88769f2

32 files changed

+254
-191
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@
1212
^CODE_OF_CONDUCT\.md$
1313
^\.github$
1414
^codecov\.yml$
15+
^README\.Rmd$

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ jobs:
3333
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
3434
- {os: ubuntu-latest, r: 'release'}
3535
- {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'}
3639

3740
env:
3841
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pkgdown.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ on:
44
push:
55
branches: [main, master]
66
pull_request:
7-
branches: [main, master]
87
release:
98
types: [published]
109
workflow_dispatch:
1110

12-
name: pkgdown
11+
name: pkgdown.yaml
12+
13+
permissions: read-all
1314

1415
jobs:
1516
pkgdown:
@@ -19,8 +20,10 @@ jobs:
1920
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
2021
env:
2122
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
23+
permissions:
24+
contents: write
2225
steps:
23-
- uses: actions/checkout@v3
26+
- uses: actions/checkout@v4
2427

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

@@ -39,7 +42,7 @@ jobs:
3942

4043
- name: Deploy to GitHub pages 🚀
4144
if: github.event_name != 'pull_request'
42-
uses: JamesIves/github-pages-deploy-action@v4.4.1
45+
uses: JamesIves/github-pages-deploy-action@v4.5.0
4346
with:
4447
clean: false
4548
branch: gh-pages

.github/workflows/pr-commands.yaml

Lines changed: 9 additions & 3 deletions
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

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ on:
44
push:
55
branches: [main, master]
66
pull_request:
7-
branches: [main, master]
87

9-
name: test-coverage
8+
name: test-coverage.yaml
9+
10+
permissions: read-all
1011

1112
jobs:
1213
test-coverage:
@@ -15,36 +16,47 @@ jobs:
1516
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1617

1718
steps:
18-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
1920

2021
- uses: r-lib/actions/setup-r@v2
2122
with:
2223
use-public-rspm: true
2324

2425
- uses: r-lib/actions/setup-r-dependencies@v2
2526
with:
26-
extra-packages: any::covr
27+
extra-packages: any::covr, any::xml2
2728
needs: coverage
2829

2930
- name: Test coverage
3031
run: |
31-
covr::codecov(
32+
cov <- covr::package_coverage(
3233
quiet = FALSE,
3334
clean = FALSE,
34-
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
35+
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
3536
)
37+
print(cov)
38+
covr::to_cobertura(cov)
3639
shell: Rscript {0}
3740

41+
- uses: codecov/codecov-action@v5
42+
with:
43+
# Fail if error if not on PR, or if on PR and token is given
44+
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
45+
files: ./cobertura.xml
46+
plugins: noop
47+
disable_search: true
48+
token: ${{ secrets.CODECOV_TOKEN }}
49+
3850
- name: Show testthat output
3951
if: always()
4052
run: |
4153
## --------------------------------------------------------------------
42-
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
54+
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
4355
shell: bash
4456

4557
- name: Upload test results
4658
if: failure()
47-
uses: actions/upload-artifact@v3
59+
uses: actions/upload-artifact@v4
4860
with:
4961
name: coverage-test-failures
5062
path: ${{ runner.temp }}/package

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
.Rproj.user
44
.DS_Store
55
inst/doc
6+
docs

DESCRIPTION

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Version: 0.0.1.1
44
Authors@R: c(
55
person("Marly", "Gotti", , "marlygotti@gmail.com", role = c("aut", "cre")),
66
person("Max", "Kuhn", , "max@posit.co", role = "aut"),
7-
person(given = "Posit Software, PBC", role = c("cph", "fnd"))
7+
person("Posit Software, PBC", role = c("cph", "fnd"))
88
)
99
Description: A modeling package compiling applicability domain methods in
1010
R. It combines different methods to measure the amount of
@@ -17,15 +17,15 @@ URL: https://github.com/tidymodels/applicable,
1717
BugReports: https://github.com/tidymodels/applicable/issues
1818
Depends:
1919
ggplot2,
20-
R (>= 3.4)
20+
R (>= 3.6)
2121
Imports:
2222
dplyr,
2323
glue,
24-
hardhat (>= 0.1.2),
24+
hardhat (>= 1.3.0),
2525
Matrix,
2626
proxyC,
2727
purrr,
28-
rlang,
28+
rlang (>= 1.1.1),
2929
stats,
3030
tibble,
3131
tidyr,
@@ -35,17 +35,17 @@ Suggests:
3535
covr,
3636
knitr,
3737
modeldata,
38-
recipes (>= 0.1.7),
38+
recipes (>= 1.0.8),
3939
rmarkdown,
4040
spelling,
41-
testthat (>= 3.0.0),
41+
testthat (>= 3.2.0),
4242
xml2
4343
VignetteBuilder:
4444
knitr
45+
Config/Needs/website: tidyverse/tidytemplate
46+
Config/testthat/edition: 3
4547
Encoding: UTF-8
4648
Language: en-US
4749
LazyData: true
4850
Roxygen: list(markdown = TRUE)
4951
RoxygenNote: 7.2.3
50-
Config/Needs/website: tidyverse/tidytemplate
51-
Config/testthat/edition: 3

NAMESPACE

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export(autoplot.apd_pca)
3131
export(autoplot.apd_similarity)
3232
export(score)
3333
export(score.default)
34+
import(rlang)
3435
importFrom(Matrix,Matrix)
3536
importFrom(Matrix,colSums)
3637
importFrom(dplyr,"%>%")
@@ -59,9 +60,6 @@ importFrom(hardhat,validate_prediction_size)
5960
importFrom(proxyC,simil)
6061
importFrom(purrr,map2_dfc)
6162
importFrom(purrr,map_dfc)
62-
importFrom(rlang,abort)
63-
importFrom(rlang,arg_match)
64-
importFrom(rlang,enquos)
6563
importFrom(stats,approx)
6664
importFrom(stats,ecdf)
6765
importFrom(stats,prcomp)

R/0.R

Lines changed: 0 additions & 47 deletions
This file was deleted.

R/applicable-package.R

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,50 @@
11
#' @keywords internal
22
"_PACKAGE"
33

4-
# The following block is used by usethis to automatically manage
5-
# roxygen namespace tags. Modify with care!
64
## usethis namespace: start
5+
6+
#' @import rlang
7+
#' @importFrom dplyr %>%
8+
#' @importFrom dplyr count
9+
#' @importFrom dplyr group_by
10+
#' @importFrom dplyr matches
11+
#' @importFrom dplyr mutate
12+
#' @importFrom dplyr mutate_all
13+
#' @importFrom dplyr rename_all
14+
#' @importFrom dplyr sample_n
15+
#' @importFrom dplyr select
16+
#' @importFrom dplyr slice
17+
#' @importFrom dplyr starts_with
18+
#' @importFrom dplyr ungroup
19+
#' @importFrom ggplot2 ggplot geom_step xlab ylab aes autoplot
20+
#' @importFrom glue glue
21+
#' @importFrom hardhat forge
22+
#' @importFrom hardhat mold
23+
#' @importFrom hardhat new_model
24+
#' @importFrom hardhat validate_prediction_size
25+
#' @importFrom Matrix Matrix colSums
26+
#' @importFrom proxyC simil
27+
#' @importFrom purrr map_dfc
28+
#' @importFrom purrr map2_dfc
29+
#' @importFrom stats approx
30+
#' @importFrom stats ecdf
31+
#' @importFrom stats prcomp
32+
#' @importFrom stats predict
33+
#' @importFrom stats quantile
34+
#' @importFrom stats setNames
35+
#' @importFrom tibble as_tibble
36+
#' @importFrom tibble tibble
37+
#' @importFrom tidyr gather
38+
#' @importFrom tidyselect vars_select
39+
#' @importFrom utils globalVariables
740
## usethis namespace: end
41+
42+
# ------------------------------------------------------------------------------
43+
# global variable" check
44+
# nocov
45+
# nocov end
46+
# Reduce false positives when R CMD check runs its "no visible binding for
47+
utils::globalVariables(
48+
c("cumulative", "n", "sim", "percentile", "component", "value")
49+
)
850
NULL

0 commit comments

Comments
 (0)