Skip to content

Commit ef5d6c8

Browse files
authored
Merge pull request #99 from rspec/add-rubocop
Setup rubocop
2 parents c75e524 + 73fa2ad commit ef5d6c8

File tree

3 files changed

+61
-1
lines changed

3 files changed

+61
-1
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,18 @@ on:
1111
env:
1212
RSPEC_CI: true
1313
jobs:
14+
rubocop:
15+
name: Rubocop
16+
runs-on: 'ubuntu-20.04'
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: ruby/setup-ruby@v1
20+
with:
21+
ruby-version: '3.3'
22+
- run: script/update_rubygems_and_install_bundler
23+
- run: bundle install
24+
- run: bundle exec rubocop -c .rubocop.yml
25+
1426
test:
1527
name: Ruby ${{ matrix.ruby }} ${{ matrix.name_extra || '' }}
1628
runs-on: ${{ matrix.os || 'ubuntu-20.04' }}
@@ -51,5 +63,6 @@ jobs:
5163
bundler: ${{ matrix.bundler || 2 }}
5264
ruby-version: ${{ matrix.ruby }}
5365
- run: script/update_rubygems_and_install_bundler
54-
- run: bundle install --binstubs --standalone
66+
- run: bundle install --standalone
67+
- run: bundle binstubs --all
5568
- run: script/test_all

.rubocop.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
AllCops:
2+
NewCops: enable
3+
SuggestExtensions: false
4+
5+
Metrics/BlockLength:
6+
Enabled: true
7+
Exclude:
8+
- spec/**/*_spec.rb
9+
10+
Layout/LineLength:
11+
Max: 120
12+
13+
Lint/NestedMethodDefinition:
14+
Exclude:
15+
- lib/rspec/its.rb
16+
17+
Lint/SendWithMixinArgument:
18+
Exclude:
19+
- lib/rspec/its.rb
20+
21+
Metrics/AbcSize:
22+
Exclude:
23+
- lib/rspec/its.rb
24+
25+
Metrics/MethodLength:
26+
Max: 25
27+
28+
Naming/PredicateName:
29+
Exclude:
30+
- lib/rspec/its.rb
31+
32+
Style/CaseEquality:
33+
Exclude:
34+
- lib/rspec/its/subject.rb
35+
36+
Style/SignalException:
37+
Exclude:
38+
- features/**/*.rb
39+
40+
Style/SpecialGlobalVars:
41+
Exclude:
42+
- rspec-its.gemspec
43+
44+
# We don't care about single vs double quotes.
45+
Style/StringLiterals:
46+
Enabled: false

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ gem 'cucumber', '>= 1.3.8'
2424
gem 'ffi', '~> 1.17.0'
2525
gem 'matrix', '~> 0.4.2'
2626
gem 'rake', '~> 13.2.0'
27+
gem 'rubocop', '~> 1.68.0'

0 commit comments

Comments
 (0)