Skip to content

Commit 034cc94

Browse files
authored
Merge pull request #82 from ropensci-org/gert
some updates
2 parents 37e7da3 + 7847944 commit 034cc94

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+4314
-1341
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515
^dev$
1616
^docs$
1717
^\.github$
18+
^\.lintr$

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

Lines changed: 23 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
1-
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
2-
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
33
on:
44
push:
5-
branches:
6-
- main
7-
- master
5+
branches: [main, master]
86
pull_request:
9-
branches:
10-
- main
11-
- master
12-
schedule:
13-
- cron: '0 0 * * *'
147

15-
name: R-CMD-check
8+
name: R-CMD-check.yaml
9+
10+
permissions: read-all
1611

1712
jobs:
1813
R-CMD-check:
@@ -24,70 +19,33 @@ jobs:
2419
fail-fast: false
2520
matrix:
2621
config:
22+
- {os: macos-latest, r: 'release'}
2723
- {os: windows-latest, r: 'release'}
28-
- {os: macOS-latest, r: 'release'}
29-
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
30-
- {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
24+
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
25+
- {os: ubuntu-latest, r: 'release'}
26+
- {os: ubuntu-latest, r: 'oldrel-1'}
3127

3228
env:
33-
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
34-
RSPM: ${{ matrix.config.rspm }}
3529
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
30+
R_KEEP_PKG_SOURCE: yes
3631

3732
steps:
38-
- uses: actions/checkout@v2
33+
- uses: actions/checkout@v4
34+
35+
- uses: r-lib/actions/setup-pandoc@v2
3936

40-
- uses: r-lib/actions/setup-r@v1
37+
- uses: r-lib/actions/setup-r@v2
4138
with:
4239
r-version: ${{ matrix.config.r }}
40+
http-user-agent: ${{ matrix.config.http-user-agent }}
41+
use-public-rspm: true
4342

44-
- uses: r-lib/actions/setup-pandoc@v1
45-
46-
- name: Query dependencies
47-
run: |
48-
install.packages('remotes')
49-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
50-
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
51-
shell: Rscript {0}
52-
53-
- name: Restore R package cache
54-
if: runner.os != 'Windows'
55-
uses: actions/cache@v2
43+
- uses: r-lib/actions/setup-r-dependencies@v2
5644
with:
57-
path: ${{ env.R_LIBS_USER }}
58-
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
59-
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
60-
61-
- name: Install system dependencies
62-
if: runner.os == 'Linux'
63-
run: |
64-
while read -r cmd
65-
do
66-
eval sudo $cmd
67-
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
68-
69-
- name: Install dependencies
70-
run: |
71-
remotes::install_deps(dependencies = TRUE)
72-
remotes::install_cran("rcmdcheck")
73-
shell: Rscript {0}
74-
75-
- name: Configure Git user
76-
run: |
77-
git config --global user.email "ghau@example.com"
78-
git config --global user.name "GitHub Actions User"
79-
80-
- name: Check
81-
env:
82-
_R_CHECK_CRAN_INCOMING_REMOTE_: false
83-
run: |
84-
options(crayon.enabled = TRUE)
85-
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
86-
shell: Rscript {0}
45+
extra-packages: any::rcmdcheck
46+
needs: check
8747

88-
- name: Upload check results
89-
if: failure()
90-
uses: actions/upload-artifact@main
48+
- uses: r-lib/actions/check-r-package@v2
9149
with:
92-
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
93-
path: check
50+
upload-snapshots: true
51+
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
on:
4+
pull_request:
5+
6+
name: lint-changed-files.yaml
7+
8+
permissions: read-all
9+
10+
jobs:
11+
lint-changed-files:
12+
runs-on: ubuntu-latest
13+
env:
14+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: r-lib/actions/setup-r@v2
19+
20+
- uses: r-lib/actions/setup-r-dependencies@v2
21+
with:
22+
extra-packages: |
23+
any::gh
24+
any::lintr
25+
any::purrr
26+
needs: check
27+
28+
- name: Add lintr options
29+
run: |
30+
cat('\noptions(lintr.linter_file = ".lintr")\n', file = "~/.Rprofile", append = TRUE)
31+
shell: Rscript {0}
32+
33+
- name: Install package
34+
run: R CMD INSTALL .
35+
36+
- name: Extract and lint files changed by this PR
37+
run: |
38+
files <- gh::gh("GET https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files")
39+
changed_files <- purrr::map_chr(files, "filename")
40+
all_files <- list.files(recursive = TRUE)
41+
exclusions_list <- as.list(setdiff(all_files, changed_files))
42+
lintr::lint_package(exclusions = exclusions_list)
43+
shell: Rscript {0}
44+
env:
45+
LINTR_ERROR_ON_LINT: true
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
8+
name: test-coverage.yaml
9+
10+
permissions: read-all
11+
12+
jobs:
13+
test-coverage:
14+
runs-on: ubuntu-latest
15+
env:
16+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- uses: r-lib/actions/setup-r@v2
22+
with:
23+
use-public-rspm: true
24+
25+
- uses: r-lib/actions/setup-r-dependencies@v2
26+
with:
27+
extra-packages: any::covr, any::xml2
28+
needs: coverage
29+
30+
- name: Test coverage
31+
run: |
32+
cov <- covr::package_coverage(
33+
quiet = FALSE,
34+
clean = FALSE,
35+
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
36+
)
37+
covr::to_cobertura(cov)
38+
shell: Rscript {0}
39+
40+
- uses: codecov/codecov-action@v4
41+
with:
42+
# Fail if error if not on PR, or if on PR and token is given
43+
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
44+
file: ./cobertura.xml
45+
plugin: noop
46+
disable_search: true
47+
token: ${{ secrets.CODECOV_TOKEN }}
48+
49+
- name: Show testthat output
50+
if: always()
51+
run: |
52+
## --------------------------------------------------------------------
53+
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
54+
shell: bash
55+
56+
- name: Upload test results
57+
if: failure()
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: coverage-test-failures
61+
path: ${{ runner.temp }}/package

.lintr

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
linters: lintr::linters_with_tags(tags = NULL)
2+
encoding: "UTF-8"
3+
exclusions: list(
4+
# excluded from all lints:
5+
"inst/examples/example-review-index.Rmd",
6+
"tests/testthat.R",
7+
"vignettes/editors.Rmd",
8+
"vignettes/pkgreviewr.Rmd"
9+
)

DESCRIPTION

Lines changed: 35 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,46 @@
1-
Package: pkgreviewr
21
Type: Package
2+
Package: pkgreviewr
33
Title: rOpenSci package review project template
4-
Version: 0.3.1
5-
Authors@R: c(person("Anna", "Krystalli", email = "annakrystalli@googlemail.com",
6-
role = c("aut", "cre")),
7-
person("Maëlle", "Salmon", email = "maelle.salmon@yahoo.se", role = "aut"))
8-
Description: Creates files and collects materials necessary to complete an rOpenSci package review.
9-
Review files are prepopulated with review package specific metadata. Review package source code is
10-
also cloned for local testing and inspection.
4+
Version: 0.3.9999
5+
Authors@R: c(
6+
person("Anna", "Krystalli", , "annakrystalli@googlemail.com", role = c("aut"),
7+
comment = c(ORCID = "0000-0002-2378-4915", "Created the package")),
8+
person("Maëlle", "Salmon", , "maelle@ropensci.org", role = c("aut", "cre"),
9+
comment = c(ORCID = "0000-0002-2815-0399"))
10+
)
11+
Description: Creates files and collects materials necessary to complete an
12+
rOpenSci package review. Review files are prepopulated with review
13+
package specific metadata. Review package source code is also cloned
14+
for local testing and inspection.
1115
License: GPL (>= 3)+ file LICENSE
12-
URL: https://github.com/ropensci-org/pkgreviewr
16+
URL: https://docs.ropensci.org/pkgreviewr/, https://github.com/ropensci-org/pkgreviewr
1317
BugReports: https://github.com/ropensci-org/pkgreviewr/issues
14-
Encoding: UTF-8
15-
LazyData: true
16-
Imports:
17-
devtools,
18-
git2r (>= 0.23.0),
19-
usethis (>= 1.2.0),
20-
here,
21-
reprex,
22-
gh,
23-
base64enc,
24-
magrittr,
25-
covr,
26-
goodpractice,
18+
Imports:
2719
assertthat,
28-
httr,
29-
rstudioapi,
30-
clipr,
31-
clisymbols,
32-
crayon,
33-
dplyr,
34-
glue,
20+
brio,
21+
cli,
22+
curl,
23+
desc,
3524
fs (>= 1.3.1),
36-
shiny,
37-
withr,
38-
spelling,
39-
emo
25+
gert,
26+
gh,
27+
glue,
28+
magrittr,
29+
rlang,
30+
usethis,
31+
withr
4032
Suggests:
41-
testthat,
42-
mockery,
4333
knitr,
34+
mockery,
35+
mockthat,
4436
rmarkdown,
45-
mockthat
46-
RoxygenNote: 7.1.2
37+
testthat (>= 3.0.0)
38+
VignetteBuilder:
39+
knitr
4740
Remotes:
48-
hadley/emo,
49-
mangoTheCat/goodpractice
50-
VignetteBuilder: knitr
41+
hadley/emo
42+
Config/testthat/edition: 3
43+
Encoding: UTF-8
44+
LazyData: true
5145
Roxygen: list(markdown = TRUE)
52-
Date: 2021-08-12
46+
RoxygenNote: 7.3.2.9000

NAMESPACE

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ export(pkgreview_create)
44
export(pkgreview_getdata)
55
export(pkgreview_index_rmd)
66
export(pkgreview_init)
7-
export(pkgreview_print_source)
87
export(pkgreview_readme_md)
98
export(pkgreview_request)
109
export(render_request)
1110
export(try_whoami)
1211
export(use_onboarding_tmpl)
13-
importFrom(magrittr,"%>%")
12+
importFrom(rlang,"%||%")

0 commit comments

Comments
 (0)