-
-
Notifications
You must be signed in to change notification settings - Fork 34
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 rubocop-related issues (part 1) #75
Conversation
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## master #75 +/- ##
=======================================
Coverage 85.61% 85.61%
=======================================
Files 1 1
Lines 292 292
=======================================
Hits 250 250
Misses 42 42
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. |
🆙 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been working on a script to fix it per cop. For voxpupuli/beaker#1761 I used https://gist.github.com/ekohl/b41006003553dce67b9c551f306f8080 to fix TODOs. Then in rebases I'd order things around again. Some of the commits are manual, in case there was no autofix. It relies on https://pypi.org/project/yq/ to get all the keys from the TODO file.
Thank you for the idea! JFYI I implemented it as a |
Anything more is expected from me here? Or we can squash it a bit and merge? |
I've been very busy but I'll try to revisit it. |
@jay7x can you maybe rebase this please? |
Sure.. Though I think we should recheck the rubocop rules and maybe sync the config with other gems. I'll poke you later today in Slack. |
Rakefile
Outdated
system('git', 'commit', '-m', msg, *args) | ||
end | ||
|
||
namespace :rubocop do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not happy with a huge implementation of this in a Rakefile. If we decide to go this route it belongs in a separate gem IMHO. Otherwise we end up duplicating it many times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need this. It's only useful when fixing the todo file, and that's done after some point. I think it should be replaced with our default block:
begin
require 'rubocop/rake_task'
rescue LoadError
# RuboCop is an optional group
else
RuboCop::RakeTask.new(:rubocop) do |task|
# These make the rubocop experience maybe slightly less terrible
task.options = ['--display-cop-names', '--display-style-guide', '--extra-details']
# Use Rubocop's Github Actions formatter if possible
if ENV['GITHUB_ACTIONS'] == 'true'
task.formatters << 'github'
end
end
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe task.options = ['--display-cop-names', '--display-style-guide', '--extra-details']
isn't even required anymore
Rakefile and GHA config should be synced across all beaker plugins I'd say.. |
I want to sync them, but before we do that I want to:
|
Edit: I'm tracking all the rubocop/ruby refactoring in https://github.com/orgs/voxpupuli/projects/4 |
@jay7x I introduced merge conflicts, but I'd also raise another point: the |
.. and the *.gemspec because if was affected by style changes
Co-authored-by: Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl>
`beaker-rspec` is not really used in the acceptance test. So the gem is removed and the test is rewritten to be true Beaker DSL test.
That script was never working it seems.. Fix rubocop issues as well.
* Style/IfUnlessModifier cop * Style/StringLiterals cop * Metrics cops
This PR includes rubocop-inspired fixes. Though there was few unrelated changes:
Gemfile.local
was removedvendor
directory was added to the.gitignore
.editorconfig
added (mostly to keep trailing spaces and newlines under control)bin/beaker-docker
was fixed (it seems it was never really working 🤔)00_default_spec.rb
was rewritten in Beaker DSL (beaker-rspec
was not really used there)