-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
AllowIfModifier
option to Style/IfInsideElse
cop
This PR adds `AllowIfModifier` option to `Style/IfInsideElse` cop. This new option is based on rails/rails repo use case shown at the following URL. rails/rails#36495. This option works as follows. ### AllowIfModifier: false (default) `AllowIfModifier` is false by default. So breaking change will not happen. ```ruby # bad if condition_a action_a else action_b if condition_b end ``` ### AllowIfModifier: true It allows the following case when `AllowIfModifier` is true. ```ruby # good if condition_a action_a else action_b if condition_b end ```
- Loading branch information
Showing
5 changed files
with
121 additions
and
12 deletions.
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