Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak document and message for Style/FlipFlop cop #6635

Merged
merged 1 commit into from Jan 8, 2019

Conversation

koic
Copy link
Member

@koic koic commented Jan 8, 2019

flip-flop operator is deprecated since Ruby 2.6.0.

The flip-flop syntax is deprecated. [Feature #5400]

% cat example.rb
(1..20).each do |x|
  puts x if (x == 5) .. (x == 10)
end

% ruby -v
ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-darwin17]

% ruby example.rb
example.rb:2: warning: flip-flop is deprecated
5
6
7
8
9
10

This PR tweaks document and offense message for Style/FlipFlop cop.
It will more clarify the reason for checking flip-flop operator.


Before submitting the PR make sure the following are checked:

  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Added an entry to the Changelog if the new code introduces user-observable changes. See changelog entry format.
  • The PR relates to only one subject with a clear title
    and description in grammatically correct, complete sentences.
  • Run bundle exec rake default. It executes all tests and RuboCop for itself, and generates the documentation.

flip-flop operator is deprecated since Ruby 2.6.0.

> The flip-flop syntax is deprecated. [Feature rubocop#5400]

- https://github.com/ruby/ruby/blob/v2_6_0/NEWS#language-changes
- https://bugs.ruby-lang.org/issues/5400

```console
% cat example.rb
(1..20).each do |x|
  puts x if (x == 5) .. (x == 10)
end

% ruby -v
ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-darwin17]

% ruby example.rb
example.rb:2: warning: flip-flop is deprecated
5
6
7
8
9
10
```

This PR tweaks document and offense message for `Style/FlipFlop` cop.
It will more clarify the reason for checking flip-flop operator.
@bbatsov
Copy link
Collaborator

bbatsov commented Jan 8, 2019

I guess now that's a lint cop then.

@bbatsov bbatsov merged commit 698e622 into rubocop:master Jan 8, 2019
@bbatsov
Copy link
Collaborator

bbatsov commented Jan 8, 2019

Thanks!

@koic koic deleted the update_doc_and_message_for_flip_flop branch January 8, 2019 10:33
@koic
Copy link
Member Author

koic commented Jan 8, 2019

I guess now that's a lint cop then.

Sure! I will move this cop from Style department to Lint department.

koic added a commit to koic/rubocop that referenced this pull request Jan 8, 2019
Follow up of rubocop#6635 (comment).

flip-flop operator is deprecated since Ruby 2.6.0.

> The flip-flop syntax is deprecated. [Feature rubocop#5400]

- https://github.com/ruby/ruby/blob/v2_6_0/NEWS#language-changes
- https://bugs.ruby-lang.org/issues/5400

This PR moves `FlipFlop` cop from `Style` department to `Lint` department.
bbatsov pushed a commit that referenced this pull request Jan 11, 2019
Follow up of #6635 (comment).

flip-flop operator is deprecated since Ruby 2.6.0.

> The flip-flop syntax is deprecated. [Feature #5400]

- https://github.com/ruby/ruby/blob/v2_6_0/NEWS#language-changes
- https://bugs.ruby-lang.org/issues/5400

This PR moves `FlipFlop` cop from `Style` department to `Lint` department.
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.

None yet

3 participants