• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ruby-grape / grape / 26340504005 / 33
97%
master: 97%

Build:
Build:
LAST BUILD BRANCH: refactor/validation-errors-drop-enumerable
DEFAULT BRANCH: master
Ran 24 May 2026 08:54PM UTC
Files 164
Run time 8s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

23 May 2026 06:39PM UTC coverage: 95.732% (+0.04%) from 95.691%
26340504005.33

Pull #2741

github

ericproulx
Readability pass: guard clauses, small refactors across lib/

Mostly cosmetic, no behavior change except where noted.

Guard-clause lifts (lift the short-circuit above the if/elsif/else,
let the main flow sit at top indentation):

- `Grape::DSL::Logger#logger`, `DSL::InsideRoute#stream`/`#return_no_content`
- `Grape::Formatter::SerializableHash#serialize`
- `Grape::Middleware::Base#merge_default_options`
- `Grape::Middleware::Error#redispatch`
- `Grape::Middleware::Formatter` (`call!`, `negotiate_content_type`)
- `Grape::Router::Pattern#build_path_from_pattern`
- `Grape::ServeStream::SendfileResponse#respond_to?`
- `Grape::Validations::ParamsScope#configure_declared_params`
- `Grape::Exceptions::ErrorResponse.coerce` (case/when reformatted)

Small extractions:

- `DSL::Entity#entity_class_for_obj`: extract `object_class(object)`
  private helper.
- `DSL::InsideRoute#status`: collapse Symbol/Integer branches and
  extract `default_status` private helper. Error message for an
  unknown status symbol now bubbles up `Rack::Utils.status_code`'s
  own message ("Unrecognized status code :foo_bar") instead of
  Grape's pre-validation message ("Status code :foo_bar is invalid.");
  spec updated.
- `DSL::InsideRoute#stream`: extract `stream_body(value)` private
  helper.
- `DSL::InsideRoute#return_no_content`: drop the redundant `status 204`
  call — `body false` already sets it via the `body` setter.

Minor: `return nil unless` → `return unless` in `Grape::API::Boolean.build`
and `PrimitiveCoercer#call`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Pull Request #2741: Readability pass: guard clauses + small refactors across lib/

1057 of 1167 branches covered (90.57%)

Branch coverage included in aggregate %.

3474 of 3566 relevant lines covered (97.42%)

991.07 hits per line

Source Files on job run-3.3-gemfiles/rails_8_1.gemfile - 26340504005.33
  • Tree
  • List 164
  • Changed 14
  • Source Changed 14
  • Coverage Changed 11
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 26340504005
  • da11b68a on github
  • Prev Job for on chore/readability-guard-clauses (#26292056269.13)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc