-
Notifications
You must be signed in to change notification settings - Fork 11
31 lines (29 loc) · 1.04 KB
/
spellcheck.yml
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
name: Spellcheck
on:
pull_request: {branches: ['main']}
jobs:
Spelling:
runs-on: ubuntu-latest
container: {image: "rocker/tidyverse:4.3.1"}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install packages
run: |
if (!require("roxygen2")) install.packages("roxygen2")
if (!require("spelling")) install.packages("spelling")
if (!require("testthat")) install.packages("testthat")
shell: Rscript {0}
- name: Check spelling
run: |
testthat::test_that(desc = "Check spelling",
code = {
typos <- spelling::spell_check_files(list.files(pattern = ".*.qmd$", recursive = TRUE), ignore = readr::read_lines("inst/WORDLIST.txt"))
print(typos)
testthat::expect_equal(
object = typos,
expected = spelling::spell_check_files(path = "inst/WORDLIST.txt", ignore = readr::read_lines("inst/WORDLIST.txt"))
)
}
)
shell: Rscript {0}