Skip to content

Commit

Permalink
Only lint Rubocop for now (and only modified files)
Browse files Browse the repository at this point in the history
deleted files are excluded
  • Loading branch information
Splines committed Nov 14, 2023
1 parent 76cb7c0 commit c24e39b
Showing 1 changed file with 54 additions and 53 deletions.
107 changes: 54 additions & 53 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -1,66 +1,67 @@
on: [push]
name: Linting

on: [push, pull_request]

jobs:

# RuboCop Linting
# Workflow adapted from Rails
# https://github.com/rails/rails/blob/main/.github/workflows/rubocop.yml
rubocop:
name: RuboCop
runs-on: ubuntu-latest
name: A job to check rubocop linter errors
steps:
- uses: actions/checkout@v2
- name: Checkout sources
uses: actions/checkout@v4

- name: Set up Ruby 3
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1.4
- name: Install gems # usual step to install the gems.
bundler-cache: true

# Scope Rubocop to files:
# https://robertfaldo.medium.com/commands-to-run-rubocop-and-specs-you-changed-in-your-branch-e6d2f2e4110b
- name: Run RuboCop
run: |
bin/bundle config path vendor/bundle
bin/bundle config set without 'default doc job cable storage ujs test db'
bin/bundle install --jobs 4 --retry 3
- name: Linter count
id: hello
uses: henrixapp/[email protected]
with:
name: Rubocop
command: bin/bundle exec rubocop app config lib spec
total_regexp: \d+ offenses detected
errors_regexp: \d+ offenses detected
warnings_regexp: \d+ offenses detected
compare_branch: mampf-next
mode: changed
include: .rb
eslint:
runs-on: ubuntu-latest
name: A job to check eslint linter errors
steps:
- uses: actions/checkout@v2
- name: Linter count
id: hello
uses: henrixapp/[email protected]
with:
name: EsLint
command: npx eslint
total_regexp: \d+ problems
errors_regexp: \d+ errors
warnings_regexp: \d+ warnings
compare_branch: mampf-next
mode: changed
include: .js
coffee:
runs-on: ubuntu-latest
name: A job to check coffee linter errors
steps:
- uses: actions/checkout@v2
- name: Linter count
id: hello
uses: henrixapp/[email protected]
with:
name: Coffee
command: npx coffeelint
total_regexp: \d+ errors
errors_regexp: \d+ errors
warnings_regexp: \d+ warnings
compare_branch: mampf-next
mode: changed
include: .coffee
git diff --diff-filter=d --name-only mampf-next... \
| xargs bundle exec rubocop --parallel
# eslint:
# runs-on: ubuntu-latest
# name: A job to check eslint linter errors
# steps:
# - uses: actions/checkout@v2
# - name: Linter count
# id: hello
# uses: henrixapp/[email protected]
# with:
# name: EsLint
# command: npx eslint
# total_regexp: \d+ problems
# errors_regexp: \d+ errors
# warnings_regexp: \d+ warnings
# compare_branch: mampf-next
# mode: changed
# include: .js
# coffee:
# runs-on: ubuntu-latest
# name: A job to check coffee linter errors
# steps:
# - uses: actions/checkout@v2
# - name: Linter count
# id: hello
# uses: henrixapp/[email protected]
# with:
# name: Coffee
# command: npx coffeelint
# total_regexp: \d+ errors
# errors_regexp: \d+ errors
# warnings_regexp: \d+ warnings
# compare_branch: mampf-next
# mode: changed
# include: .coffee
# erblint:
# runs-on: ubuntu-latest
# name: A job to check erblint linter errors
Expand Down

0 comments on commit c24e39b

Please sign in to comment.