From 38cafded8a61fc366207c0b78f3aaa7c2df4ceb1 Mon Sep 17 00:00:00 2001 From: Eugene Kenny Date: Fri, 10 Jul 2020 21:46:40 +0100 Subject: [PATCH] Mark Performance/AncestorsInclude as unsafe We can't tell whether the receiver is a class or an object. --- CHANGELOG.md | 4 ++++ config/default.yml | 1 + docs/modules/ROOT/pages/cops_performance.adoc | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41db0807bd..df8e78e0a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## master (unreleased) +### Changes + +* [#149](/~https://github.com/rubocop-hq/rubocop-performance/pull/149): Mark `Performance/AncestorsInclude` as unsafe. ([@eugeneius][]) + ## 1.7.0 (2020-07-07) ### New features diff --git a/config/default.yml b/config/default.yml index cd2acdbbc3..00618564e0 100644 --- a/config/default.yml +++ b/config/default.yml @@ -4,6 +4,7 @@ Performance/AncestorsInclude: Description: 'Use `A <= B` instead of `A.ancestors.include?(B)`.' Reference: '/~https://github.com/JuanitoFatas/fast-ruby#ancestorsinclude-vs--code' Enabled: 'pending' + Safe: false VersionAdded: '1.7' Performance/BigDecimalWithNumericArgument: diff --git a/docs/modules/ROOT/pages/cops_performance.adoc b/docs/modules/ROOT/pages/cops_performance.adoc index c95695c125..61c786f132 100644 --- a/docs/modules/ROOT/pages/cops_performance.adoc +++ b/docs/modules/ROOT/pages/cops_performance.adoc @@ -6,8 +6,8 @@ | Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged | Pending -| Yes -| Yes +| No +| Yes (Unsafe) | 1.7 | - |===