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
Make some cops aware of safe navigation operator #6749
Merged
pocke
merged 30 commits into
rubocop:master
from
hoshinotsuyoshi:aware_safe_navigator_in_some_cops
Feb 10, 2019
Merged
Changes from 29 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
c7fd520
Make `Layout/AlignParameters` aware of safe navigation operator
hoshinotsuyoshi 146e3bf
Make `Layout/ClosingParenthesisIndentation` aware of safe navigation …
hoshinotsuyoshi 9d99087
Make `Layout/DotPosition` aware of safe navigation operator
hoshinotsuyoshi 826cfed
Make `Layout/EmptyLinesAroundArguments` aware of safe navigation oper…
hoshinotsuyoshi e8deefb
Make `Layout/FirstMethodArgumentLineBreak` aware of safe navigation o…
hoshinotsuyoshi e769ca6
Make `Layout/FirstParameterIndentation` aware of safe navigation oper…
hoshinotsuyoshi 5783565
Make `Layout/IndentArray` aware of safe navigation operator
hoshinotsuyoshi d7b56b8
Make `Layout/IndentHash` aware of safe navigation operator
hoshinotsuyoshi de1dc7f
Make `Layout/IndentationWidth` aware of safe navigation operator
hoshinotsuyoshi 3ae1e4e
Make `Layout/SpaceBeforeFirstArg` aware of safe navigation operator
hoshinotsuyoshi 9bcd5c8
Make `Lint/AmbiguousBlockAssociation` aware of safe navigation operator
hoshinotsuyoshi 8e1945f
Make `Lint/EachWithObjectArgument` aware of safe navigation operator
hoshinotsuyoshi bedcc22
Make `Lint/ParenthesesAsGroupedExpression` aware of safe navigation o…
hoshinotsuyoshi fa699cb
Make `Lint/RequireParentheses` aware of safe navigation operator
hoshinotsuyoshi b35a848
Make `Rails/ActiveRecordAliases` aware of safe navigation operator
hoshinotsuyoshi 15da862
Make `Rails/Date` aware of safe navigation operator
hoshinotsuyoshi 55fc1a5
Make `Rails/DynamicFindBy` aware of safe navigation operator
hoshinotsuyoshi dadab3d
Make `Rails/FindBy` aware of safe navigation operator
hoshinotsuyoshi c1ec1d1
Make `Rails/SaveBang` aware of safe navigation operator
hoshinotsuyoshi a3ad8b6
Make `Rails/SkipsModelValidations` aware of safe navigation operator
hoshinotsuyoshi d959982
Make `Style/BracesAroundHashParameters` aware of safe navigation oper…
hoshinotsuyoshi dcb3b34
Make `Style/MethodCallWithArgsParentheses` aware of safe navigation o…
hoshinotsuyoshi 995f4c1
Make `Style/MethodCalledOnDoEndBlock` aware of safe navigation operator
hoshinotsuyoshi a285622
Make `Style/NestedParenthesizedCalls` aware of safe navigation operator
hoshinotsuyoshi 5fc114c
Make `Style/PreferredHashMethods` aware of safe navigation operator
hoshinotsuyoshi 4f6c20b
Make `Style/Send` aware of safe navigation operator
hoshinotsuyoshi 82402bc
Make `Style/StringMethods` aware of safe navigation operator
hoshinotsuyoshi fcd785c
Make `Style/TrailingCommaInArguments` aware of safe navigation operator
hoshinotsuyoshi 0ce168e
Update CHANGELOG.md
hoshinotsuyoshi 48415e2
Add a test case for modifying RuboCop::Cop::CheckAssignment#extract_rhs
hoshinotsuyoshi File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,7 @@ def on_send(node) | |
|
||
add_offense(node) | ||
end | ||
alias on_csend on_send | ||
|
||
private | ||
|
||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,7 @@ def on_send(node) | |
check_predicate(node.last_argument, node) | ||
end | ||
end | ||
alias on_csend on_send | ||
|
||
private | ||
|
||
|
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,6 +67,7 @@ def on_send(node) | |
|
||
add_offense(node, location: :selector) | ||
end | ||
alias on_csend on_send | ||
|
||
private | ||
|
||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,7 @@ def on_send(node) | |
|
||
add_offense(nil, location: range) | ||
end | ||
alias on_csend on_send | ||
end | ||
end | ||
end | ||
|
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
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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a test case for this change?
RSpec is still green if I remove this change.
I guess it supports
something.some_method = 1
style assignment.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, and thank you!
Pushed 48415e2