Skip to content

build: Add a GHA Linter #8

build: Add a GHA Linter

build: Add a GHA Linter #8

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]
pull_request:
name: lint-project.yaml
permissions: read-all
jobs:
lint-project:
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
- name: Install lintr
run: |
install.packages("lintr")
install.packages("devtools")
shell: Rscript {0}
# we must use devtools::load_all to all lintr to not consider
# all of the internal non exported functions as non declared globals
# https://github.com/r-lib/lintr/issues/1137#issuecomment-1127828843
- name: Lint root directory
run: |
devtools::load_all()
lintr::lint_dir()
shell: Rscript {0}
env:
LINTR_ERROR_ON_LINT: true