-
Notifications
You must be signed in to change notification settings - Fork 225
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
Clears some rubocop offenses #281
Conversation
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.
Thanks a lot! There are some problems though, have a look and lets see if we can make travis happy :)
@@ -45,7 +45,7 @@ def root_directory | |||
@root_directory ||= Pathname.new(Config.root) | |||
end | |||
|
|||
def get_binding | |||
def binding | |||
binding |
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.
Won't this is lead to an infinite loop?
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.
Oops. Fixing.
I didn't perfectly understand the need for this function. Since it's private and can only be called in child classes, wouldn't it be just as effective to use binding
directly in those classes instead of calling get_binding
?
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.
Leaving this in for now, I don't think I have enough of an understanding to change this.
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.
Well, I'd say that we really don't need that method. I'm also not sure.
Give it a try - remove the method and see if the HTML reports are still properly generated.
@@ -21,7 +21,7 @@ def git(arg) | |||
end | |||
|
|||
def self.supported? | |||
git('branch 2>&1') && $?.success? | |||
git('branch 2>&1') && $CHILD_STATUS.success? |
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.
This is breaking the tests. We must require "English"
so that this works (see rubocop/rubocop#1747).
You can add the require to the top level rubycritic module I think.
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.
Fixing this.
You can add the require to the top level rubycritic module
I was going to require only in the files that used that variable. Would requiring in the top module be better for some reason?
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.
Just because it might be used elsewhere. But I guess if this is the only file that uses $CHILD_STATUS
then we can leave the require here.
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 mean: if $CHILD_STATUS
is only used on RubyCritic::SourceControlSystem
then it can be imported required only in this module.
adba24d
to
964fdd0
Compare
@Onumis Updated the branch. Split the changes into multiple commits for each cop fix, and also reverted some that I didn't completely understand. Eg:
But this causes the reek check to fail, with smell |
@harman28 as for the
I think we should first understand why we need a Probably we should just refactor how that configuration class works, but that should be a PR on it's own 😅 |
964fdd0
to
083c228
Compare
Attempts to solve #250