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

ruby-grape / grape
97%
master: 97%

Build:
Build:
LAST BUILD BRANCH: refactor/de-morgan-conditions
DEFAULT BRANCH: master
Repo Added 04 Apr 2013 06:08AM UTC
Files 157
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

LAST BUILD ON BRANCH refactor/de-morgan-conditions
branch: SELECT
CHANGE BRANCH
x
  • No branch selected
  • DateFormat
  • Handle_json_array
  • ISSUE-2321
  • Issue-1908
  • active_support_6_1_minimal
  • add-agents-md
  • add_irb_in_gemfile_for_bundle_console_warning
  • add_rack_3_2_gemfile
  • add_rails_8_1_on_ci
  • add_ruby_3_4
  • add_ruby_4_0_cli
  • api_override_singleton_methods
  • body-metadata
  • bugfix/1577
  • bugfix/1970
  • bugfix/1986
  • bugfix/2041
  • bugfix/autoload
  • bugfix/memory-leak
  • build_with_registry
  • chore/cleanup-on-compilation
  • chore/coercion-tests
  • chore/guard-clause-cleanup
  • chore/primitive-coercer-spec
  • chore/readability-pass
  • clean_up_useless_dependencies
  • cleanup-deprecated-code
  • compiled_endpoints
  • contract_scope_validator_public_schema
  • cookies_delegation
  • crush_desclared_params
  • custom-validator-namespace-lookup
  • declared_params_optional_array
  • deprecated_endpoint_return
  • doc
  • doc/remove_manual_toc_and_toc_danger_check
  • doc/remove_toc
  • doc/update_reload_documentation_for_current_Rails_versions
  • docs/readme-typos-and-fixnum-cleanup
  • drop_ruby_3_0_as_7_0
  • drop_support_ruby_2_7_0
  • dynamic_registration
  • empty_string_and_bool
  • enable_branch_coverage
  • enable_frozen_string_literal_ci
  • endpoint_cleanup
  • entity-dsl
  • erik/remove-faulty-documentation-about-blank-values
  • exclude_ruby_3_2_rails_edge
  • exposes-to-s
  • extract_entity_dsl_and_kwargs_with
  • extract_testing_module
  • extract_translation
  • failing_spec_for_1967
  • faster_normalize_path
  • feature/endpoint-logger
  • feature/grape-api-setup-var-array
  • feature/hash-oneof-2385
  • feature/return_of_return
  • feature/warn-on-helper-overrides
  • feature_rack_lint
  • fix-636
  • fix-badges
  • fix-before-each-nil-nomethoderror
  • fix-docs
  • fix-helper-inheritance
  • fix-typo
  • fix/auth-base-subclass-issue-2669
  • fix/avoid_multiple_mounts_pollution
  • fix/cascade_reading_api_level
  • fix/custom-type-coercer-symbolize-collection
  • fix/reduce_base_route_array_allocation
  • fix/rescue-from-internal-errors-2482
  • fix/sendfile_test_fix
  • fix_2566_memory_leak
  • fix_all_media_types_regression
  • fix_before_each_no_method_error
  • fix_coercer_cache
  • fix_danger_workflow
  • fix_endpoint_status_when_not_calling_error!
  • fix_gh_workflow_annotations_warnings
  • fix_helpers_methods_in_public_scope
  • fix_leaky_slash
  • fix_middleware_keywords
  • fix_param_scope_thread_safety
  • fix_registry_warning_message
  • fix_require_logger
  • fix_routes_memoization
  • fix_shared_params_empty_args
  • fix_style_optional_boolean_parameter
  • format_header_best_q_match
  • funding
  • happy_rubocop
  • hook-readme
  • instance_to_s_delegation
  • issue-1775
  • issue-2385
  • lazy_block
  • lazy_compile
  • less_active_support_concern
  • less_parse_nested_query
  • master
  • migrate-danger-pr-comment
  • migrate-to-dry-configurable
  • mountable_apis
  • namespace_route_param_explicit_kwargs
  • optimize/parameters-extract-options-non-mutating
  • optimize_api_documentation
  • perf/avoid-empty-hash-merges
  • perf/precompute-middleware-caches
  • perf/request-hot-path-polish
  • perf/router-transaction-no-proc
  • perf/skip-validation-backtrace
  • perf/stackable-empty-singleton
  • perf/versioner-path-prefix
  • private_namespace_reverse_stackable_with_hash
  • private_within_namespace
  • rack_request_error
  • real-api-integration-test
  • reduce_array_alloc_on_setup
  • refactor/api-instance-dsl-modules
  • refactor/attrs_iterator
  • refactor/available-media-types-attr-reader
  • refactor/de-morgan-conditions
  • refactor/declared_availability
  • refactor/dsl-group-validators-dry
  • refactor/error-response-value-object
  • refactor/extract-handler-case-when
  • refactor/extract-path-normalizer
  • refactor/lazy-base-ancestor
  • refactor/named_kwargs_params_scope
  • refactor/replace-tap-usages
  • refactor/rescue-handler-dedup
  • refactor/router-pattern-delegation
  • refactor/router-simplification
  • refactor/validates-pure-helpers
  • refactor_available_media_types_in_header_middleware
  • refactor_declared_params_handling
  • refactor_http_headers
  • refactor_mime_type_for
  • refactor_route_setting_internal_usage
  • refactor_setting_get_or_set
  • refs/heads/master
  • refs/tags/v1.7.1
  • refs/tags/v1.8.0
  • refs/tags/v2.0.0
  • release/3.2.1
  • remove-unused-constant
  • remove_deprecated_param_builder_extensions
  • remove_instance_variable_defined
  • remove_namespace_reverse_stackable_from_public_interface
  • remove_namespace_stackable_and_inheritable_from_public_space
  • remove_namespace_stackable_with_hash_from_public_interface
  • remove_non_supported_jsonapi
  • remove_obsolete_docker_compose_version
  • remove_path_dup
  • remove_settings_unset_functions
  • remove_strict_hash_configuration
  • remove_test_prof
  • replace_try_by_respond_to
  • rescue_from
  • resolve_performace_issue_with_given
  • revert-1953-chore/micto-optimization-3
  • revert-wrong-commit
  • revisit_auth_middleware
  • revisit_endpoint_helpers_and_new
  • revisit_middleware_default_options
  • revisit_validators
  • ruby3_handling_argument_delegation
  • ruby_3_1_shorthand_kwargs
  • ruby_optimizations
  • ruby_style_send
  • skip_instrumentation_no_validators
  • skip_run_filters_on_empty
  • small_refactor_versioner_middleware
  • spec-only-rack-class
  • try_pattern_instead_of_respond_to
  • update_min_ruby_version_and_rubocop
  • update_return_upgrading_notes_and_simplify_execute
  • update_rubocop
  • update_rubocop_1_71_2
  • update_rubocop_and_autocorrect
  • upgrade-mustermann
  • upgrade-rubocop
  • upgrading-description
  • use_forwardable
  • use_require_relative_in_gemspec
  • v0.19.2
  • v1.0.0
  • v1.0.1
  • v1.0.2
  • v1.0.3
  • v1.1.0
  • v1.2.0
  • v1.2.1
  • v1.2.2
  • v1.2.3
  • v1.2.4
  • v1.2.5
  • v1.3.0
  • v1.3.1
  • v1.3.2
  • v1.3.3
  • v1.4.0
  • v1.5.0
  • v1.5.1
  • v2.1.0
  • v2.1.1
  • v2.1.2
  • v2.1.3
  • v2.2.0
  • v2.3.0
  • v2.4.0
  • v3.0.0
  • v3.0.1
  • v3.1.0
  • v3.1.1
  • v3.2.0
  • v3.2.1
  • valid_encoding_before_scrubing
  • validators_bad_encoding

09 May 2026 08:20PM UTC coverage: 97.007% (+0.02%) from 96.985%
25610885355

Pull #2707

github

ericproulx
Tighten six guard conditions via De Morgan / blank? / present? / include?

Six spots where an `if`/`unless` clause used multiple negations
joined by `&&` or `||`, or `&.any?` on a Hash. Each rewrite expresses
the positive shape of the predicate and keeps `if` over `unless`
where natural. Same behaviour, same allocation profile (one form
even reuses a previously-recomputed `Hash#except` result).

* `Grape::API::Boolean.build` —
  `val != true && val != false` → frozen `VALUES` constant +
  `unless VALUES.include?(val)`.

* `Grape::Request#make_params` —
  `routing_args&.any? { |k, _| k != :version && k != :route_info }` +
  separate `routing_args.except(:version, :route_info)` two lines
  later → compute `except` once, gate on `filtered.blank?`.

* `Grape::Validations::ParamsScope#check_incompatible_option_values`
  (early guard) —
  `return unless default && !default.is_a?(Proc)` →
  `return if default.nil? || default.is_a?(Proc)`.

* `Grape::Validations::ParamsScope#check_incompatible_option_values`
  (raise condition) —
  `!Array(default).all? { |v| values.include?(v) }` →
  `Array(default).any? { |v| !values.include?(v) }`.

* `Grape::Validations::Validators::Base#scrub` —
  `unless value.respond_to?(:valid_encoding?) && !value.valid_encoding?`
  → `if !value.respond_to?(:valid_encoding?) || value.valid_encoding?`.

* `Grape::DSL::Routing#route` —
  `route_options&.any?` → `route_options.present?`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Pull Request #2707: Tighten five guard conditions via De Morgan / blank? / include?

1082 of 1165 branches covered (92.88%)

Branch coverage included in aggregate %.

10 of 10 new or added lines in 5 files covered. (100.0%)

3423 of 3479 relevant lines covered (98.39%)

32165.44 hits per line

Relevant lines Covered
Build:
Build:
3479 RELEVANT LINES 3423 COVERED LINES
32165.44 HITS PER LINE
Source Files on master
  • Tree
  • List 157
  • Changed 5
  • Source Changed 5
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
25610885355 refactor/de-morgan-conditions Tighten six guard conditions via De Morgan / blank? / present? / include? Six spots where an `if`/`unless` clause used multiple negations joined by `&&` or `||`, or `&.any?` on a Hash. Each rewrite expresses the positive shape of the predicate an... Pull #2707 09 May 2026 08:20PM UTC ericproulx github
97.01
25610832363 refactor/de-morgan-conditions Tighten five guard conditions via De Morgan / blank? / include? Five spots where an `if`/`unless` clause used multiple negations joined by `&&` or `||`. Each rewrite expresses the positive shape of the predicate and keeps `if` over `unless` where... Pull #2707 09 May 2026 08:18PM UTC ericproulx github
96.99
25610816166 refactor/de-morgan-conditions Merge 28a97e1ab into 037476e62 Pull #2707 09 May 2026 08:17PM UTC web-flow github
96.99
25610805204 refactor/de-morgan-conditions Tighten five guard conditions via De Morgan / blank? / include? Five spots where an `if`/`unless` clause used multiple negations joined by `&&` or `||`. Each rewrite expresses the positive shape of the predicate and keeps `if` over `unless` where... push 09 May 2026 08:16PM UTC ericproulx github
96.99
25610530583 refactor/validates-pure-helpers Make ParamsScope#validates pure via ValidationsSpec `Grape::Validations::ParamsScope#validates(attrs, validations)` used to consume the validations hash destructively across six helpers (`infer_coercion`, `derive_validator_options`, `validates_pr... Pull #2706 09 May 2026 08:03PM UTC ericproulx github
96.99
25610457229 refactor/validates-pure-helpers Make ParamsScope#validates pure via ValidationsSpec `Grape::Validations::ParamsScope#validates(attrs, validations)` used to consume the validations hash destructively across six helpers (`infer_coercion`, `derive_validator_options`, `validates_pr... Pull #2706 09 May 2026 07:59PM UTC ericproulx github
96.99
25610197149 refactor/validates-pure-helpers Make ParamsScope#validates pure via ValidationsSpec `Grape::Validations::ParamsScope#validates(attrs, validations)` used to consume the validations hash destructively across six helpers (`infer_coercion`, `derive_validator_options`, `validates_pr... Pull #2706 09 May 2026 07:47PM UTC ericproulx github
96.99
25609976233 refactor/validates-pure-helpers Make ParamsScope#validates pure via ValidationsSpec `Grape::Validations::ParamsScope#validates(attrs, validations)` used to consume the validations hash destructively across six helpers (`infer_coercion`, `derive_validator_options`, `validates_pr... Pull #2706 09 May 2026 07:36PM UTC ericproulx github
96.99
25609944548 refactor/validates-pure-helpers Merge 46da66095 into 037476e62 Pull #2706 09 May 2026 07:34PM UTC web-flow github
96.99
25609895419 refactor/validates-pure-helpers Make ParamsScope#validates pure via ValidationsSpec `Grape::Validations::ParamsScope#validates(attrs, validations)` used to consume the validations hash destructively across six helpers (`infer_coercion`, `derive_validator_options`, `validates_pr... push 09 May 2026 07:32PM UTC ericproulx github
96.99
See All Builds (2888)
  • Repo on GitHub
  • CI Project
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