-
Notifications
You must be signed in to change notification settings - Fork 5
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
Replace some trivial Rubocop checks with more meaningful Reek checks. #67
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.
I am up to give it a try!
@@ -56,6 +56,41 @@ inherit_from: rails_rubocop.yml | |||
# project-specific configuration... | |||
``` | |||
|
|||
## Reek | |||
|
|||
Every project should start with the `reek.yml` present here. It should |
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.
Guess we should keep the dot to avoid confusion.
Every project should start with the `reek.yml` present here. It should | |
Every project should start with the `.reek.yml` present here. It should |
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 think it's referring to the file in this repo, though, not the name it'll get when pulled into a project.
Reek has strong opinions about object-orientation that many find | ||
overaggressive in some parts of codebases where OO design is less | ||
important. You may find these common exclusions to be helpful: |
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 was my main thought when I saw this PR. What you wrote here hits home for me. I think of reek
as valuable, specially for growing teams. It helps drive some level of quality for some standards without too much PR micromanagement.
In some aspects, though, it's like a very purist tool. In some cases we need to make an executive decision to sacrifice something for a benefit somewhere else, and in those moments I found reek
to be annoying.
I'm interested in the list of rules you set up, it looks like you gave it some thought and also recognize that it's aggressive so I'm quite interested 😄
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.
+1 on giving this a try. Thanks for adding 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.
This looks cool! is it possible to add instructions for running this locally to the readme? I think especially as we get used to it, it would be helpful to be able to check output locally before pushing to a PR.
@samdallas it's funny you should ask about that, because up until now I think we just assumed everyone would know about running the Quality CLI locally because it was the product we worked on all the time. You can read instructions for installing the CLI at https://github.com/codeclimate/codeclimate. Once it's installed, you can fetch any shared config files by running |
@wfleming thank you! 🤯 I didn't know that was possible! |
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.
Thank you Francis! We should totally try this changes :)
Our Ruby static analysis makes extensive use of Rubocop, but in my opinion Reek is a superior analysis tool for Ruby: It offers sophisticated checks that point the way towards better object-oriented design, as opposed to the more superficial analysis style of Rubocop.
This PR is a suggested way to adopt Reek: By taking on some of its checks, and at the same time removing some Rubocop checks that are relatively low value. The goal here is to keep roughly the same amount of static analysis strictness, but refocusing developer effort on deeper analysis of OO design.
As a proof of concept I've run these changes on velocity here: https://codeclimate.com/repos/59f12f7da7c8dc02c00011be/pull/12377