Skip to content

Commit 622fbdd

Browse files
koicbbatsov
authored andcommitted
Add new "Operator Method Call" rule
Avoid dot where not required for operator method calls. ```ruby # bad num.+ 42 # good num + 42 ``` This rule corresponds to rubocop/rubocop#11080.
1 parent 58f7c09 commit 622fbdd

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.adoc

+13
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,19 @@ puts 'bar'
255255
puts 'foo', 'bar' # this applies to puts in particular
256256
----
257257

258+
=== Operator Method Call
259+
260+
Avoid dot where not required for operator method calls.
261+
262+
[source,ruby]
263+
----
264+
# bad
265+
num.+ 42
266+
267+
# good
268+
num + 42
269+
----
270+
258271
=== Spaces and Operators [[spaces-operators]]
259272

260273
Use spaces around operators, after commas, colons and semicolons.

0 commit comments

Comments
 (0)