Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# 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.
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with rspec.
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby

name: RuboCop

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

permissions:
contents: read

jobs:
rubocop:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.4
bundler-cache: false

- name: Install gems
run: bundle install

- name: Run RuboCop
# Use -c flag so we ignore config files used within rubocop-related fixtures
run: bundle exec rubocop -c .rubocop.yml
33 changes: 33 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
inherit_from: .rubocop_todo.yml

# The behavior of RuboCop can be controlled via the .rubocop.yml
# configuration file. It makes it possible to enable/disable
# certain cops (checks) and to alter their behavior if they accept
# any parameters. The file can be placed either in your home
# directory or in some project directory.
#
# RuboCop will start looking for the configuration file in the directory
# where the inspected file is and continue its way up to the root directory.
#
# See https://docs.rubocop.org/rubocop/configuration
AllCops:
NewCops: enable
Exclude:
- "spec/fixtures/invalid_byte.rb"
- "spec/fixtures/invalid_node_comment.rb"
- "spec/fixtures/invalid_utf8.rb"
TargetRubyVersion: 3.0

Style/MethodDefParentheses:
EnforcedStyle: require_no_parentheses

Layout/EmptyLineAfterGuardClause:
Enabled: false

Metrics/MethodLength:
Max: 25

plugins:
- rubocop-rspec
- rubocop-rake
Loading