Skip to content

Commit 9dbeb2e

Browse files
Bump standardrb to 1.0.1 (#636)
* Bump standardrb to 1.0.1 * Run standardrb --fix after upgrade * Regenerate standard_todo file * Remove rubocop.yml now that standardrb is used * Regen todo file and patch a file todo was not workting properly with * Remove rubocop-rails
1 parent 70e2a40 commit 9dbeb2e

18 files changed

Lines changed: 68 additions & 57 deletions

File tree

backend/.rubocop.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.

backend/.standard_todo.yml

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,32 @@
22
# Remove from this list as you refactor files.
33
---
44
ignore:
5-
- app/controllers/api/v1/aws_ses_controller.rb
6-
- app/controllers/api/v1/profiles_controller.rb
7-
- app/controllers/api/v1/sessions_controller.rb
8-
- app/jobs/group_top_posts_job.rb
9-
- app/models/search.rb
10-
- app/services/charts_pattern.rb
11-
- config/initializers/00_app.rb
12-
- config/puma.rb
13-
- config/routes.rb
14-
- lib/tasks/app.rake
15-
- lib/tasks/hbi_completeness.rake
16-
- lib/tasks/trackables.rake
17-
- lib/tasks/usda.rake
18-
- spec/models/food_spec.rb
19-
- spec/spec_helper.rb
5+
- app/controllers/api/v1/aws_ses_controller.rb:
6+
- Security/Open
7+
- app/controllers/api/v1/profiles_controller.rb:
8+
- Style/SafeNavigation
9+
- app/controllers/api/v1/sessions_controller.rb:
10+
- Style/SafeNavigation
11+
- app/jobs/group_top_posts_job.rb:
12+
- Style/SafeNavigation
13+
- app/models/search.rb:
14+
- Lint/Void
15+
- app/services/charts_pattern.rb:
16+
- Lint/DuplicateMethods
17+
- Layout/SpaceInsideHashLiteralBraces
18+
- Style/QuotedSymbols
19+
- lib/tasks/app.rake:
20+
- Lint/ConstantDefinitionInBlock
21+
- Style/GlobalStdStream
22+
- Lint/Loop
23+
- lib/tasks/hbi_completeness.rake:
24+
- Lint/ConstantDefinitionInBlock
25+
- lib/tasks/trackables.rake:
26+
- Lint/ConstantDefinitionInBlock
27+
- Lint/UselessAssignment
28+
- lib/tasks/usda.rake:
29+
- Lint/ConstantDefinitionInBlock
30+
- spec/models/food_spec.rb:
31+
- Lint/ConstantDefinitionInBlock
32+
- spec/spec_helper.rb:
33+
- Style/StringLiterals

backend/Gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ group :development do
8686
gem "better_errors", "~>2.1"
8787
gem "foreman", require: false
8888
gem "letter_opener"
89-
gem "rubocop-rails", require: false
9089
end
9190

9291
group :test do

backend/Gemfile.lock

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ GEM
191191
i18n (1.14.1)
192192
concurrent-ruby (~> 1.0)
193193
i18n_data (0.13.0)
194+
json (2.6.3)
195+
json (2.6.3-java)
194196
jwt (2.3.0)
195197
kaminari-actionview (1.2.1)
196198
actionview
@@ -200,10 +202,12 @@ GEM
200202
kaminari-core (~> 1.0)
201203
mongoid
202204
kdtree (0.4)
205+
language_server-protocol (3.17.0.3)
203206
launchy (2.5.2)
204207
addressable (~> 2.8)
205208
letter_opener (1.8.1)
206209
launchy (>= 2.2, < 3)
210+
lint_roller (1.1.0)
207211
loofah (2.21.3)
208212
crass (~> 1.0.2)
209213
nokogiri (>= 1.12.0)
@@ -377,24 +381,21 @@ GEM
377381
rspec-mocks (~> 3.12)
378382
rspec-support (~> 3.12)
379383
rspec-support (3.12.1)
380-
rubocop (1.20.0)
384+
rubocop (1.52.1)
385+
json (~> 2.3)
381386
parallel (~> 1.10)
382-
parser (>= 3.0.0.0)
387+
parser (>= 3.2.2.3)
383388
rainbow (>= 2.2.2, < 4.0)
384389
regexp_parser (>= 1.8, < 3.0)
385-
rexml
386-
rubocop-ast (>= 1.9.1, < 2.0)
390+
rexml (>= 3.2.5, < 4.0)
391+
rubocop-ast (>= 1.28.0, < 2.0)
387392
ruby-progressbar (~> 1.7)
388-
unicode-display_width (>= 1.4.0, < 3.0)
393+
unicode-display_width (>= 2.4.0, < 3.0)
389394
rubocop-ast (1.29.0)
390395
parser (>= 3.2.1.0)
391-
rubocop-performance (1.11.5)
396+
rubocop-performance (1.18.0)
392397
rubocop (>= 1.7.0, < 2.0)
393398
rubocop-ast (>= 0.4.0)
394-
rubocop-rails (2.15.2)
395-
activesupport (>= 4.2.0)
396-
rack (>= 1.1)
397-
rubocop (>= 1.7.0, < 2.0)
398399
ruby-progressbar (1.13.0)
399400
ruby2_keywords (0.0.5)
400401
seedbank (0.5.0)
@@ -422,10 +423,19 @@ GEM
422423
actionpack (>= 5.2)
423424
activesupport (>= 5.2)
424425
sprockets (>= 3.0.0)
425-
standard (1.3.0)
426-
rubocop (= 1.20.0)
427-
rubocop-performance (= 1.11.5)
428-
standardrb (1.0.0)
426+
standard (1.30.1)
427+
language_server-protocol (~> 3.17.0.2)
428+
lint_roller (~> 1.0)
429+
rubocop (~> 1.52.0)
430+
standard-custom (~> 1.0.0)
431+
standard-performance (~> 1.1.0)
432+
standard-custom (1.0.2)
433+
lint_roller (~> 1.0)
434+
rubocop (~> 1.50)
435+
standard-performance (1.1.2)
436+
lint_roller (~> 1.1)
437+
rubocop-performance (~> 1.18.0)
438+
standardrb (1.0.1)
429439
standard
430440
symmetric-encryption (4.4.0)
431441
coercible (~> 1.0)
@@ -505,7 +515,6 @@ DEPENDENCIES
505515
rails_12factor
506516
rake
507517
rspec-rails
508-
rubocop-rails
509518
ruby-progressbar
510519
seedbank
511520
shoulda-matchers

backend/app/controllers/api/v1/charts_pattern_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ def index
88
start_at = (charts_pattern_params[:start_at].to_date - offset.days).to_s
99

1010
end_date = charts_pattern_params[:end_at].to_date
11-
end_at = (Time.current.to_date == end_date ? end_date : (end_date + offset.days)).to_s
11+
end_at = ((Time.current.to_date == end_date) ? end_date : (end_date + offset.days)).to_s
1212

13-
@patterns = Pattern.where(id: {'$in': charts_pattern_params[:pattern_ids] || []})
13+
@patterns = Pattern.where(id: {"$in": charts_pattern_params[:pattern_ids] || []})
1414

1515
@extended_patterns = @patterns.map do |pattern|
1616
pattern.extend(PatternExtender).form_chart_data(start_at: start_at,

backend/app/jobs/merge_trackables/dispatcher.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ class MergeTrackables::Dispatcher
33

44
def perform(trackable_type, translation = nil)
55
trackable_class = trackable_type.capitalize.constantize
6-
searchable_attr = trackable_class.name == "Food" ? "long_desc" : "name"
6+
searchable_attr = (trackable_class.name == "Food") ? "long_desc" : "name"
77

88
return find_duplicates(trackable_type, trackable_class, translation, searchable_attr) if translation.present?
99

backend/app/jobs/same_trackables_job.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def perform(options)
66
translation = options["translation"]
77

88
trackable_class = trackable_type.capitalize.constantize
9-
searchable_attr = trackable_class.name == "Food" ? "long_desc" : "name"
9+
searchable_attr = (trackable_class.name == "Food") ? "long_desc" : "name"
1010

1111
[].tap do |array|
1212
if translation.present?

backend/app/models/notification.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Notification
1919
index notificateable_id: 1, notificateable_type: 1
2020

2121
def set_defaults
22-
assign_attributes(post_id: (notificateable._type == "Comment" ? notificateable.post_id : notificateable.id).to_s)
22+
assign_attributes(post_id: ((notificateable._type == "Comment") ? notificateable.post_id : notificateable.id).to_s)
2323
end
2424

2525
class << self

backend/app/models/post.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def update_counters
2929
end
3030

3131
def self.fts(q)
32-
where('$text': {'$search': q, '$language': I18n.locale.to_s})
32+
where("$text": {"$search": q, "$language": I18n.locale.to_s})
3333
end
3434

3535
def self.by_followings(followings)

backend/app/models/profile.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def age
9999
today = Time.zone.today
100100
age = today.year - birth_date.year
101101

102-
today < birth_date + age.years ? age - 1 : age
102+
(today < birth_date + age.years) ? age - 1 : age
103103
end
104104

105105
def ethnicity_ids

0 commit comments

Comments
 (0)