From d5b2229a8e83c253796bba1265cfbd76c9cb1953 Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Sun, 25 Oct 2020 03:51:27 +0900 Subject: [PATCH] Update doc for `Lint/FlipFlop` This PR updates doc for `Lint/FlipFlop` based on the change to flip-flop in Ruby 2.7. --- docs/modules/ROOT/pages/cops_lint.adoc | 10 ++++++++-- lib/rubocop/cop/lint/flip_flop.rb | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/docs/modules/ROOT/pages/cops_lint.adoc b/docs/modules/ROOT/pages/cops_lint.adoc index e2857c5f618..1b53e724de5 100644 --- a/docs/modules/ROOT/pages/cops_lint.adoc +++ b/docs/modules/ROOT/pages/cops_lint.adoc @@ -1534,8 +1534,14 @@ end | - |=== -This cop looks for uses of flip-flop operator. -flip-flop operator is deprecated since Ruby 2.6.0. +This cop looks for uses of flip-flop operator +based on the Ruby Style Guide. + +Here is the history of flip-flops in Ruby. +flip-flop operator is deprecated in Ruby 2.6.0 and +the deprecation has been reverted by Ruby 2.7.0 and +backported to Ruby 2.6. +See: https://bugs.ruby-lang.org/issues/5400 === Examples diff --git a/lib/rubocop/cop/lint/flip_flop.rb b/lib/rubocop/cop/lint/flip_flop.rb index b928ca02968..73211b59257 100644 --- a/lib/rubocop/cop/lint/flip_flop.rb +++ b/lib/rubocop/cop/lint/flip_flop.rb @@ -3,8 +3,14 @@ module RuboCop module Cop module Lint - # This cop looks for uses of flip-flop operator. - # flip-flop operator is deprecated since Ruby 2.6.0. + # This cop looks for uses of flip-flop operator + # based on the Ruby Style Guide. + # + # Here is the history of flip-flops in Ruby. + # flip-flop operator is deprecated in Ruby 2.6.0 and + # the deprecation has been reverted by Ruby 2.7.0 and + # backported to Ruby 2.6. + # See: https://bugs.ruby-lang.org/issues/5400 # # @example # # bad