Merge pull request #476 from mayeulk/patch-1-French-translations #1325
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: [push, pull_request] | |
name: lint | |
jobs: | |
lint: | |
runs-on: ubuntu-18.04 | |
env: | |
GITHUB_PAT: ${{ secrets.GHA_PAT }} | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: 'release' | |
- name: Query dependencies | |
run: | | |
install.packages('remotes') | |
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) | |
shell: Rscript {0} | |
- name: Cache R packages | |
uses: actions/cache@v1 | |
with: | |
path: ${{ env.R_LIBS_USER }} | |
key: ubuntu-r-4.1-4-${{ hashFiles('.github/depends.Rds') }} | |
restore-keys: ubuntu-r-4.1-4- | |
- name: Install system dependencies | |
if: runner.os == 'Linux' | |
env: | |
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc | |
run: | | |
Rscript -e "remotes::install_github('r-hub/sysreqs')" | |
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))") | |
sudo -s eval "$sysreqs" | |
- name: Install dependencies | |
run: | | |
install.packages(c("remotes")) | |
remotes::install_deps(dependencies = TRUE) | |
remotes::install_cran("lintr") | |
shell: Rscript {0} | |
- name: Lint | |
run: | | |
out <- | |
lintr::lint_package( | |
linters = lintr::linters_with_defaults( | |
object_usage_linter = NULL, | |
trailing_whitespace_linter = NULL, | |
cyclocomp_linter = NULL | |
), | |
exclusions = c( | |
list.files("tests", recursive = TRUE, full.names = TRUE), | |
list.files("man", recursive = TRUE, full.names = TRUE), | |
list.files("vignettes", recursive = TRUE, full.names = TRUE), | |
list.files("data-raw", recursive = TRUE, full.names = TRUE), | |
list.files("inst", recursive = TRUE, full.names = TRUE) | |
) | |
) | |
print(out) | |
if (length(out)) stop("lints found") | |
shell: Rscript {0} | |