Skip to content

Commit d0b9e54

Browse files
merge from main
2 parents 3e7d414 + a292fa6 commit d0b9e54

15 files changed

+53
-69
lines changed

.github/dependabot.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
3+
updates:
4+
# Keep dependencies for GitHub Actions up-to-date
5+
- package-ecosystem: "github-actions"
6+
directory: "/"
7+
schedule:
8+
interval: "weekly"

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

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,11 @@ jobs:
3434
- {os: windows-latest, r: 'devel', installation_method: 'conda'}
3535

3636
# Linux
37-
- {os: ubuntu-18.04, r: 'release', installation_method: 'pip', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest", http-user-agent: "R/4.0.0 (ubuntu-18.04) R (4.0.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" }
38-
- {os: ubuntu-18.04, r: 'release', installation_method: 'conda', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest", http-user-agent: "R/4.0.0 (ubuntu-18.04) R (4.0.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" }
37+
- {os: ubuntu-latest, r: 'release', installation_method: 'pip', use-public-rspm: true}
38+
- {os: ubuntu-latest, r: 'release', installation_method: 'conda', use-public-rspm: true}
3939

4040
env:
4141
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
42-
RSPM: ${{ matrix.config.rspm }}
4342
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
4443
PRECOMMIT_INSTALLATION_METHOD: ${{ matrix.config.installation_method }}
4544

@@ -52,29 +51,6 @@ jobs:
5251
http-user-agent: ${{ matrix.config.http-user-agent }}
5352

5453
- uses: r-lib/actions/setup-pandoc@v2
55-
56-
- name: Query dependencies
57-
run: |
58-
install.packages('remotes')
59-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
60-
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
61-
shell: Rscript {0}
62-
63-
- name: Restore R package cache
64-
uses: actions/cache@v2
65-
with:
66-
path: ${{ env.R_LIBS_USER }}
67-
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
68-
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
69-
70-
- name: Install system dependencies (Linux)
71-
if: runner.os == 'Linux'
72-
run: |
73-
while read -r cmd
74-
do
75-
eval sudo $cmd
76-
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "18.04"))')
77-
7854
- name: Install system dependencies (brew)
7955
if: matrix.config.installation_method == 'brew'
8056
run: brew install pre-commit
@@ -83,10 +59,9 @@ jobs:
8359
run: |
8460
pip3 install setuptools --user
8561
pip3 install pre-commit --user
86-
- name: Install dependencies
62+
- uses: r-lib/actions/setup-r-dependencies@v2
63+
- name: Remove reticulate for other installation methods
8764
run: |
88-
remotes::install_deps(dependencies = TRUE)
89-
remotes::install_cran("rcmdcheck")
9065
# installation methods other than conda don't need reticulate
9166
if (Sys.getenv("PRECOMMIT_INSTALLATION_METHOD") != 'conda') {
9267
remove.packages('reticulate')
@@ -113,6 +88,7 @@ jobs:
11388
Sys.setenv("_R_CHECK_FORCE_SUGGESTS_" = "False")
11489
}
11590
remotes::install_local() # circumvent https://github.com/r-lib/rcmdcheck/issues/136
91+
install.packages("rcmdcheck")
11692
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
11793
shell: Rscript {0}
11894

.github/workflows/end-to-end.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
shell: Rscript {0}
2626

2727
- name: Cache R packages
28-
uses: actions/cache@v2
28+
uses: actions/cache@v3
2929
with:
3030
path: ${{ env.R_LIBS_USER }}
3131
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}

.github/workflows/hook-dependencies-update.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- uses: r-lib/actions/setup-r@v2
1717

1818
- name: Cache packages
19-
uses: actions/cache@v1
19+
uses: actions/cache@v3
2020
with:
2121
path: ${{ env.RENV_PATHS_ROOT }}
2222
key: renv-${{ hashFiles('**/renv.lock') }}
@@ -35,7 +35,7 @@ jobs:
3535
- name: update dependency graph among packages
3636
run: Rscript inst/update-existing-hook-dependencies.R
3737
- name: Create Pull Request
38-
uses: peter-evans/create-pull-request@v3.9.1
38+
uses: peter-evans/create-pull-request@v5.0.2
3939
with:
4040
commit-message: Update renv dependencies
4141
branch: hook-dependencies-update

.github/workflows/hook-tests-legacy.yml

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
config:
1818
- {os: macOS-latest, r: 'release'}
1919
- {os: windows-latest, r: 'release'}
20-
- {os: ubuntu-18.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest", http-user-agent: "R/4.0.0 (ubuntu-18.04) R (4.0.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" }
20+
- {os: ubuntu-latest, r: 'release', use-public-rspm: true}
2121
env:
2222
RSPM: ${{ matrix.config.rspm }}
2323
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
@@ -27,7 +27,6 @@ jobs:
2727
- uses: r-lib/actions/setup-r@v2
2828
with:
2929
r-version: ${{ matrix.config.r }}
30-
http-user-agent: ${{ matrix.config.http-user-agent }}
3130
- name: checkout old hook scripts
3231
run: |
3332
git fetch origin refs/tags/v0.1.3:refs/tags/v0.1.3
@@ -40,34 +39,26 @@ jobs:
4039
shell: Rscript {0}
4140
- name: Cache R packages (macOs)
4241
if: startsWith(runner.os, 'macOS')
43-
uses: actions/cache@v2
42+
uses: actions/cache@v3
4443
with:
4544
path: ~/Library/Application Support/renv
4645
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('renv.lock') }}
4746
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
4847
- name: Cache R packages (Linux)
4948
if: startsWith(runner.os, 'Linux')
50-
uses: actions/cache@v2
49+
uses: actions/cache@v3
5150
with:
5251
path: ~/.local/share/renv
5352
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('renv.lock') }}
5453
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
5554
- name: Cache R packages (Windows)
5655
if: startsWith(runner.os, 'Windows')
57-
uses: actions/cache@v2
56+
uses: actions/cache@v3
5857
with:
5958
path: ~\AppData\Local\renv
6059
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('renv.lock') }}
6160
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
62-
63-
- name: Install system dependencies (Linux)
64-
if: runner.os == 'Linux'
65-
run: |
66-
Rscript -e "install.packages('remotes', repos = Sys.getenv('RSPM'))"
67-
while read -r cmd
68-
do
69-
eval sudo $cmd
70-
done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "18.04"), sep = "\n")')
61+
- uses: r-lib/actions/setup-r-dependencies@v2
7162
- name: Perpare testing environment
7263
run: |
7364
# testing dependencies (incl. {precommit}) live in global R library,

.github/workflows/hook-tests.yaml

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ jobs:
1818
config:
1919
- {os: macOS-latest, r: 'release'}
2020
- {os: windows-latest, r: 'release'}
21-
- {os: ubuntu-18.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest", http-user-agent: "R/4.0.0 (ubuntu-18.04) R (4.0.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" }
21+
- {os: ubuntu-latest, r: 'release', use-public-rspm: true}
2222
env:
23-
RSPM: ${{ matrix.config.rspm }}
2423
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
2524

2625
steps:
@@ -29,46 +28,38 @@ jobs:
2928
- uses: r-lib/actions/setup-r@v2
3029
with:
3130
r-version: ${{ matrix.config.r }}
32-
http-user-agent: ${{ matrix.config.http-user-agent }}
3331
- name: Query dependencies
3432
run: |
3533
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
3634
shell: Rscript {0}
3735
- name: Cache R packages (macOs)
3836
if: startsWith(runner.os, 'macOS')
39-
uses: actions/cache@v2
37+
uses: actions/cache@v3
4038
with:
4139
path: ~/Library/Application Support/renv
4240
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('renv.lock') }}
4341
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
4442
- name: Cache R packages (Linux)
4543
if: startsWith(runner.os, 'Linux')
46-
uses: actions/cache@v2
44+
uses: actions/cache@v3
4745
with:
4846
path: ~/.local/share/renv
4947
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('renv.lock') }}
5048
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
5149
- name: Cache R packages (Windows)
5250
if: startsWith(runner.os, 'Windows')
53-
uses: actions/cache@v2
51+
uses: actions/cache@v3
5452
with:
5553
path: ~\AppData\Local\renv
5654
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('renv.lock') }}
5755
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-2-
5856

59-
- name: Install system dependencies (Linux)
60-
if: runner.os == 'Linux'
61-
run: |
62-
Rscript -e "install.packages('remotes', repos = Sys.getenv('RSPM'))"
63-
while read -r cmd
64-
do
65-
eval sudo $cmd
66-
done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "18.04"), sep = "\n")')
57+
- uses: r-lib/actions/setup-r-dependencies@v2
6758
- name: Prepare hook environment
6859
run: |
6960
source('renv/activate.R')
70-
renv::restore()
7161
options(install.packages.compile.from.source = "never", pkgType = "binary")
62+
renv::restore()
7263
# install hook-specific additional_dependencies from .pre-commit-config.yaml
7364
renv::install(c('pkgdown', 'mockery'))
7465
renv::install(getwd(), dependencies = FALSE)

.github/workflows/pkgdown.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939

4040
- name: Deploy to GitHub pages 🚀
4141
if: github.event_name != 'pull_request'
42-
uses: JamesIves/github-pages-deploy-action@4.1.4
42+
uses: JamesIves/github-pages-deploy-action@v4.4.3
4343
with:
4444
clean: false
4545
branch: gh-pages

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# R specific hooks: https://github.com/lorenzwalthert/precommit
33
repos:
44
- repo: https://github.com/lorenzwalthert/precommit
5-
rev: v0.3.2.9007
5+
rev: v0.3.2.9013
66
hooks:
77
- id: style-files
88
args: [--style_pkg=styler, --style_fun=tidyverse_style, --cache-root=styler-perm]

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: precommit
22
Title: Pre-Commit Hooks
3-
Version: 0.3.2.9008
3+
Version: 0.3.2.9014
44
Author: Lorenz Walthert
55
Maintainer: Lorenz Walthert <[email protected]>
66
Description: Useful git hooks for R building on top of the multi-language
@@ -20,7 +20,6 @@ Imports:
2020
R.cache,
2121
rlang,
2222
rprojroot,
23-
rstudioapi,
2423
withr,
2524
yaml
2625
Suggests:
@@ -36,6 +35,7 @@ Suggests:
3635
reticulate (>= 1.16),
3736
rmarkdown,
3837
roxygen2,
38+
rstudioapi,
3939
spelling,
4040
styler,
4141
testthat (>= 2.1.0),

NEWS.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,16 @@ editor_options:
33
markdown:
44
wrap: 72
55
---
6+
# precommit v0.3.2.9013
67

8+
* Don't depend on dev version of styler to avoid GitHub rate limit hit (#486).
9+
10+
# precommit v0.3.2.9009
11+
12+
* add Posit CRAN mirror to ensure macOS binary installs are possible (#488).
13+
* use `ubuntu-latest` instead of pinned version for tests (#481).
14+
* correct typo (#465) and fix error message (#470).
15+
* remove {digest} dependency (#471).
716

817
# precommit v0.3.2.9007 (2022-12-26)
918

0 commit comments

Comments
 (0)