Skip to content

Style/MethodCallWithArgsParentheses reports setter methods #4152

Description

@jonas054

I think setter methods should never be reported by this cop. The user shouldn't have to add them to the IgnoredMethods configuration option.

Expected behavior

 $ echo 'x.y = 1' | rubocop --only Style/MethodCallWithArgsParentheses --stdin stdin.rb
Inspecting 1 file
.

1 file inspected, no offenses detected

Actual behavior

$ echo 'x.y = 1' | rubocop --only Style/MethodCallWithArgsParentheses --stdin stdin.rb
Inspecting 1 file
C

Offenses:

stdin.rb:1:3: C: Use parentheses for method calls with arguments.
x.y = 1
  ^

1 file inspected, 1 offense detected

Steps to reproduce the problem

Run the above command.

RuboCop version

Current master. The problem does not occur on 0.47.1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions