A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/rubocop/rubocop/issues/14362 below:

False positive registering of offense by Lint/RequireRangeParentheses when Date range has line break (non endless range) · Issue #14362 · rubocop/rubocop · GitHub

After rubocop -A, one line was "linebroken" by Rubocop and failed with Lint/RequireRangeParentheses

Expected behavior

Rubocop should not register offense when there is no endless range in the node.

Actual behavior

It registers Lint/RequireRangeParentheses when Date ranges have linebreaks, even thou there is no endless range.

Steps to reproduce the problem

To reproduce it, add the following spec to spec/rubocop/cop/lint/require_range_parentheses_spec.rb :

  it 'does not register an offense when there is a line break in a date range' do
    expect_no_offenses(<<~RUBY)
      Date.new(1989, 0o1, 
        0o1)..Date.new(1989, 12, 31)
    RUBY
  end

The spec above should pass.

RuboCop version

The above code fails against master commit 3a634136b9d92cc881bb4e6659093ad48940a4ac.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4