Skip to content

Commit

Permalink
Create linter.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
aliaksah authored Apr 20, 2024
1 parent 5e78dd0 commit d1b2caf
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
#
# See https://github.com/r-lib/actions/tree/master/examples#readme for
# additional example workflows available for the R community.

# ======================================================== #
# Determines when the action is triggered #
# ======================================================== #

on: [push, pull_request]
name: linter

# ======================================================== #
# Determine actions to take #
# ======================================================== #

jobs:
lint:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checking out the repository
uses: actions/checkout@v3

- name: Setting up R
uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- name: Installing dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: lintr

- name: Picking on the coding style
run: |
library(lintr)
style_rules <- list(
brace_linter(), todo_comment_linter(), equals_na_linter(),
function_left_parentheses_linter(), no_tab_linter(),
absolute_path_linter(), nonportable_path_linter(),
pipe_continuation_linter(), semicolon_linter(),
single_quotes_linter(), trailing_blank_lines_linter(), trailing_whitespace_linter(),
undesirable_function_linter(), undesirable_operator_linter()
) # TODO: expand style rules as package matures
lint_package(linters = style_rules)
shell: Rscript {0}

0 comments on commit d1b2caf

Please sign in to comment.