Add Style/SelfAssignment Rubocop cop
The cop enforces use of self assignment operator E.g. a=a+2 gets written as a+=2. Also the offenses listed in rubocop.todo.yml have been corrected automatically with the --auto-correct option. Fixes issue #1531
This commit is contained in:
parent
be72b9d02e
commit
cdf794ecbf
5 changed files with 7 additions and 13 deletions
|
|
@ -92,6 +92,10 @@ Style/SpaceAroundOperators:
|
|||
Style/SpaceInsideBrackets:
|
||||
Enabled: true
|
||||
|
||||
# This cop enforces the use the shorthand for self-assignment.
|
||||
Style/SelfAssignment:
|
||||
Enabled: true
|
||||
|
||||
# Use single quotes unless there's string interpolation
|
||||
Style/StringLiterals:
|
||||
Enabled: true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue