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 IndentFirstArgument and IndentFirstParameter #6982
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
maxh
force-pushed
the
maxh/add-first-argument-indent
branch
from
April 27, 2019 14:04
970e31a
to
8f03bcb
Compare
maxh
changed the title
Clean up FirstParameterIndentation and add FirstArgumentIndentation
Add FirstArgumentIndentation and FirstParameterIndentation
Apr 27, 2019
maxh
force-pushed
the
maxh/add-first-argument-indent
branch
from
April 27, 2019 14:05
8f03bcb
to
268d1e6
Compare
maxh
changed the title
Add FirstArgumentIndentation and FirstParameterIndentation
Add IndentFirstArgument and IndentFirstParameter
Apr 27, 2019
Merged
8 tasks
maxh
force-pushed
the
maxh/add-first-argument-indent
branch
from
April 27, 2019 14:30
268d1e6
to
7d07a6e
Compare
This was referenced Apr 27, 2019
Thanks! |
8 tasks
koic
added a commit
to koic/rubocop
that referenced
this pull request
Apr 28, 2019
Follow up rubocop#6982. This PR adds obsolete message for renaming `Layout/FirstParameterIndentation`. The following is when `Layout/FirstParameterIndentation` is specified in .rubocop.yml. ## Before ```console % rubocop Warning: unrecognized cop Layout/FirstParameterIndentation found in .rubocop.yml ``` ## After ```console % rubocop Error: The `Layout/FirstParameterIndentation` cop has been renamed to `Layout/IndentFirstArgument`. (obsolete configuration found in .rubocop.yml, please update it) ```
bbatsov
pushed a commit
that referenced
this pull request
Apr 28, 2019
Follow up #6982. This PR adds obsolete message for renaming `Layout/FirstParameterIndentation`. The following is when `Layout/FirstParameterIndentation` is specified in .rubocop.yml. ## Before ```console % rubocop Warning: unrecognized cop Layout/FirstParameterIndentation found in .rubocop.yml ``` ## After ```console % rubocop Error: The `Layout/FirstParameterIndentation` cop has been renamed to `Layout/IndentFirstArgument`. (obsolete configuration found in .rubocop.yml, please update it) ```
koic
added a commit
to koic/rubocop
that referenced
this pull request
May 1, 2019
Follow up rubocop#6982 and rubocop#7002. This PR marks the default `EnforcedStyle` for `Layout/IndentFirstParameter`
8 tasks
natesholland
added a commit
to natesholland/rails
that referenced
this pull request
May 4, 2019
Performance cops were extracted in rubocop/rubocop#5977 and @koic updated to 0.67.2 and added the rubocop-performance gem in rails#35989. This bumps rubocop to 0.68.1 to be on the latest version. Two changes were made in regards to the bump of the version: * The first was that Layout/FirstParameterIndentation was renamed to Layout/IndentFirstArgument. These changes can be seen in rubocop/rubocop#6982 and rubocop/rubocop#6987 * The second was that a new instance of the Style/HashSyntax cop was found. I updated that instance to follow the new Ruby >= 1.9 syntax.
natesholland
added a commit
to natesholland/codeclimate-rubocop
that referenced
this pull request
May 4, 2019
This rename was done in rubocop/rubocop#6982
natesholland
added a commit
to natesholland/codeclimate-rubocop
that referenced
this pull request
May 4, 2019
This is a new cop that was added in rubocop/rubocop#6982
natesholland
added a commit
to natesholland/codeclimate-rubocop
that referenced
this pull request
May 4, 2019
This rename was done in rubocop/rubocop#6982
8 tasks
Merged
8 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As proposed in #6929, this PR (1) renames
Layout/FirstParameterIndentation
toLayout/IndentFirstArgument
because it operates on arguments in method calls and (2) adds a new cop with the nameLayout/IndentFirstParameter
that operates on parameters in method definitions.The reason to change the naming scheme from
FirstFooIndentation
toIndentFirstFoo
is for consistency and ease of use in the docs. See also #6983.Because indenting the first element of method definition shares logic with array/hash literal alignment, this PR renames
ArrayHashIndentation
mixin and uses it in the cop added in (2). This PR also cleans up the use ofargument
andparameter
throughout the relevant docs.This PR will be a minor breaking change due to the rename. Both cops are enabled by default.
I suggest releasing this in the same version as #6983 and #6981 so that folks only have to go through one set of breaking changes.
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).and description in grammatically correct, complete sentences.
bundle exec rake default
. It executes all tests and RuboCop for itself, and generates the documentation.