Skip to content

Commit

Permalink
Rubocop fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bdunne committed Sep 19, 2023
1 parent cf8d28c commit 4ee001e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
20 changes: 9 additions & 11 deletions lib/manageiq/style/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,14 @@ def install
private

def check_for_codeclimate_channel
begin
require 'open-uri'
URI::HTTPS.build(
:host => "raw.githubusercontent.com",
:path => File.join("/codeclimate", "codeclimate-rubocop", "channel", cc_rubocop_channel, "Gemfile")
).open
rescue OpenURI::HTTPError
puts "RuboCop version #{rubocop_version.version} is not supported by CodeClimate."
exit 1
end
require 'open-uri'
URI::HTTPS.build(
:host => "raw.githubusercontent.com",
:path => File.join("/codeclimate", "codeclimate-rubocop", "channel", cc_rubocop_channel, "Gemfile")
).open
rescue OpenURI::HTTPError
puts "RuboCop version #{rubocop_version.version} is not supported by CodeClimate."
exit 1
end

def update_rubocop_yml(file = ".rubocop.yml")
Expand Down Expand Up @@ -213,7 +211,7 @@ def format_gem_source_lines!(lines)
indent = lines.first.match(/^\s+/).to_s

lines.map! { |l| l.strip.gsub(/[()]/, " ").split(" ", 3) } # Split to [prefix, gem, versions]
lines.each { |parts| parts[1].tr!("'", "\"")} # Ensure double quoted gem name
lines.each { |parts| parts[1].tr!("'", "\"") } # Ensure double quoted gem name
max_width = lines.map { |parts| parts[1].size }.max # Determine the widest gem name
lines.each { |parts| parts[1] = parts[1].ljust(max_width, " ") } # Apply the width
lines.map! { |parts| parts.join(" ").strip.insert(0, indent) << "\n" } # Back to strings
Expand Down
2 changes: 1 addition & 1 deletion lib/manageiq/style/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module ManageIQ
module Style
VERSION = "1.3.3"
VERSION = "1.3.3".freeze
end
end

0 comments on commit 4ee001e

Please sign in to comment.