Skip to content
This repository was archived by the owner on Aug 21, 2022. It is now read-only.

Commit bd8d649

Browse files
committed
style(rubocop): lint
1 parent 9ba90f9 commit bd8d649

File tree

14 files changed

+176
-23
lines changed

14 files changed

+176
-23
lines changed

.rubocop.yml

Lines changed: 158 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ require:
22
- 'rubocop-rails'
33

44
AllCops:
5-
TargetRubyVersion: '2.7.0'
5+
TargetRubyVersion: '2.7.1'
66
Exclude:
77
- 'bin/**/*'
88
- 'db/**/*'
@@ -22,9 +22,6 @@ Metrics/ClassLength:
2222
Metrics/CyclomaticComplexity:
2323
Enabled: false
2424

25-
Metrics/LineLength:
26-
Enabled: false
27-
2825
Metrics/MethodLength:
2926
Enabled: false
3027

@@ -50,7 +47,7 @@ Style/NumericLiterals:
5047
Enabled: false
5148

5249
Rails/SkipsModelValidations:
53-
Whitelist: ['increment!', 'touch']
50+
AllowedMethods: ['increment!', 'touch']
5451

5552
Naming/PredicateName:
5653
Enabled: false
@@ -61,5 +58,161 @@ Rails/Output:
6158
Lint/UnderscorePrefixedVariableName:
6259
Enabled: false
6360

61+
Lint/FormatParameterMismatch:
62+
Enabled: false
63+
6464
ApplicationController:
6565
Enabled: false
66+
67+
Layout/LineLength:
68+
Enabled: false
69+
70+
Layout/EmptyLinesAroundAttributeAccessor:
71+
Enabled: true
72+
73+
Layout/SpaceAroundMethodCallOperator:
74+
Enabled: true
75+
76+
Lint/DeprecatedOpenSSLConstant:
77+
Enabled: true
78+
79+
Lint/MixedRegexpCaptureTypes:
80+
Enabled: true
81+
82+
Lint/RaiseException:
83+
Enabled: true
84+
85+
Lint/StructNewOverride:
86+
Enabled: true
87+
88+
Lint/DuplicateElsifCondition:
89+
Enabled: true
90+
91+
Style/ExponentialNotation:
92+
Enabled: true
93+
94+
Style/HashEachMethods:
95+
Enabled: true
96+
97+
Style/HashTransformKeys:
98+
Enabled: true
99+
100+
Style/HashTransformValues:
101+
Enabled: true
102+
103+
Style/RedundantRegexpCharacterClass:
104+
Enabled: true
105+
106+
Style/RedundantRegexpEscape:
107+
Enabled: true
108+
109+
Style/SlicingWithRange:
110+
Enabled: true
111+
112+
Style/RedundantFetchBlock:
113+
Enabled: true
114+
115+
Style/AccessorGrouping:
116+
Enabled: true
117+
118+
Style/BisectedAttrAccessor:
119+
Enabled: true
120+
121+
Style/RedundantAssignment:
122+
Enabled: true
123+
124+
Style/ArrayCoercion:
125+
Enabled: true
126+
127+
Style/CaseLikeIf:
128+
Enabled: true
129+
130+
Style/HashAsLastArrayItem:
131+
Enabled: true
132+
133+
Style/HashLikeCase:
134+
Enabled: true
135+
136+
Style/RedundantFileExtensionInRequire:
137+
Enabled: true
138+
139+
Rails/ActiveRecordCallbacksOrder:
140+
Enabled: true
141+
142+
Rails/FindById:
143+
Enabled: true
144+
145+
Rails/Inquiry:
146+
Enabled: true
147+
148+
Rails/MailerName:
149+
Enabled: true
150+
151+
Rails/MatchRoute:
152+
Enabled: true
153+
154+
Rails/NegateInclude:
155+
Enabled: true
156+
157+
Rails/Pluck:
158+
Enabled: true
159+
160+
Rails/PluckId:
161+
Enabled: true
162+
163+
Rails/PluckInWhere:
164+
Enabled: true
165+
166+
Rails/RenderInline:
167+
Enabled: true
168+
169+
Rails/RenderPlainText:
170+
Enabled: true
171+
172+
Rails/ShortI18n:
173+
Enabled: true
174+
175+
Rails/WhereExists:
176+
Enabled: true
177+
178+
Lint/BinaryOperatorWithIdenticalOperands:
179+
Enabled: true
180+
181+
Lint/DuplicateRescueException:
182+
Enabled: true
183+
184+
Lint/EmptyConditionalBody:
185+
Enabled: true
186+
187+
Lint/FloatComparison:
188+
Enabled: true
189+
190+
Lint/MissingSuper:
191+
Enabled: true
192+
193+
Lint/OutOfRangeRegexpRef:
194+
Enabled: true
195+
196+
Lint/SelfAssignment:
197+
Enabled: true
198+
199+
Lint/TopLevelReturnWithArgument:
200+
Enabled: true
201+
202+
Lint/UnreachableLoop:
203+
Enabled: true
204+
205+
Style/ExplicitBlockArgument:
206+
Enabled: true
207+
208+
Style/GlobalStdStream:
209+
Enabled: true
210+
211+
Style/OptionalBooleanParameter:
212+
Enabled: true
213+
214+
Style/SingleArgumentDig:
215+
Enabled: true
216+
217+
Style/StringConcatenation:
218+
Enabled: true

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ gem 'batch-loader'
8888
gem 'order_as_specified'
8989

9090
# A performance dashboard for Postgres
91-
gem 'pg_query', '>= 0.9.0'
9291
gem 'pghero'
92+
gem 'pg_query', '>= 0.9.0'
9393

9494
# deploy
9595
gem 'mina', require: false

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,13 +340,13 @@ GEM
340340
mime-types (>= 1.16, < 4.0)
341341
netrc (~> 0.8)
342342
rexml (3.2.4)
343-
rubocop (0.88.0)
343+
rubocop (0.89.1)
344344
parallel (~> 1.10)
345345
parser (>= 2.7.1.1)
346346
rainbow (>= 2.2.2, < 4.0)
347347
regexp_parser (>= 1.7)
348348
rexml
349-
rubocop-ast (>= 0.1.0, < 1.0)
349+
rubocop-ast (>= 0.3.0, < 1.0)
350350
ruby-progressbar (~> 1.7)
351351
unicode-display_width (>= 1.4.0, < 2.0)
352352
rubocop-ast (0.3.0)

app/controllers/admin/base_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ def admin_sign_out
3131
end
3232

3333
def from_graphql_introspection
34-
Rails.env.development? && request.headers['Authorization'] == Rails.application.credentials.dig(:graphql_introspection_token)
34+
Rails.env.development? && request.headers['Authorization'] == Rails.application.credentials[:graphql_introspection_token]
3535
end
3636
end

app/controllers/application_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def user_sign_out
3434
end
3535

3636
def from_graphql_introspection
37-
Rails.env.development? && request.headers['Authorization'] == Rails.application.credentials.dig(:graphql_introspection_token)
37+
Rails.env.development? && request.headers['Authorization'] == Rails.application.credentials[:graphql_introspection_token]
3838
end
3939

4040
def base_props

app/models/mixin_group.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# index_mixin_groups_on_creator_id (creator_id)
2222
#
2323
class MixinGroup < ApplicationRecord
24-
belongs_to :creator, class_name: 'User', primary_key: :mixin_uuid, foreign_key: :creator_id, inverse_of: false
24+
belongs_to :creator, class_name: 'User', primary_key: :mixin_uuid, inverse_of: false
2525

2626
before_validation :set_attributes
2727
after_create :find_or_create_participants!

app/models/multisig_account.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# index_multisig_accounts_on_member_uuids (member_uuids)
2222
#
2323
class MultisigAccount < ApplicationRecord
24-
belongs_to :creator, class_name: 'User', foreign_key: :creator_id, inverse_of: false
24+
belongs_to :creator, class_name: 'User', inverse_of: false
2525

2626
has_many :multisig_account_members, dependent: :nullify
2727
has_many :members, through: :multisig_account_members, source: :user

app/models/multisig_payment.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
# index_multisig_payments_on_trace_id (trace_id) UNIQUE
2929
#
3030
class MultisigPayment < ApplicationRecord
31-
belongs_to :creator, class_name: 'User', foreign_key: :creator_id, inverse_of: :created_payments
31+
belongs_to :creator, class_name: 'User', inverse_of: :created_payments
3232
belongs_to :multisig_account
33-
belongs_to :asset, primary_key: :asset_id, foreign_key: :asset_id, inverse_of: false
33+
belongs_to :asset, primary_key: :asset_id, inverse_of: false
3434

3535
before_validation :set_attributes, on: :create
3636

app/models/multisig_transaction.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class MultisigTransaction < ApplicationRecord
3333

3434
belongs_to :user
3535
belongs_to :multisig_account
36-
belongs_to :asset, primary_key: :asset_id, foreign_key: :asset_id, inverse_of: false
36+
belongs_to :asset, primary_key: :asset_id, inverse_of: false
3737

3838
before_validation :set_attributes, on: :create
3939

config/clock.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Initialize sidekiq
44
require 'sidekiq'
5-
require_relative './initializers/sidekiq.rb'
5+
require_relative './initializers/sidekiq'
66
def sidekiq_perform_async(worker_name)
77
::Sidekiq::Client.push('class' => worker_name, 'args' => [])
88
end

0 commit comments

Comments
 (0)