Skip to content

Commit fb096d0

Browse files
committed
fix: rspec and rubocop
1 parent 12cedd1 commit fb096d0

File tree

7 files changed

+11
-9
lines changed

7 files changed

+11
-9
lines changed

.rubocop.yml

+3
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,6 @@ Lint/RescueWithoutErrorClass:
147147

148148
Lint/AmbiguousRegexpLiteral:
149149
Enabled: false
150+
151+
Metrics/ParameterLists:
152+
Max: 8

app/builders/admin_breadcrumbs_builder.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def render
1313
def render_element(element)
1414
last = element == @elements.last
1515
@context.content_tag(:li, class: "breadcrumb-item #{'active' if last}") do
16-
if element.path == nil || last
16+
if element.path.nil? || last
1717
compute_name(element)
1818
else
1919
@context.link_to_unless_current(compute_name(element), compute_path(element), element.options)

app/helpers/admin_helper.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -130,18 +130,18 @@ def admin_link_to(text, link, icon: nil, size: nil, color: nil, round: false, **
130130
end
131131
end
132132

133-
def admin_app_button_to(text, link, icon: , **html_opts)
133+
def admin_app_button_to(text, link, icon:, **html_opts)
134134
html_opts ||= {}
135135
admin_link_to(text, link, icon: icon, class: "btn-app #{html_opts.delete(:class)}", **html_opts)
136136
end
137137

138138
def admin_accordion(hash_data, &block)
139139
parent_id = 'accordion-parent' + hash_data.to_s.hash.to_s
140-
value = hash_data.map do |title, value|
140+
content = hash_data.map do |title, value|
141141
body = capture(title, value, &block)
142142
id = 'accordion' + "#{title}#{value}".hash.to_s
143143
render partial: 'admin/base/templates/accordion_item', locals: { title: title, body: body, id: id, parent_id: parent_id }
144144
end.join.html_safe
145-
render partial: 'admin/base/templates/accordion', locals: { content: value, id: parent_id }
145+
render partial: 'admin/base/templates/accordion', locals: { content: content, id: parent_id }
146146
end
147147
end

app/inputs/btn_group_input.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
class BtnGroupInput < SimpleForm::Inputs::CollectionRadioButtonsInput
22

33
# https://github.com/plataformatec/simple_form/blob/master/lib/simple_form/inputs/collection_radio_buttons_input.rb
4-
def input(wrapper_options = nil)
5-
4+
def input(_wrapper_options = nil)
65
label_method, value_method = detect_collection_methods
76

87
template.content_tag(:div, class: 'btn-group', 'data-toggle' => 'buttons') do

app/inputs/debug_sql_input.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def attribute_name
1515
:created_at_eq
1616
end
1717

18-
def label_text(*args)
18+
def label_text(*_args)
1919
'Debug SQL'
2020
end
2121
end

app/inputs/is_deleted_input.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def collection
77
[['Not Deleted', ''], ['Deleted', :only_deleted], ['All', :with_deleted]]
88
end
99

10-
def label_text(*args)
10+
def label_text(*_args)
1111
'Deleted'
1212
end
1313
end

spec/support/data_maker.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def data_for_category
1717

1818
def data_for_creating_category
1919
data_for_category.merge(
20-
tag_list: 'a,b,c'
20+
tag_list: ['a', 'b', 'c']
2121
)
2222
end
2323

0 commit comments

Comments
 (0)