Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.

Commit

Permalink
update rubocop to 0.52.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoll committed Jan 7, 2018
1 parent b065376 commit 547cddf
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ inherit_from:

AllCops:
TargetRubyVersion: 2.2
TargetRailsVersion: 4.2
TargetRailsVersion: 5.1

Rails:
Enabled: true
Expand Down
23 changes: 17 additions & 6 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2018-01-07 04:22:08 +0100 using RuboCop version 0.52.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 2
Lint/HandleExceptions:
Exclude:
Expand All @@ -8,12 +16,6 @@ Lint/RescueException:
Exclude:
- 'lib/foreman_xen/vnc_tunnel.rb'

# Offense count: 9
Lint/RescueWithoutErrorClass:
Exclude:
- 'app/models/foreman_xen/xenserver.rb'
- 'lib/foreman_xen/engine.rb'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
Expand Down Expand Up @@ -71,3 +73,12 @@ Metrics/ParameterLists:
# Offense count: 4
Metrics/PerceivedComplexity:
Max: 13

# Offense count: 9
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: implicit, explicit
Style/RescueStandardError:
Exclude:
- 'app/models/foreman_xen/xenserver.rb'
- 'lib/foreman_xen/engine.rb'
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ rvm:
- 2.2.3
- 2.3.1
- 2.4.2
- 2.5.0
before_install:
- gem update --remote bundler
install:
Expand Down
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ source 'https://rubygems.org'

gemspec

gem 'nokogiri', '< 1.7', require: false if RUBY_VERSION.start_with? '2.0.'
gem 'rubocop', '~> 0.51.0', require: false
gem 'rubocop', '~> 0.52.1', require: false
4 changes: 1 addition & 3 deletions app/controllers/foreman_xen/snapshots_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,7 @@ def new
def create
id = params[:id]
name = params[:name]
if name.nil? || name == ''
process_error(:error_msg => 'You must supply a name.')
end
process_error(:error_msg => 'You must supply a name.') if name.nil? || name == ''
@host = get_host_by_id(id)
if !@host.nil?
@compute_resource = get_compute_resource_by_host_id(id)
Expand Down
8 changes: 2 additions & 6 deletions app/helpers/xen_compute_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ def compute_resource_controller_attribute_map(params, compute_resource)
elsif params && params['host'] && params['host']['compute_profile_id']
compute_attributes = compute_resource.compute_profile_attributes_for(params['host']['compute_profile_id'])
end
if compute_attributes
attribute_map = filter_compute_attributes(attribute_map, compute_attributes)
end
attribute_map = filter_compute_attributes(attribute_map, compute_attributes) if compute_attributes
attribute_map
end

Expand All @@ -78,9 +76,7 @@ def filter_compute_attributes(attribute_map, compute_attributes)
attribute_map[:volume_size] = compute_attributes['VBDs']['physical_size']
attribute_map[:volume_selected] = compute_attributes['VBDs']['sr_uuid']
end
if compute_attributes['VIFs']
attribute_map[:network_selected] = compute_attributes['VIFs']['print']
end
attribute_map[:network_selected] = compute_attributes['VIFs']['print'] if compute_attributes['VIFs']
attribute_map[:template_selected_custom] = compute_attributes['custom_template_name']
attribute_map[:template_selected_builtin] = compute_attributes['builtin_template_name']
attribute_map[:cpu_count] = compute_attributes['vcpus_max']
Expand Down

0 comments on commit 547cddf

Please sign in to comment.