-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[#2495, #1609] Add EnforcedStyle config parameter to IndentArray #2529
Conversation
Awesome!! Thanks!! 👍 |
RuboCop's own code has quite a few offenses, due to following the
|
There's also a huge amount of duplication between Is it worth extracting the common logic into a shared module? |
I say it's better to fix all the offenses. The cleaner and more consistent the codebase is, the better. |
Don't know what @bbatsov wants, but I would say, follow the "three strikes" rule. If the same code is needed in a 3rd place, then extract it. It may be that there are other places in the codebase which could benefit from the extracted code right now... if so, it would be better to unify them. |
...Wait a minute. Sorry. Do we really want |
Not sure. It could certainly make it a pain to keep lines within a reasonable length, although in most cases you'd just have to change something like this: oh.wow.this.is.a.really.long.chain.of.methods([
a.really.really.long.value,
another.really.really.long.value
]) to this: oh.wow.this.is.a.really.long.chain.of.methods(
[
a.really.really.long.value,
another.really.really.long.value
]) In any case, I've pushed fixes for the various offenses. Check them out in e4f17a2, and if the changes look unreasonable, we can just switch the default back to |
Hmm. In some cases, the new style looks really good. In others, not so much. |
Yup. Unfortunately I'm not sure that any hard requirement will look good in all scenarios.
|
I'll ping @jfelchner and @zenspider here as well, since they opened the issues we aim to resolve. |
On the balance, I think |
@jawshooah thanks so much! Defaults don't matter to me as long as I can switch it. 😉 |
@bbatsov, care to weigh in on what the default should be? |
@jawshooah what does the current impl do? It should probably match that. |
@jfelchner I'd be fine with that, but as I said above:
|
@jawshooah ah thanks for pointing that out. I guess this is definitely a question for @bbatsov 😊 |
Yeah (plus it's how Emacs's ruby-mode works :-) ). A changelog entry has to be added and the PR has to be rebased. |
@bbatsov I've addressed your comments and rebased. |
👍 Thanks! |
For parity with
IndentHash
,SupportedStyles
include:special_inside_parentheses
(default)consistent
align_brackets