-
Notifications
You must be signed in to change notification settings - Fork 1k
70 lines (65 loc) · 2.09 KB
/
code-quality.yaml
File metadata and controls
70 lines (65 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
on:
push:
branches: [master]
pull_request:
name: code-quality
jobs:
lint-r:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: |
r-lib/lintr
local::.
needs: lint
- name: Lint
run: lintr::lint_package(pattern = "(?i)[.](r|rmd)$") # TODO(#5830): use the default pattern
shell: Rscript {0}
env:
LINTR_ERROR_ON_LINT: true
R_LINTR_LINTER_FILE: .ci/.lintr
lint-c:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
- name: Install Coccinelle
# relying on the action above us to have updated the package cache
run: /usr/bin/sudo apt-get -y install coccinelle
- name: Lint
run: |
Rscript .ci/lint.R .ci/linters/c src '[.][ch]$'
lint-po:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
- name: Check translations
# only pay attention to files edited in the current PR, otherwise we can get
# a situation like after #6424 where some untranslated messages were added
# as part of non-translation maintenance, but this GHA would go red repeatedly
# until a translation is added or the blank/fuzzy translations removed. We'd
# rather only have the failure on one PR, then ignore these files later.
run: |
Rscript .ci/lint.R .ci/linters/po po '[.]po$'
lint-md:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
- name: Lint
run: Rscript .ci/lint.R .ci/linters/md . '[.]R?md$'
lint-rd:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
- name: Lint Rd files
run: Rscript .ci/lint.R .ci/linters/rd man '[.]Rd$'