Skip to content

Commit

Permalink
Merge pull request #99 from rspec/add-rubocop
Browse files Browse the repository at this point in the history
Setup rubocop
  • Loading branch information
JonRowe authored Nov 3, 2024
2 parents c75e524 + 73fa2ad commit ef5d6c8
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@ on:
env:
RSPEC_CI: true
jobs:
rubocop:
name: Rubocop
runs-on: 'ubuntu-20.04'
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
- run: script/update_rubygems_and_install_bundler
- run: bundle install
- run: bundle exec rubocop -c .rubocop.yml

test:
name: Ruby ${{ matrix.ruby }} ${{ matrix.name_extra || '' }}
runs-on: ${{ matrix.os || 'ubuntu-20.04' }}
Expand Down Expand Up @@ -51,5 +63,6 @@ jobs:
bundler: ${{ matrix.bundler || 2 }}
ruby-version: ${{ matrix.ruby }}
- run: script/update_rubygems_and_install_bundler
- run: bundle install --binstubs --standalone
- run: bundle install --standalone
- run: bundle binstubs --all
- run: script/test_all
46 changes: 46 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
AllCops:
NewCops: enable
SuggestExtensions: false

Metrics/BlockLength:
Enabled: true
Exclude:
- spec/**/*_spec.rb

Layout/LineLength:
Max: 120

Lint/NestedMethodDefinition:
Exclude:
- lib/rspec/its.rb

Lint/SendWithMixinArgument:
Exclude:
- lib/rspec/its.rb

Metrics/AbcSize:
Exclude:
- lib/rspec/its.rb

Metrics/MethodLength:
Max: 25

Naming/PredicateName:
Exclude:
- lib/rspec/its.rb

Style/CaseEquality:
Exclude:
- lib/rspec/its/subject.rb

Style/SignalException:
Exclude:
- features/**/*.rb

Style/SpecialGlobalVars:
Exclude:
- rspec-its.gemspec

# We don't care about single vs double quotes.
Style/StringLiterals:
Enabled: false
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ gem 'cucumber', '>= 1.3.8'
gem 'ffi', '~> 1.17.0'
gem 'matrix', '~> 0.4.2'
gem 'rake', '~> 13.2.0'
gem 'rubocop', '~> 1.68.0'

0 comments on commit ef5d6c8

Please sign in to comment.