-
Notifications
You must be signed in to change notification settings - Fork 4
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
[reek] change config to ignore some pain points #1
Conversation
As seen together, UtilityFunction can be annoying as well in an iterator, cf troessner/reek#681 |
MissingSafeMethod: | ||
enabled: true | ||
enabled: false |
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.
bang means that the method is the dangerous version and that a safe version exist.
bang mean that there is a preferable and less dangerous version of the method.
Instead of remove this metric, just stop to use bang.
concat
is a good example in ruby. It modify the receiver like map!
or other methods with bang.
It is name concat
and not concat!
. There is not link between the modification of the receiver and the bang.
https://www.rubydoc.info/github/troessner/reek/Reek/Smells/PrimaDonnaMethod
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 know but this is not followed at all in our codebase. It currently makes noise everywhere.
public_methods_only: false |
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.
There is no change here. Do you want to change to public_methods_only: true
?
It may be acceptable but I think we often use functional method that could be extract in a module.
For example, it is preferable to extract method that serialize or build an object because it is a specific responsibility.
UtilityFunction shows that there is a mix of responsibilities.
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, this one is not working properly. e.g Using a map on an instance variable and then using a method inside will trigger this cop. There is an issue open for a while on reek repository for that but currently this is a major bug IMO (check alice link above).
No description provided.