Skip to content

Commit

Permalink
Fix Layout/SpaceInsideBlockBraces RuboCop offenses
Browse files Browse the repository at this point in the history
... using auto-correct.
  • Loading branch information
eduardoj committed Jul 26, 2018
1 parent 47852c7 commit 2dcd37c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
9 changes: 0 additions & 9 deletions src/api/.rubocop_todo.yml
Expand Up @@ -123,15 +123,6 @@ Layout/SpaceAroundOperators:
- 'test/functional/request_controller_test.rb'
- 'test/functional/search_controller_test.rb'

# Offense count: 7
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
# SupportedStyles: space, no_space
# SupportedStylesForEmptyBraces: space, no_space
Layout/SpaceInsideBlockBraces:
Exclude:
- 'app/models/obs_factory/openqa_job.rb'

# Offense count: 4
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces.
Expand Down
6 changes: 3 additions & 3 deletions src/api/app/models/obs_factory/openqa_job.rb
Expand Up @@ -60,11 +60,11 @@ def self.find_all_by(args = {}, opt = {})
unless exclude_mod
# First, enrich the result with the modules information and cache
# the jobs per ISO
jobs.group_by {|j| (j['assets']['iso'].first rescue nil)}.each do |iso, iso_jobs|
jobs.group_by { |j| (j['assets']['iso'].first rescue nil) }.each do |iso, iso_jobs|
Rails.cache.write("openqa_jobs_for_iso_#{iso}", iso_jobs, expires_in: 2.minutes)
end
# And then, cache the list of ISOs
isos = jobs.map {|j| (j['assets']['iso'].first rescue nil)}.sort.compact.uniq
isos = jobs.map { |j| (j['assets']['iso'].first rescue nil) }.sort.compact.uniq
Rails.cache.write('openqa_isos', isos, expires_in: 2.minutes)
end
end
Expand Down Expand Up @@ -96,7 +96,7 @@ def self.find_all_by(args = {}, opt = {})
#
# @return [Array] array of module names
def failing_modules
modules.reject {|m| %w(passed softfailed running none).include? m['result']}.map {|m| m['name'] }
modules.reject { |m| %w(passed softfailed running none).include? m['result'] }.map { |m| m['name'] }
end

# Result of the job, or its state if no result is available yet
Expand Down

0 comments on commit 2dcd37c

Please sign in to comment.