-
-
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
Style/IndentationConsistency and extend self #5050
Comments
Guess we need autocorrect for cop that detects module's btw if
|
I am inclined to say we should add a special case for this. The code provided intentionally obscures what is actually going on. Adding complexity to support that is quite contrary to what RuboCop does. 🙂 We recently added a cop that checks that a method doesn't have trailing implementation on the def foo; bar
baz
end We probably want a similar cop for |
These look like fun! Will attempt to get the work up over the next few days. 3 PRs.
|
@bbatsov how does |
@dreyks - Sorry! Based on the follow up commentary above, this is how I interpreted the issue. I'm fine with opening this back up if that's what we decide. Quotes: I put this together to mean that we didn't want to add complexity that supports an obscure practice. And instead, let's provide linting and autocorrection that re-aligns the provided code to follow standard practices. |
In my current project we have a weird convention to write
extend self
on the same line as the module definition, which turns out to be valid rubyExpected behavior
I'd expect rubocop not to touch the indentation here
Actual behavior
The module body gets aligned with the
extend
keywordSteps to reproduce the problem
see the code template above
RuboCop version
Include the output of
rubocop -V
. Here's an example:The text was updated successfully, but these errors were encountered: