Skip to content

Commit 72901de

Browse files
committed
Use r-lib/actions to lint R files
.
1 parent 2fe5b21 commit 72901de

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

.github/workflows/main.yml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,24 +52,26 @@ jobs:
5252
files: .
5353
config_file: ".markdownlint.json"
5454
ignore_files: "node_modules/*"
55-
lintr:
55+
lint:
5656
runs-on: ubuntu-latest
57-
container:
58-
image: rocker/tidyverse:latest
57+
env:
58+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
5959
steps:
60-
- uses: actions/checkout@v3
61-
- name: Install apt-get dependencies
62-
run: |
63-
apt-get update
64-
apt-get install git ssh curl bzip2 -y
60+
- uses: actions/checkout@v4
61+
62+
- uses: r-lib/actions/setup-r@v2
63+
with:
64+
use-public-rspm: true
65+
6566
- name: Install lintr
66-
run: |
67-
Rscript -e "install.packages('lintr', repos = 'https://cloud.r-project.org')"
68-
shell: bash
69-
- name: Running lintr
70-
run: |
71-
Rscript -e "stopifnot(length(print(lintr::lint_dir('./R'))) == 0)"
72-
shell: bash
67+
run: install.packages("lintr")
68+
shell: Rscript {0}
69+
70+
- name: Lint root directory
71+
run: lintr::lint_dir("./R")
72+
shell: Rscript {0}
73+
env:
74+
LINTR_ERROR_ON_LINT: true
7375
devreplay:
7476
runs-on: ubuntu-latest
7577
steps:

.yarnrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

R/.lintr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
linters: linters_with_defaults(
22
line_length_linter(120),
33
indentation_linter(4),
4-
cyclocomp_linter = NULL,
4+
return_linter = NULL,
55
object_name_linter = NULL,
66
object_usage_linter = NULL)

0 commit comments

Comments
 (0)