-
Notifications
You must be signed in to change notification settings - Fork 111
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
Add rubocop and standardrb formatters for Ruby #107
Conversation
Thank you very much for adding more formatters! Can you make these changes:
Would the existing Ruby formatter, |
Hmm. We've had discussions of local-formatter support (e.g. #33) and |
a6f1914
to
a85c60b
Compare
They require `--stderr` supported by rubocop >=1.4.0 and standard (standardrb) >=0.13.0.
7a23993
to
4a03c08
Compare
@lassik Thanks for the review! How does it look now? |
Thanks for putting a lot of effort into this! What does |
It removes warnings that Rubocop generates from the output. Rubocop is basically a very noisy linter and it emits warnings to stdout where the formatted source code is also output. That's why I proposed adding As for processing within Emacs, the current internal API And yeah, I'm also the one with a BSD background who hates Bash-ism, but in reality, most popular ruby installation managers like rbenv and rvm already depend on Bash and I don't think it would be a big problem. |
The addition of |
Yes, v1.4.0, the first release with the In any case, removing the hack too soon will make developers' lives hard until their projects get to upgrade Rubocop. I guess it'll be OK to force an upgrade in a couple of months from now. |
I'd prefer to avoid putting hacks into format-all as far as possible, since they easily get left in and it gets hard for people who didn't to write them to understand what they do and whether they're still relevant. Since format-all currently has no Rubocop support, could we wait until 1.4.1 is published and working normally before adding Rubocop to format-all? If it only takes a month and we can avoid hacks, we can wait. If you need rubocop today, you can always use a private branch of format-all until then. |
(#42 is an earlier example where I opted not to merge a formatter since its interface was difficult to use reliably. One of the PHP formatters was another. These are pretty much the only ones; most formatter authors are happy to listen to feedback and provide a reliable interface in the next version.) |
@knu RuboCop is already at 1.6.1; it's 18 days since the release 1.4.0 that added the |
@knu Can you push a version of this patch that assumes RuboCop has |
4a03c08
to
3e6793a
Compare
Sorry, I hadn't noticed you had updated the patch. Thanks for your work! Now in master; can you check that it works? |
Kudos for the multiple formatter support!