Enable Style/SpaceAroundOperators Rubocop
Cleared all the offenses for Style/SpaceAroundOperators Added a description for the Style/SpaceAroundOperators Rubocop.
This commit is contained in:
parent
945b4aac60
commit
4a9c971ec7
11 changed files with 21 additions and 34 deletions
|
|
@ -101,7 +101,10 @@ Metrics/ClassLength:
|
||||||
Style/BracesAroundHashParameters:
|
Style/BracesAroundHashParameters:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
#
|
# Checks that operators have space around them, except for ** which should not have surrounding space.
|
||||||
|
Style/SpaceAroundOperators:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Style/CaseEquality:
|
Style/CaseEquality:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -594,22 +594,6 @@ Style/SpaceAroundBlockParameters:
|
||||||
Style/SpaceAroundEqualsInParameterDefault:
|
Style/SpaceAroundEqualsInParameterDefault:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
# Offense count: 12
|
|
||||||
# Cop supports --auto-correct.
|
|
||||||
# Configuration parameters: AllowForAlignment.
|
|
||||||
Style/SpaceAroundOperators:
|
|
||||||
Exclude:
|
|
||||||
- 'app/controllers/application_controller.rb'
|
|
||||||
- 'app/models/conference.rb'
|
|
||||||
- 'app/models/datatable.rb'
|
|
||||||
- 'app/models/event.rb'
|
|
||||||
- 'app/models/target.rb'
|
|
||||||
- 'app/models/ticket.rb'
|
|
||||||
- 'db/migrate/20141128073306_migrate_data_remove_column_include_cfp_in_splash_add_column_include_cfp.rb'
|
|
||||||
- 'db/migrate/20150417050953_add_url_to_commercial.rb'
|
|
||||||
- 'db/migrate/20151018152439_create_programs_table.rb'
|
|
||||||
- 'spec/models/conference_spec.rb'
|
|
||||||
|
|
||||||
# Offense count: 223
|
# Offense count: 223
|
||||||
# Cop supports --auto-correct.
|
# Cop supports --auto-correct.
|
||||||
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ class ApplicationController < ActionController::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_conferences
|
def get_conferences
|
||||||
@conferences =Conference.all
|
@conferences = Conference.all
|
||||||
end
|
end
|
||||||
|
|
||||||
def current_ability
|
def current_ability
|
||||||
|
|
|
||||||
|
|
@ -360,7 +360,7 @@ class Conference < ActiveRecord::Base
|
||||||
def affiliation_distribution
|
def affiliation_distribution
|
||||||
counted_affiliations = registrations.joins(:user).group(:affiliation).count
|
counted_affiliations = registrations.joins(:user).group(:affiliation).count
|
||||||
result = {}
|
result = {}
|
||||||
i=1
|
i = 1
|
||||||
others = 0
|
others = 0
|
||||||
none = 0
|
none = 0
|
||||||
counted_affiliations.each do |key, value|
|
counted_affiliations.each do |key, value|
|
||||||
|
|
@ -625,7 +625,7 @@ class Conference < ActiveRecord::Base
|
||||||
def hours_from_start_time(start_hour, end_hour)
|
def hours_from_start_time(start_hour, end_hour)
|
||||||
current_time = Time.find_zone(timezone).now
|
current_time = Time.find_zone(timezone).now
|
||||||
current_hour = current_time.strftime('%H').to_i
|
current_hour = current_time.strftime('%H').to_i
|
||||||
(start_hour..(end_hour-1)).cover?(current_hour) ? current_hour - start_hour : 0
|
(start_hour..(end_hour - 1)).cover?(current_hour) ? current_hour - start_hour : 0
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
@ -641,7 +641,7 @@ class Conference < ActiveRecord::Base
|
||||||
# consecutive colors clearly different.
|
# consecutive colors clearly different.
|
||||||
def next_color_component(component, i)
|
def next_color_component(component, i)
|
||||||
big_prime_numbers = {r: 113, g: 67, b: 151}
|
big_prime_numbers = {r: 113, g: 67, b: 151}
|
||||||
((i*big_prime_numbers[component])%239 + 16).to_s(16)
|
((i * big_prime_numbers[component]) % 239 + 16).to_s(16)
|
||||||
end
|
end
|
||||||
|
|
||||||
after_create do
|
after_create do
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ class Ticket < ActiveRecord::Base
|
||||||
def tickets_paid(user)
|
def tickets_paid(user)
|
||||||
paid_tickets = quantity_bought_by(user, paid: true)
|
paid_tickets = quantity_bought_by(user, paid: true)
|
||||||
unpaid_tickets = quantity_bought_by(user, paid: false)
|
unpaid_tickets = quantity_bought_by(user, paid: false)
|
||||||
"#{paid_tickets}/#{paid_tickets+unpaid_tickets}"
|
"#{paid_tickets}/#{paid_tickets + unpaid_tickets}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def quantity_bought_by(user, paid: false)
|
def quantity_bought_by(user, paid: false)
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ class MigrateDataRemoveColumnIncludeCfpInSplashAddColumnIncludeCfp < ActiveRecor
|
||||||
self.table_name = 'conferences'
|
self.table_name = 'conferences'
|
||||||
end
|
end
|
||||||
|
|
||||||
class TempCallForPaper< ActiveRecord::Base
|
class TempCallForPaper < ActiveRecord::Base
|
||||||
self.table_name = 'call_for_papers'
|
self.table_name = 'call_for_papers'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
class AddUrlToCommercial < ActiveRecord::Migration
|
class AddUrlToCommercial < ActiveRecord::Migration
|
||||||
class TempCommercial< ActiveRecord::Base
|
class TempCommercial < ActiveRecord::Base
|
||||||
self.table_name = 'commercials'
|
self.table_name = 'commercials'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
class CreateProgramsTable< ActiveRecord::Migration
|
class CreateProgramsTable < ActiveRecord::Migration
|
||||||
class TempConference < ActiveRecord::Base
|
class TempConference < ActiveRecord::Base
|
||||||
self.table_name = 'conferences'
|
self.table_name = 'conferences'
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue