Skip to content

Commit

Permalink
Revert leftover deprecated arguments from 1163 (#1188)
Browse files Browse the repository at this point in the history
* Revert leftover deprecated arguments from 1163

* Create spotty-rats-hide.md

* revert tests
  • Loading branch information
joelhawksley committed Jun 8, 2022
1 parent 4601124 commit fb7218a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 41 deletions.
5 changes: 5 additions & 0 deletions .changeset/spotty-rats-hide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/view-components": patch
---

Revert leftover deprecated arguments from 1163.
16 changes: 0 additions & 16 deletions lib/rubocop/cop/primer/deprecated_arguments.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,6 @@ class DeprecatedArguments < BaseCop
# }
#
DEPRECATED = {
is_label_inline: {
true => nil,
false => nil
},
with_icon: {
true => nil,
false => nil
},
is_label_visible: {
false => "visually_hide_label: true",
true => "visually_hide_label: false"
},
is_clearable: {
false => "show_clear_button: false",
true => "show_clear_button: true"
},
bg: {
white: "bg: :primary",
gray_light: "bg: :secondary",
Expand Down
25 changes: 0 additions & 25 deletions test/rubocop/deprecated_arguments_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,29 +58,4 @@ def test_deprecated_argument_with_nil_not_autocorrected
assert_equal 1, cop.offenses.count
refute cop.offenses.first.correctable?
end

def test_supports_boolean_values
investigate(cop, <<-RUBY)
Primer::Beta::AutoComplete.new(is_label_visible: false)
RUBY

assert_equal 1, cop.offenses.count
assert_equal "Primer::Beta::AutoComplete.new(visually_hide_label: true)", cop.offenses.first.corrector.rewrite.strip
end

def test_identifies_is_label_inline
investigate(cop, <<-RUBY)
Primer::Beta::AutoComplete.new(label_text: "User", is_label_inline: true)
RUBY

assert_equal 1, cop.offenses.count
end

def test_identifies_with_icon
investigate(cop, <<-RUBY)
Primer::Beta::AutoComplete.new(label_text: "User", with_icon: true)
RUBY

assert_equal 1, cop.offenses.count
end
end

0 comments on commit fb7218a

Please sign in to comment.