Skip to content

Hold every module to RuboCop's default length - #3039

Merged
ericproulx merged 1 commit into
masterfrom
refactor/module-length
Oct 17, 2026
Merged

ericproulx merged 1 commit into
masterfrom
refactor/module-length

Conversation

@ericproulx

Copy link
Copy Markdown
Contributor

Summary

Metrics/ModuleLength was 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, 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. The .mount and .version specs move into mounting_spec.rb and versioning_spec.rb.

  • DSL::InsideRoute (101 → 97). status answers with a guard clause instead of a case/when whose else raised.

Behaviour is unchanged. The methods only change modules, and Grape::API exposes the same DSL.

Test plan

  • bundle exec rake (RuboCop clean, 3,100 examples, 0 failures).
  • spec/integration with gemfiles/grape_entity.gemfile (28 examples, 0 failures).
  • CI green.

🤖 Generated with Claude Code

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
ericproulx force-pushed the refactor/module-length branch from 8594831 to 3896581 Compare October 17, 2026 19:35
@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Danger Report

No issues found.

View run

@ericproulx
ericproulx merged commit 88948b3 into master Oct 17, 2026
69 checks passed
@ericproulx
ericproulx deleted the refactor/module-length branch October 17, 2026 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant