Repository navigation
Hold every module to RuboCop's default length - #3039
Merged
Merged
Conversation
Metrics/ModuleLength was raised to 220; the two modules above the default of 100 are brought under it instead, and the override is dropped. DSL::Routing (218) also held the mounting and versioning DSLs, which the README documents as sections of their own. They move out, and Grape::API::Instance extends both: - DSL::Mounting: mount, mounted and given, the refresh/drop internals behind a re-mount, and the configuration-aware block evaluation. - DSL::Versioning: version, versions and cascade. Routing keeps routes, namespaces, route_param, scope, prefix and the route toggles, at 100. Their specs move with them. DSL::InsideRoute (101) answers `status` with a guard clause instead of a case/when whose else raised. Behaviour is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ericproulx
force-pushed
the
refactor/module-length
branch
from
October 17, 2026 19:35
8594831 to
3896581
Compare
Danger ReportNo issues found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Metrics/ModuleLengthwas raised to 220. The two modules above the default of 100 now fit under it, and the override is gone.DSL::Routing(218 → 100). It also held the mounting and versioning DSLs, which the README documents as sections of their own. They move into two new modules, andGrape::API::Instanceextends both:DSL::Mounting:mount,mountedandgiven, the refresh/drop internals behind a re-mount, and the configuration-aware block evaluation.DSL::Versioning:version,versionsandcascade.Routingkeeps routes, namespaces,route_param,scope,prefixand the route toggles. The.mountand.versionspecs move intomounting_spec.rbandversioning_spec.rb.DSL::InsideRoute(101 → 97).statusanswers with a guard clause instead of acase/whenwhoseelseraised.Behaviour is unchanged. The methods only change modules, and
Grape::APIexposes the same DSL.Test plan
bundle exec rake(RuboCop clean, 3,100 examples, 0 failures).spec/integrationwithgemfiles/grape_entity.gemfile(28 examples, 0 failures).🤖 Generated with Claude Code