Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix multiple rubocop violations #291

Closed
wants to merge 36 commits into from

Conversation

bastelfreak
Copy link
Member

No description provided.

@bastelfreak bastelfreak self-assigned this Mar 17, 2023
@bastelfreak bastelfreak requested a review from ekohl March 17, 2023 11:48
@codecov
Copy link

codecov bot commented Mar 17, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.17 🎉

Comparison is base (accd9df) 0.50% compared to head (abdb1a6) 0.68%.

❗ Current head abdb1a6 differs from pull request most recent head aae6506. Consider uploading reports for the commit aae6506 to get more accurate results

Additional details and impacted files
@@            Coverage Diff            @@
##           master    #291      +/-   ##
=========================================
+ Coverage    0.50%   0.68%   +0.17%     
=========================================
  Files          15      15              
  Lines        2568    1905     -663     
=========================================
  Hits           13      13              
+ Misses       2555    1892     -663     
Impacted Files Coverage Δ
lib/beaker-hostgenerator/abs_support.rb 0.00% <ø> (ø)
lib/beaker-hostgenerator/cli.rb 0.00% <0.00%> (ø)
lib/beaker-hostgenerator/data.rb 0.00% <0.00%> (ø)
lib/beaker-hostgenerator/generator.rb 0.00% <0.00%> (ø)
lib/beaker-hostgenerator/hypervisor.rb 0.00% <0.00%> (ø)
lib/beaker-hostgenerator/hypervisor/abs.rb 0.00% <0.00%> (ø)
lib/beaker-hostgenerator/hypervisor/docker.rb 0.00% <0.00%> (ø)
lib/beaker-hostgenerator/hypervisor/hcloud.rb 0.00% <0.00%> (ø)
lib/beaker-hostgenerator/hypervisor/unknown.rb 0.00% <0.00%> (ø)
lib/beaker-hostgenerator/hypervisor/vagrant.rb 0.00% <0.00%> (ø)
... and 3 more

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

if nodeid[ostype] == 1 and ostype != nil
raise "Error: no nodes generated for #{ostype}"
end
raise "Error: no nodes generated for #{ostype}" if nodeid[ostype] == 1 and !ostype.nil?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we disable the guard clause cop? I don't like it because of the long lines it generates. The old flow is much easier to understand IMHO.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've disable the cop, but haven't undone the suggestion it made.

current_object.push(blob[0..-2])
object_depth.pop
current_depth = current_depth.pred
next
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This next now looks redundant.

@@ -21,7 +20,7 @@ def open_file(path)
dirname = File.join(path[1, path.length - 2]) # wtf
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wtf indeed ...

bastelfreak and others added 5 commits March 28, 2023 15:36
its first positional argument and use that to generate a Beaker host
configuration file.
eos
s.license = 'Apache2'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated, but is this SPDX?

@@ -204,7 +202,7 @@ def supported_values_help_text
result << "\n\n"

result << "built-in beaker-hostgenerator hypervisors:\n"
BeakerHostGenerator::Hypervisor.builtin_hypervisors().keys.each do |k|
BeakerHostGenerator::Hypervisor.builtin_hypervisors.keys.each do |k|
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprising this doesn't trigger the performance cop

Suggested change
BeakerHostGenerator::Hypervisor.builtin_hypervisors.keys.each do |k|
BeakerHostGenerator::Hypervisor.builtin_hypervisors.each_key do |k|

if nodeid[ostype] == 1 and ostype != nil
raise "Error: no nodes generated for #{ostype}"
end
raise "Error: no nodes generated for #{ostype}" if nodeid[ostype] == 1 and !ostype.nil?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've disable the cop, but haven't undone the suggestion it made.

@bastelfreak
Copy link
Member Author

this is now obsolete. I split it up into #306 , #307 , #308

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants