Skip to content

Commit cc96ab4

Browse files
fix bugs
1 parent 7a87407 commit cc96ab4

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

R/setup.R

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ use_precommit <- function(config_source = getOption("precommit.config_source"),
5454
install_repo(root, install_hooks, legacy_hooks)
5555
if (open) {
5656
open_config(root)
57-
if (ci == "native") {
58-
use_ci(ci)
59-
}
57+
use_ci(ci)
6058
} else {
6159
if (ci == "gha") {
6260
use_ci(ci, force = force, root = root)

inst/pre-commit-gha.yaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,9 @@ jobs:
4545
if: startsWith(runner.os, 'Linux')
4646
with:
4747
path: ${{env.R_LIBS_USER}}
48-
key: precommit-${{env.UBUNTU_VERSION}}-renv-${{ hashFiles('.pre-commit.r_requirements.txt') }}-
48+
key: precommit-${{env.UBUNTU_VERSION}}-renv-
4949
restore-keys: |
5050
precommit-${{env.UBUNTU_VERSION}}-renv-
51-
- name: Install R packages
52-
run: |
53-
if (!requireNamespace("renv", quietly = TRUE)) install.packages("renv")
54-
renv::restore()
55-
renv::install(scan(".pre-commit.r_requirements.txt", what=character(), sep="\n"))
56-
shell: Rscript {0}
5751
5852
- name: Cache pre-commit
5953
uses: actions/cache@v2
@@ -68,7 +62,7 @@ jobs:
6862
if: failure() && startsWith(github.ref, 'refs/heads')
6963
run: |
7064
if [[ `git status --porcelain --untracked-files=no` ]]; then
71-
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
65+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
7266
git config --local user.name "github-actions[bot]"
7367
git checkout -- .github/workflows
7468
git commit -m "pre-commit" -a

vignettes/ci.Rmd

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ to use GitHub Actions. For existing repos, see below.
1616

1717
# Comparison
1818

19-
Next, we quickly introduce the two options:
19+
Next, we quickly introduce the two options. We recommend
20+
[pre-commit.ci](https://pre-commit.ci) unless your package has system
21+
dependencies that are not shipped with the R package on Linux **and** you want
22+
to use the [roxygenize hook](https://lorenzwalthert.github.io/precommit/dev/articles/available-hooks.html#roxygenize-1).
23+
2024

2125
## pre-commit.ci
2226

@@ -40,15 +44,17 @@ Next, we quickly introduce the two options:
4044

4145
**Pros:**
4246

43-
- more flexible in how you run `pre-commit`.
47+
- more flexible in how you run `pre-commit` if you need it.
48+
- out-of-the-box action is in [maintenance only mode](https://github.com/pre-commit/action)
4449
- No new authentication needed.
4550
- If your package has system dependencies and you want to use the roxygenize
4651
hook, you can install them.
4752

4853
**Cons:**
4954

50-
- You need to maintain the workflow file, e.g. when GitHub changes the syntax,
51-
you need to adapt.
55+
- You need to maintain the workflow file with a lot of boilerplate code and
56+
when GitHub changes the syntax, you need to adapt it to prevent failing
57+
builds.
5258
- You'll have one additional file per provider (e.g. GitHub, Gitlab).
5359

5460

0 commit comments

Comments
 (0)