-
-
Notifications
You must be signed in to change notification settings - Fork 96
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
Figure out & document how to disable RuboCop's styling rules #55
Comments
Yeah this is a really good thought. I think it might be prudent just to ship with a rubocop config. There really shouldn't be too many rules that it's violating, I really tried to stick with their style for most things. People could just inherit from their |
This project could ship a gem called like inherit_gem:
rubocop-config-prettier: config/rubocop.yml This would be like how ESLint users have to install a config plugin and update their ESLint config files to integrate with Prettier. I like the idea of shipping a gem containing a config better because it feels more "right" to install Rubocop config using gems instead of npm. To solve the Rubocop version compatibility issue, if there are versions of Rubocop that introduce config file incompatibilities, the |
I don’t think we necessarily need to ship a gem since we’ll already have a file on the system through the npm package. We could just ship the rubocop with the plugin. |
To take it a bit extreme: it could be feasible to ship prettier + prettier ruby + this config file as a single gem with the binaries embedded. This lets ruby devs feel like they only have one dependency manager, but makes the deploy bit more complicated. ( I do something a bit like this for danger-swift ) |
Oo man @orta I actually really like that idea. A lot of the pushback so far has been from ruby devs who haven't had experience with the npm ecosystem. |
Hm, I'd be interested in taking a look at that. Would https://github.com/nexe/nexe be appropriate? |
I don't think we need to go so far as to bundle node. If they don't have it on their system we should just warn and fail the executable. |
btw, any goals to use rubocop config to use rubocop's rules on the project? |
There would need to be a JavaScript implementation of the rubocop config generator (e.g. the extends from gem etc ) or a way to have rubocop export the full settings (as JSON to STDOUT or something) in order for that to work - which would be cool |
@orta I guess it just required |
You'd need to re-implement all of these types of features: https://rubocop.readthedocs.io/en/latest/configuration/#inheritance |
While I agree that that might be nice, I think that might be overcomplicating the problem. Rubocop already supporting inheriting config from a relative path. That means we can ship a rubocop config with this package and people can put In that config we should just disable every rule that is covered by the formatting rules of this plugin. As in, take away that responsibility from rubocop. I don't really see the value of linting rules with rubocop if this plugin is going to take care of it. |
in this case, it will require additional changes for rubocop config and third-party dependencies to CI for example. Not everybody has a node on CI ;) |
If folks don't have access to |
I'm going to close this in favor of #116 as we're going to ship that soon, and it'll come with a rubocop config. |
Is this solved? All related issues have been closed and I can't find any guidance on configuring RuboCop. I'm using the npm package. |
At the moment there aren't any known rubocop rules that plugin-ruby is violating, so you can just use a base rubocop configuration and everything should work out. If you find a rule that we're intentionally violating please let me know. |
I created rubocop-config-prettier gem to turn off all rules that are unnecessary or might conflict with prettier plugin ruby. |
@flyerhzm sorry I'm not sure I understand why you would want to pull in a separate gem, why wouldn't you just open a PR here? |
@kddeisz I think it's similar to https://github.com/prettier/eslint-plugin-prettier, which isn't merged in prettier |
@kddeisz
Prettier seems to be violating the default (Also interested in what is the official way of getting these two to play together) |
@jensljungblad I would happily accept a PR for a rubocop config with some documentation if you're up to it. |
Welcome to the prettier org! So awesome.
As this project likely to live along-side RuboCop in Ruby projects we'll need to either document how to ensure that the two projects don't clash, or build something similar to https://github.com/prettier/eslint-plugin-prettier to ensure the two don't step on each others toes.
Ideas:
Style/*
The text was updated successfully, but these errors were encountered: