From 4042c4ad0d33ab4e469a2dcc153c5c4b2410f525 Mon Sep 17 00:00:00 2001 From: safa Date: Thu, 16 Nov 2023 14:00:41 +0100 Subject: [PATCH 1/3] Change spree_default_credit_card_deperecated cop severity to warning --- .../cop/solidus/spree_default_credit_card_deprecated.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/rubocop/cop/solidus/spree_default_credit_card_deprecated.rb b/lib/rubocop/cop/solidus/spree_default_credit_card_deprecated.rb index d7f34ec..27ca95a 100644 --- a/lib/rubocop/cop/solidus/spree_default_credit_card_deprecated.rb +++ b/lib/rubocop/cop/solidus/spree_default_credit_card_deprecated.rb @@ -14,7 +14,6 @@ module Solidus # user.wallet.default_wallet_payment_source # class SpreeDefaultCreditCardDeprecated < Base - extend AutoCorrector include TargetSolidusVersion minimum_solidus_version 2.2 @@ -27,9 +26,7 @@ class SpreeDefaultCreditCardDeprecated < Base def on_send(node) return unless default_credit_card?(node) - add_offense(node) do |corrector| - corrector.replace(node, node.source.gsub('default_credit_card', 'wallet.default_wallet_payment_source')) - end + add_offense(node, severity: :warning) end end end From b0a50f56a3872626831ad2bb828fd1d37f298dae Mon Sep 17 00:00:00 2001 From: safa Date: Thu, 16 Nov 2023 14:06:49 +0100 Subject: [PATCH 2/3] Update Changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ece96da..828d951 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ ### New features * [#25](https://github.com/solidusio/rubocop-solidus/issues/25): Add solidus/tax_category_deprecated warning cop. ([@safafa][]) +### Bug fixes + +* [#53](https://github.com/solidusio/rubocop-solidus/pull/53): Change spree_default_credit_card_deperecated cop severity to warning. ([@safafa][]) ## 0.2.0 (2023-11-02) From 1e5577301dc5dacde27366463b7b89da8e1bc75e Mon Sep 17 00:00:00 2001 From: safa Date: Fri, 24 Nov 2023 17:56:00 +0100 Subject: [PATCH 3/3] Update documentation --- docs/cops_solidus.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/cops_solidus.md b/docs/cops_solidus.md index f8786d9..9b0a79b 100644 --- a/docs/cops_solidus.md +++ b/docs/cops_solidus.md @@ -164,7 +164,7 @@ Spree::Calculator::PriceSack Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged | Required Solidus Version --- | --- | --- | --- | --- | --- -Enabled | Yes | Yes | 0.1 | - | 2.2 +Enabled | Yes | No | 0.1 | - | 2.2 This cop finds user.default_credit_card suggest using user.wallet.default_wallet_payment_source.