Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak Rubocop rules; add more exceptions to the main config #2421

Merged
merged 2 commits into from
Mar 25, 2024
Merged
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
9 changes: 9 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,12 @@ RSpec/ExampleLength:

RSpec/NestedGroups:
Max: 4

RSpec/FilePath:
SpecSuffixOnly: true

RSpec/SpecFilePathFormat:
Enabled: false

RSpec/MultipleExpectations:
Max: 4
193 changes: 7 additions & 186 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 5000`
# on 2024-01-01 22:17:14 UTC using RuboCop version 1.59.0.
# on 2024-03-25 01:40:39 UTC using RuboCop version 1.59.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
Expand Down Expand Up @@ -136,7 +136,7 @@ RSpec/AnyInstance:
- 'spec/grape/api_spec.rb'
- 'spec/grape/middleware/base_spec.rb'

# Offense count: 344
# Offense count: 345
# Configuration parameters: Prefixes, AllowedPatterns.
# Prefixes: when, with, without
RSpec/ContextWording:
Expand Down Expand Up @@ -228,60 +228,6 @@ RSpec/ExpectInHook:
- 'spec/grape/api_spec.rb'
- 'spec/grape/validations/validators/values_spec.rb'

# Offense count: 48
# Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
# Include: **/*_spec*rb*, **/spec/**/*
RSpec/FilePath:
Exclude:
- 'spec/grape/api/custom_validations_spec.rb'
- 'spec/grape/api/deeply_included_options_spec.rb'
- 'spec/grape/api/defines_boolean_in_params_spec.rb'
- 'spec/grape/api/documentation_spec.rb'
- 'spec/grape/api/inherited_helpers_spec.rb'
- 'spec/grape/api/invalid_format_spec.rb'
- 'spec/grape/api/mount_and_helpers_order_spec.rb'
- 'spec/grape/api/mount_and_rescue_from_spec.rb'
- 'spec/grape/api/namespace_parameters_in_route_spec.rb'
- 'spec/grape/api/nested_helpers_spec.rb'
- 'spec/grape/api/optional_parameters_in_route_spec.rb'
- 'spec/grape/api/parameters_modification_spec.rb'
- 'spec/grape/api/patch_method_helpers_spec.rb'
- 'spec/grape/api/recognize_path_spec.rb'
- 'spec/grape/api/required_parameters_in_route_spec.rb'
- 'spec/grape/api/required_parameters_with_invalid_method_spec.rb'
- 'spec/grape/api/routes_with_requirements_spec.rb'
- 'spec/grape/api/shared_helpers_exactly_one_of_spec.rb'
- 'spec/grape/api/shared_helpers_spec.rb'
- 'spec/grape/dsl/inside_route_spec.rb'
- 'spec/grape/endpoint/declared_spec.rb'
- 'spec/grape/exceptions/body_parse_errors_spec.rb'
- 'spec/grape/extensions/param_builders/hash_spec.rb'
- 'spec/grape/extensions/param_builders/hash_with_indifferent_access_spec.rb'
- 'spec/grape/extensions/param_builders/hashie/mash_spec.rb'
- 'spec/grape/integration/global_namespace_function_spec.rb'
- 'spec/grape/integration/rack_sendfile_spec.rb'
- 'spec/grape/loading_spec.rb'
- 'spec/grape/middleware/exception_spec.rb'
- 'spec/grape/validations/attributes_doc_spec.rb'
- 'spec/grape/validations/validators/all_or_none_spec.rb'
- 'spec/grape/validations/validators/allow_blank_spec.rb'
- 'spec/grape/validations/validators/at_least_one_of_spec.rb'
- 'spec/grape/validations/validators/coerce_spec.rb'
- 'spec/grape/validations/validators/default_spec.rb'
- 'spec/grape/validations/validators/exactly_one_of_spec.rb'
- 'spec/grape/validations/validators/except_values_spec.rb'
- 'spec/grape/validations/validators/mutual_exclusion_spec.rb'
- 'spec/grape/validations/validators/presence_spec.rb'
- 'spec/grape/validations/validators/regexp_spec.rb'
- 'spec/grape/validations/validators/same_as_spec.rb'
- 'spec/grape/validations/validators/values_spec.rb'
- 'spec/integration/eager_load/eager_load_spec.rb'
- 'spec/integration/multi_json/json_spec.rb'
- 'spec/integration/multi_xml/xml_spec.rb'
- 'spec/integration/no_dry_validation/no_dry_validation_spec.rb'
- 'spec/integration/rack_2_0/headers_spec.rb'
- 'spec/integration/rack_3_0/headers_spec.rb'

# Offense count: 6
# Configuration parameters: Max, AllowedIdentifiers, AllowedPatterns.
RSpec/IndexedLet:
Expand Down Expand Up @@ -331,7 +277,7 @@ RSpec/MessageChain:
Exclude:
- 'spec/grape/middleware/formatter_spec.rb'

# Offense count: 147
# Offense count: 148
# Configuration parameters: .
# SupportedStyles: have_received, receive
RSpec/MessageSpies:
Expand All @@ -342,79 +288,23 @@ RSpec/MissingExampleGroupArgument:
Exclude:
- 'spec/grape/middleware/exception_spec.rb'

# Offense count: 804
# Offense count: 57
# Configuration parameters: Max.
RSpec/MultipleExpectations:
Exclude:
- 'spec/grape/api/custom_validations_spec.rb'
- 'spec/grape/api/deeply_included_options_spec.rb'
- 'spec/grape/api/defines_boolean_in_params_spec.rb'
- 'spec/grape/api/invalid_format_spec.rb'
- 'spec/grape/api/mount_and_helpers_order_spec.rb'
- 'spec/grape/api/mount_and_rescue_from_spec.rb'
- 'spec/grape/api/namespace_parameters_in_route_spec.rb'
- 'spec/grape/api/optional_parameters_in_route_spec.rb'
- 'spec/grape/api/parameters_modification_spec.rb'
- 'spec/grape/api/patch_method_helpers_spec.rb'
- 'spec/grape/api/required_parameters_in_route_spec.rb'
- 'spec/grape/api/routes_with_requirements_spec.rb'
- 'spec/grape/api/shared_helpers_exactly_one_of_spec.rb'
- 'spec/grape/api/shared_helpers_spec.rb'
- 'spec/grape/api_remount_spec.rb'
- 'spec/grape/api_spec.rb'
- 'spec/grape/dsl/desc_spec.rb'
- 'spec/grape/dsl/headers_spec.rb'
- 'spec/grape/dsl/helpers_spec.rb'
- 'spec/grape/dsl/inside_route_spec.rb'
- 'spec/grape/dsl/parameters_spec.rb'
- 'spec/grape/dsl/request_response_spec.rb'
- 'spec/grape/dsl/routing_spec.rb'
- 'spec/grape/dsl/settings_spec.rb'
- 'spec/grape/endpoint/declared_spec.rb'
- 'spec/grape/endpoint_spec.rb'
- 'spec/grape/entity_spec.rb'
- 'spec/grape/exceptions/body_parse_errors_spec.rb'
- 'spec/grape/exceptions/invalid_accept_header_spec.rb'
- 'spec/grape/exceptions/validation_errors_spec.rb'
- 'spec/grape/extensions/param_builders/hash_spec.rb'
- 'spec/grape/extensions/param_builders/hash_with_indifferent_access_spec.rb'
- 'spec/grape/extensions/param_builders/hashie/mash_spec.rb'
- 'spec/grape/middleware/auth/base_spec.rb'
- 'spec/grape/middleware/auth/dsl_spec.rb'
- 'spec/grape/middleware/base_spec.rb'
- 'spec/grape/middleware/exception_spec.rb'
- 'spec/grape/middleware/formatter_spec.rb'
- 'spec/grape/middleware/stack_spec.rb'
- 'spec/grape/middleware/versioner/accept_version_header_spec.rb'
- 'spec/grape/middleware/versioner/header_spec.rb'
- 'spec/grape/middleware/versioner/param_spec.rb'
- 'spec/grape/presenters/presenter_spec.rb'
- 'spec/grape/util/inheritable_setting_spec.rb'
- 'spec/grape/util/reverse_stackable_values_spec.rb'
- 'spec/grape/util/stackable_values_spec.rb'
- 'spec/grape/validations/attributes_doc_spec.rb'
- 'spec/grape/validations/contract_scope_spec.rb'
- 'spec/grape/validations/instance_behaivour_spec.rb'
- 'spec/grape/validations/params_scope_spec.rb'
- 'spec/grape/validations/types/array_coercer_spec.rb'
- 'spec/grape/validations/types/primitive_coercer_spec.rb'
- 'spec/grape/validations/types/set_coercer_spec.rb'
- 'spec/grape/validations/types_spec.rb'
- 'spec/grape/validations/validators/all_or_none_spec.rb'
- 'spec/grape/validations/validators/allow_blank_spec.rb'
- 'spec/grape/validations/validators/at_least_one_of_spec.rb'
- 'spec/grape/validations/validators/coerce_spec.rb'
- 'spec/grape/validations/validators/default_spec.rb'
- 'spec/grape/validations/validators/exactly_one_of_spec.rb'
- 'spec/grape/validations/validators/except_values_spec.rb'
- 'spec/grape/validations/validators/mutual_exclusion_spec.rb'
- 'spec/grape/validations/validators/presence_spec.rb'
- 'spec/grape/validations/validators/regexp_spec.rb'
- 'spec/grape/validations/validators/same_as_spec.rb'
- 'spec/grape/validations/validators/values_spec.rb'
- 'spec/grape/validations_spec.rb'
- 'spec/integration/no_dry_validation/no_dry_validation_spec.rb'
- 'spec/shared/versioning_examples.rb'

# Offense count: 38
# Configuration parameters: AllowSubject, Max.
Expand All @@ -424,7 +314,7 @@ RSpec/MultipleMemoizedHelpers:
- 'spec/grape/request_spec.rb'
- 'spec/grape/validations/attributes_doc_spec.rb'

# Offense count: 2182
# Offense count: 2180
# Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
# SupportedStyles: always, named_only
RSpec/NamedSubject:
Expand Down Expand Up @@ -489,29 +379,14 @@ RSpec/NamedSubject:
- 'spec/grape/validations/validators/presence_spec.rb'
- 'spec/grape/validations_spec.rb'

# Offense count: 174
# Offense count: 28
# Configuration parameters: Max, AllowedGroups.
RSpec/NestedGroups:
Exclude:
- 'spec/grape/api_remount_spec.rb'
- 'spec/grape/api_spec.rb'
- 'spec/grape/dsl/headers_spec.rb'
- 'spec/grape/dsl/inside_route_spec.rb'
- 'spec/grape/endpoint_spec.rb'
- 'spec/grape/exceptions/base_spec.rb'
- 'spec/grape/exceptions/invalid_accept_header_spec.rb'
- 'spec/grape/middleware/formatter_spec.rb'
- 'spec/grape/presenters/presenter_spec.rb'
- 'spec/grape/validations/attributes_doc_spec.rb'
- 'spec/grape/validations/params_scope_spec.rb'
- 'spec/grape/validations/single_attribute_iterator_spec.rb'
- 'spec/grape/validations/types/primitive_coercer_spec.rb'
- 'spec/grape/validations/validators/all_or_none_spec.rb'
- 'spec/grape/validations/validators/allow_blank_spec.rb'
- 'spec/grape/validations/validators/at_least_one_of_spec.rb'
- 'spec/grape/validations/validators/coerce_spec.rb'
- 'spec/grape/validations/validators/exactly_one_of_spec.rb'
- 'spec/grape/validations/validators/mutual_exclusion_spec.rb'
- 'spec/grape/validations_spec.rb'

# Offense count: 18
Expand Down Expand Up @@ -560,61 +435,6 @@ RSpec/ScatteredSetup:
- 'spec/grape/util/inheritable_setting_spec.rb'
- 'spec/grape/validations_spec.rb'

# Offense count: 48
# Configuration parameters: Include, CustomTransform, IgnoreMethods, IgnoreMetadata.
# Include: **/*_spec.rb
RSpec/SpecFilePathFormat:
Exclude:
- '**/spec/routing/**/*'
- 'spec/grape/api/custom_validations_spec.rb'
- 'spec/grape/api/deeply_included_options_spec.rb'
- 'spec/grape/api/defines_boolean_in_params_spec.rb'
- 'spec/grape/api/documentation_spec.rb'
- 'spec/grape/api/inherited_helpers_spec.rb'
- 'spec/grape/api/invalid_format_spec.rb'
- 'spec/grape/api/mount_and_helpers_order_spec.rb'
- 'spec/grape/api/mount_and_rescue_from_spec.rb'
- 'spec/grape/api/namespace_parameters_in_route_spec.rb'
- 'spec/grape/api/nested_helpers_spec.rb'
- 'spec/grape/api/optional_parameters_in_route_spec.rb'
- 'spec/grape/api/parameters_modification_spec.rb'
- 'spec/grape/api/patch_method_helpers_spec.rb'
- 'spec/grape/api/recognize_path_spec.rb'
- 'spec/grape/api/required_parameters_in_route_spec.rb'
- 'spec/grape/api/required_parameters_with_invalid_method_spec.rb'
- 'spec/grape/api/routes_with_requirements_spec.rb'
- 'spec/grape/api/shared_helpers_exactly_one_of_spec.rb'
- 'spec/grape/api/shared_helpers_spec.rb'
- 'spec/grape/dsl/inside_route_spec.rb'
- 'spec/grape/endpoint/declared_spec.rb'
- 'spec/grape/exceptions/body_parse_errors_spec.rb'
- 'spec/grape/extensions/param_builders/hash_spec.rb'
- 'spec/grape/extensions/param_builders/hash_with_indifferent_access_spec.rb'
- 'spec/grape/extensions/param_builders/hashie/mash_spec.rb'
- 'spec/grape/integration/global_namespace_function_spec.rb'
- 'spec/grape/integration/rack_sendfile_spec.rb'
- 'spec/grape/loading_spec.rb'
- 'spec/grape/middleware/exception_spec.rb'
- 'spec/grape/validations/attributes_doc_spec.rb'
- 'spec/grape/validations/validators/all_or_none_spec.rb'
- 'spec/grape/validations/validators/allow_blank_spec.rb'
- 'spec/grape/validations/validators/at_least_one_of_spec.rb'
- 'spec/grape/validations/validators/coerce_spec.rb'
- 'spec/grape/validations/validators/default_spec.rb'
- 'spec/grape/validations/validators/exactly_one_of_spec.rb'
- 'spec/grape/validations/validators/except_values_spec.rb'
- 'spec/grape/validations/validators/mutual_exclusion_spec.rb'
- 'spec/grape/validations/validators/presence_spec.rb'
- 'spec/grape/validations/validators/regexp_spec.rb'
- 'spec/grape/validations/validators/same_as_spec.rb'
- 'spec/grape/validations/validators/values_spec.rb'
- 'spec/integration/eager_load/eager_load_spec.rb'
- 'spec/integration/multi_json/json_spec.rb'
- 'spec/integration/multi_xml/xml_spec.rb'
- 'spec/integration/no_dry_validation/no_dry_validation_spec.rb'
- 'spec/integration/rack_2_0/headers_spec.rb'
- 'spec/integration/rack_3_0/headers_spec.rb'

# Offense count: 9
RSpec/StubbedMock:
Exclude:
Expand Down Expand Up @@ -660,6 +480,7 @@ RSpec/VoidExpect:
- 'spec/grape/dsl/headers_spec.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/CombinableLoops:
Exclude:
- 'spec/grape/endpoint_spec.rb'
Expand Down
Loading