-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 Ruby style guide with standard #606
Conversation
Following an [update to the thoughtbot guide][guides PR], this commit removes Rubocop and replaces it with [standard]. [guides PR]: thoughtbot/guides#606 [standard]: https://github.com/testdouble/standard
Following an [update to the thoughtbot guide][guides PR], this commit removes Rubocop and replaces it with [standard]. [guides PR]: thoughtbot/guides#606 [standard]: https://github.com/testdouble/standard
Following an [update to the thoughtbot guide][guides PR], this commit removes Rubocop and replaces it with [standard]. [guides PR]: thoughtbot/guides#606 [standard]: https://github.com/testdouble/standard
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 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.
Some of the items in this list were formatting related and some were based in reducing the number of trivial decisions we have to make, and I would be sad if I have to start making trivial decisions.
That said, I want to delete the styleguide, so LGTM!
Following an [update to the thoughtbot guide][guides PR], this commit removes Rubocop and replaces it with [standard]. [guides PR]: thoughtbot/guides#606 [standard]: https://github.com/testdouble/standard
Following an [update to the thoughtbot guide][guides PR], this commit removes Rubocop and replaces it with [standard]. [guides PR]: thoughtbot/guides#606 [standard]: https://github.com/testdouble/standard
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 for doing this!
I went through and tried out all of the rules here in a project that uses the latest version of Standard, and I've flagged the ones that aren't either enforced automatically be Standard, or contradicted by Standard.
I don't feel strongly about most of the rules I've suggested keeping, but I think it would be good for maintaining clear Git history to limit the changes in this PR to only things that are replaced by Standard.
Wow! Thanks for going through all of these. It is not something I was eager to do myself. |
[standard](https://github.com/testdouble/standard) is opinionated about style, and some of those opinions are in conflict with our current style guide. This commit adds standard to the style guide, and removes any points that standard already covers. I also ran standard to fix our sample.rb to match this change. This commit also removes .rubocop.yml. This will affect projects which point to this file (e.g. factory_bot). They will need to either point to a specific commit where the file still exists, or upgrade to start using standard.
beedf35
to
37caed0
Compare
For what it's worth, I don't feel as though any of these are worth keeping if they can't be automated. Anything that falls more in the category of a best practice can be moved to best practices. I'd rather drop the others. I still agree with some of the ones that have been deleted, but they aren't important enough to me that I want to try and enforce them without automation. If there are any we particularly care about, we could try to get them into Standard. |
I agree with this, but I also agree with limiting the scope of this PR. I will look into opening separate PRs to move or remove the others. |
I'm not 100% sure, but I think this PR may have brought unintended consequences. If I understand correctly, Hound's configuration across thoughtbot projects uses the file As a result, I'm seeing unexpected Hound comments over at Administrate. If my assessment is correct, I guess the fix would be to tell Hound to use StandardRB? I don't know if it's possible to directly tell it to use it. Perhaps instead it can be directed to use these Rubocop config files https://github.com/testdouble/standard/tree/master/config? |
@pablobm Thanks for the comment. We are moving away from Hound, but in the meantime it should probably still work as before. I wonder if it is possible to update |
https://github.com/testdouble/standard thoughtbot is moving toward standard instead of Hound + Rubocop: thoughtbot/guides#606
https://github.com/testdouble/standard thoughtbot is moving toward standard instead of Hound + Rubocop: thoughtbot/guides#606
I added back .rubocop.yml for now in 9ac4a38 |
https://github.com/testdouble/standard thoughtbot is moving toward standard instead of Hound + Rubocop: thoughtbot/guides#606
https://github.com/testdouble/standard thoughtbot is moving toward standard instead of Hound + Rubocop: thoughtbot/guides#606
Following an [update to the thoughtbot guide][guides PR], this commit removes Rubocop and replaces it with [standard]. [guides PR]: thoughtbot/guides#606 [standard]: https://github.com/testdouble/standard
Following an [update to the thoughtbot guide][guides PR], this commit removes Rubocop and replaces it with [standard]. [guides PR]: thoughtbot/guides#606 [standard]: https://github.com/testdouble/standard
https://github.com/testdouble/standard thoughtbot is moving toward standard instead of Hound + Rubocop: thoughtbot/guides#606
Some time ago, we at thoughtbot stopped using our custom Rubocop rules and replaced it with standard. This adds Standard, sets up support for it in GitHub Actions and runs it against the code base. https://github.com/standardrb/standard thoughtbot/guides#606
Some time ago, we at thoughtbot stopped using our custom Rubocop rules and replaced it with standard. This adds Standard, sets up support for it in GitHub Actions and runs it against the code base. We ignore `Lint/ConstantDefinitionInBlock` in a few specs, as this is related to the Pundit integration. It'd be good to come back to this in future and adjust the specs to avoid defining/overriding classes in specs, but honestly it was too difficult to make it work in a reasonable time. Finally, we need to use `main` of the standard Action as, currently, that's the only one which is working (`0.0.5` fails silently). https://github.com/standardrb/standard thoughtbot/guides#606
Some time ago, we at thoughtbot stopped using our custom Rubocop rules and replaced it with standard. This adds Standard, sets up support for it in GitHub Actions and runs it against the code base. We ignore `Lint/ConstantDefinitionInBlock` in a few specs, as this is related to the Pundit integration. It'd be good to come back to this in future and adjust the specs to avoid defining/overriding classes in specs, but honestly it was too difficult to make it work in a reasonable time. Finally, we need to use `main` of the standard Action as, currently, that's the only one which is working (`0.0.5` fails silently). https://github.com/standardrb/standard thoughtbot/guides#606
closes #605
standard is opinionated about
style, and some of those opinions are in conflict with our current style
guide.
This commit adds standard to the style guide, and removes any points
that standard already covers. I also ran standard to fix our sample.rb
to match this change.
This commit also removes .rubocop.yml. This will affect projects
which point to this file (e.g. factory_bot). They will need to either
point to a specific commit where the file still exists, or upgrade to
start using standard.