Skip to content

Commit

Permalink
Redo rubocop TODO and fix a couple of new offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieujobin committed Jul 10, 2024
1 parent 15eb36b commit ede2ba4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 19 deletions.
35 changes: 19 additions & 16 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
# This configuration was generated by
# `rubocop --auto-gen-config --exclude-limit 500`
# on 2024-07-09 08:27:01 UTC using RuboCop version 1.64.1.
# `rubocop --auto-gen-config --exclude-limit 180`
# on 2024-07-10 23:53:15 UTC using RuboCop version 1.65.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

RubyVersionGlobalsUsage:
Exclude:
- apipie-rails.gemspec

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: Severity, Include.
Expand All @@ -18,7 +14,7 @@ Gemspec/DeprecatedAttributeAssignment:
Exclude:
- 'apipie-rails.gemspec'

# Offense count: 11
# Offense count: 12
# Configuration parameters: EnforcedStyle, AllowedGems, Include.
# SupportedStyles: Gemfile, gems.rb, gemspec
# Include: **/*.gemspec, **/Gemfile, **/gems.rb
Expand Down Expand Up @@ -50,6 +46,13 @@ Gemspec/RequiredRubyVersion:
Exclude:
- 'spec/dummy/components/test_engine/test_engine.gemspec'

# Offense count: 1
# Configuration parameters: Severity, Include.
# Include: **/*.gemspec
Gemspec/RubyVersionGlobalsUsage:
Exclude:
- 'apipie-rails.gemspec'

# Offense count: 24
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, IndentationWidth.
Expand Down Expand Up @@ -590,12 +593,11 @@ Layout/TrailingEmptyLines:
- 'spec/lib/apipie/generator/swagger/param_description_spec.rb'
- 'spec/lib/apipie/param_group_spec.rb'

# Offense count: 15
# Offense count: 14
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowInHeredoc.
Layout/TrailingWhitespace:
Exclude:
- 'lib/apipie/error_description.rb'
- 'spec/dummy/app/controllers/application_controller.rb'
- 'spec/dummy/app/controllers/twitter_example_controller.rb'

Expand Down Expand Up @@ -741,20 +743,21 @@ Lint/UselessMethodDefinition:
Exclude:
- 'spec/dummy/app/controllers/overridden_concerns_controller.rb'

# Offense count: 3
# Offense count: 4
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AutoCorrect, CheckForMethodsWithNoSideEffects.
Lint/Void:
Exclude:
- 'spec/controllers/users_controller_spec.rb'
- 'spec/lib/swagger/swagger_dsl_spec.rb'

# Offense count: 60
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 96

# Offense count: 3
# Configuration parameters: CountBlocks.
# Offense count: 1
# Configuration parameters: CountBlocks, CountModifierForms.
Metrics/BlockNesting:
Max: 4

Expand Down Expand Up @@ -1195,7 +1198,7 @@ Rails/Delegate:
Exclude:
- 'lib/apipie/response_description_adapter.rb'

# Offense count: 24
# Offense count: 25
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: slashes, arguments
Expand Down Expand Up @@ -1230,7 +1233,7 @@ Rails/NegateInclude:
- 'lib/apipie/extractor/writer.rb'
- 'spec/spec_helper.rb'

# Offense count: 7
# Offense count: 6
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: Include.
# Include: app/**/*.rb, config/**/*.rb, db/**/*.rb, lib/**/*.rb
Expand Down Expand Up @@ -1406,7 +1409,7 @@ Style/CommentedKeyword:
- 'lib/apipie/dsl_definition.rb'
- 'lib/apipie/extractor/recorder.rb'

# Offense count: 8
# Offense count: 7
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions.
# SupportedStyles: assign_to_condition, assign_inside_condition
Expand Down Expand Up @@ -1830,7 +1833,7 @@ Style/StringConcatenation:
- 'lib/apipie/application.rb'
- 'lib/apipie/extractor/writer.rb'

# Offense count: 1231
# Offense count: 1233
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
# SupportedStyles: single_quotes, double_quotes
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/pets_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
require 'apipie/rspec/response_validation_helper'
require "json-schema"

RSpec.describe PetsController, :type => :controller do
RSpec.describe PetsController do
it "does not raise error when rendered output matches the described response" do
response = get :return_and_validate_expected_response, format: :json
expect(response).to match_declared_responses
Expand Down
4 changes: 2 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ def fail(msg)
config.mock_with :rspec

if Rails.version >= "7.1"
config.fixture_paths = ["#{::Rails.root}/spec/fixtures"]
config.fixture_paths = ["#{Rails.root}/spec/fixtures"]
else
config.fixture_path = "#{::Rails.root}/spec/fixtures"
config.fixture_path = "#{Rails.root}/spec/fixtures"
end

# If you're not using ActiveRecord, or you'd prefer not to run each of your
Expand Down

0 comments on commit ede2ba4

Please sign in to comment.