Skip to content

Commit

Permalink
Add rubocop-rspec_rails and get rubocop run to green
Browse files Browse the repository at this point in the history
In rubocop/rubocop-rspec#1848 rubocop-rspec extracted
some cops to separate gems, and because we referenced one of them in our
rubocop_todo.yml the whole rubocop process wouldn't run because it doesn't like
config for cops it doesn't know about. We introducing the missing gem,
`rubocop-rspec_rails`, and fix the name in the config to let us run rubocop
again.

There is one infraction that exists in the source so we fix that to get us to a
green rubocop run.
  • Loading branch information
h-lame committed Jul 5, 2024
1 parent a178e6d commit 9a55365
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require:
- rubocop-rails
- rubocop-rspec
- rubocop-rspec_rails
- rubocop-performance

inherit_from: .rubocop_todo.yml
Expand Down
2 changes: 1 addition & 1 deletion .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,7 @@ RSpec/PredicateMatcher:
# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: Inferences.
RSpec/Rails/InferredSpecType:
RSpecRails/InferredSpecType:
Exclude:
- 'spec/controllers/pets_controller_spec.rb'

Expand Down
1 change: 1 addition & 0 deletions apipie-rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Gem::Specification.new do |s|
s.add_development_dependency 'rubocop-rails'
s.add_development_dependency 'rubocop-rspec'
s.add_development_dependency 'rubocop-performance'
s.add_development_dependency 'rubocop-rspec_rails'
s.add_development_dependency "simplecov"
s.add_development_dependency "sqlite3"
end
2 changes: 1 addition & 1 deletion spec/lib/swagger/swagger_dsl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def have_field?(field, expected_name, breadcrumb)
expect(schema).to have_field(:pet_id, 'number', {:description => 'id of pet'})
expect(schema).to have_field(:pet_name, 'string', {:description => 'Name of pet', :required => false})
expect(schema).to have_field(:animal_type, 'string', {:description => 'Type of pet', :enum => %w[dog cat iguana kangaroo]})
expect(schema).not_to have_field(:partial_match_allowed, 'boolean', {:required => false}) # rubocop:disable Capybara/NegationMatcher
expect(schema).not_to have_field(:partial_match_allowed, 'boolean', {:required => false})
end

it "creates a swagger definition with all input parameters" do
Expand Down

0 comments on commit 9a55365

Please sign in to comment.