Skip to content

chore: ignore local CodeGraph index #11

chore: ignore local CodeGraph index

chore: ignore local CodeGraph index #11

Workflow file for this run

# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
workflow_dispatch:
name: spelling
permissions: read-all
# Cancel a superseded run (e.g. a newer push to the same ref) so its minutes
# are not wasted completing.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
spelling:
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: any::spelling
needs: website
# Checks the English documentation only. spell_check_package() would also
# scan README.md (Spanish user-facing landing page) with the en-US
# dictionary and fail on legitimate Spanish words, so the file list is
# built explicitly instead: man/, vignettes/ and the English README.
- name: Spelling
shell: Rscript {0}
run: |
files <- c(
list.files("man", pattern = "\\.Rd$", ignore.case = TRUE, full.names = TRUE),
list.files("vignettes", pattern = "\\.(Rmd|qmd|Rnw)$", ignore.case = TRUE,
full.names = TRUE, recursive = TRUE),
"README.en.md"
)
desc <- read.dcf("DESCRIPTION")[1, ]
# spell_check_package() auto-ignores the package name; replicate that
# so Rd files that reference the package name do not fail.
words <- unique(c(spelling::get_wordlist(), desc[["Package"]]))
res <- spelling::spell_check_files(files, ignore = words)
# Keep the DESCRIPTION Title/Description coverage that
# spell_check_package() used to provide.
res_desc <- spelling::spell_check_text(
paste(desc[["Title"]], desc[["Description"]]),
ignore = words
)
res <- rbind(res, res_desc)
if (nrow(res) > 0) {
print(res)
stop("Spelling errors found (see inst/WORDLIST for accepted words).")
}
cat("No spelling errors found.\n")