Skip to content

Commit 69ad05c

Browse files
committed
rubocop -a
1 parent fdc37e8 commit 69ad05c

File tree

13 files changed

+43
-7
lines changed

13 files changed

+43
-7
lines changed

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
inherit_gem:
2-
rubocop-rails:
2+
rubocop-rails_config:
33
- config/rails.yml
44

55
AllCops:

Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,6 @@ gem "timeliness-i18n"
5252

5353
gem "cocoon"
5454
gem "acts_as_list"
55+
56+
gem "rubocop"
57+
gem "rubocop-rails_config"

Gemfile.lock

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ GEM
5252
acts_as_list (0.9.16)
5353
activerecord (>= 3.0)
5454
arel (9.0.0)
55+
ast (2.4.0)
5556
babel-source (5.8.35)
5657
babel-transpiler (0.7.0)
5758
babel-source (>= 4.0, < 6)
@@ -82,6 +83,7 @@ GEM
8283
activesupport (>= 4.2.0)
8384
i18n (1.1.0)
8485
concurrent-ruby (~> 1.0)
86+
jaro_winkler (1.5.1)
8587
jquery-rails (4.3.3)
8688
rails-dom-testing (>= 1, < 3)
8789
railties (>= 4.2.0)
@@ -105,6 +107,10 @@ GEM
105107
nio4r (2.3.1)
106108
nokogiri (1.8.4)
107109
mini_portile2 (~> 2.3.0)
110+
parallel (1.12.1)
111+
parser (2.5.1.2)
112+
ast (~> 2.4.0)
113+
powerpack (0.1.2)
108114
pry (0.11.3)
109115
coderay (~> 1.1.0)
110116
method_source (~> 0.9.0)
@@ -141,10 +147,23 @@ GEM
141147
method_source
142148
rake (>= 0.8.7)
143149
thor (>= 0.19.0, < 2.0)
150+
rainbow (3.0.0)
144151
rake (12.3.1)
145152
rb-fsevent (0.10.3)
146153
rb-inotify (0.9.10)
147154
ffi (>= 0.5.0, < 2)
155+
rubocop (0.58.2)
156+
jaro_winkler (~> 1.5.1)
157+
parallel (~> 1.10)
158+
parser (>= 2.5, != 2.5.1.1)
159+
powerpack (~> 0.1)
160+
rainbow (>= 2.2.2, < 4.0)
161+
ruby-progressbar (~> 1.7)
162+
unicode-display_width (~> 1.0, >= 1.0.1)
163+
rubocop-rails_config (0.2.3)
164+
railties (>= 3.0)
165+
rubocop (~> 0.56)
166+
ruby-progressbar (1.10.0)
148167
ruby_dep (1.5.0)
149168
sass (3.5.7)
150169
sass-listen (~> 4.0.0)
@@ -180,6 +199,7 @@ GEM
180199
thread_safe (~> 0.1)
181200
uglifier (4.1.18)
182201
execjs (>= 0.3.0, < 3)
202+
unicode-display_width (1.4.0)
183203
validates_timeliness (5.0.0.alpha3)
184204
timeliness (~> 0.3.8)
185205
web-console (3.7.0)
@@ -207,6 +227,8 @@ DEPENDENCIES
207227
pry-byebug
208228
pry-rails
209229
puma
230+
rubocop
231+
rubocop-rails_config
210232
sass-rails (~> 5.0)
211233
selectize-rails
212234
sprockets (~> 4.0.0.beta5)
@@ -218,4 +240,4 @@ DEPENDENCIES
218240
web-console
219241

220242
BUNDLED WITH
221-
1.16.2
243+
1.16.4

db/migrate/20170430190404_create_forms.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class CreateForms < ActiveRecord::Migration[5.1]
24
def change
35
create_table :forms do |t|

db/migrate/20170430191336_create_fields.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class CreateFields < ActiveRecord::Migration[5.1]
24
def change
35
create_table :fields do |t|

test/dummy/app/decorators/action_view/helpers/tags/date_field_decorator.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
ActionView::Helpers::Tags::DateField.class_eval do
24
def format_date(value)
35
value&.in_time_zone&.strftime("%Y-%m-%d")

test/dummy/app/decorators/action_view/helpers/tags/datetime_local_field_decorator.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
ActionView::Helpers::Tags::DatetimeLocalField.class_eval do
24
def format_date(value)
35
value&.in_time_zone&.strftime("%Y-%m-%dT%T")

test/dummy/app/lib/form_core/active_storage_bridge/attached/macros.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def #{name}=(attachable)
3434
else
3535
nil
3636
end
37-
37+
3838
super(blob&.id)
3939
end
4040
CODE
@@ -70,7 +70,7 @@ def #{name}=(attachables)
7070
nil
7171
end
7272
end
73-
73+
7474
super blobs.map(&:id).concat(ActiveStorage::Blob.where(id: ids).pluck(:id))
7575
end
7676
CODE

test/dummy/app/models/fields/multiple_nested_form_field.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def interpret_to(model, overrides: {})
1717
accessibility = overrides.fetch(:accessibility, self.accessibility)
1818
return model if accessibility == :hidden
1919

20-
overrides.merge!(name: name)
20+
overrides[:name] = name
2121

2222
nested_model = nested_form.to_virtual_model(overrides: {_global: {accessibility: accessibility}})
2323

test/dummy/config/initializers/actionview.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
ActionView::Base.field_error_proc = Proc.new do |html_tag, _instance|
4-
if html_tag =~ /<(input|label|textarea|select)/
4+
if /<(input|label|textarea|select)/.match?(html_tag)
55
html_field = Nokogiri::HTML::DocumentFragment.parse(html_tag)
66
html_field.children.add_class "is-danger"
77
html_field.to_s.html_safe

0 commit comments

Comments
 (0)