Skip to content

AssignmentInCondition didn't find the style problem #12731

@itsalongstory

Description

@itsalongstory

Expected behavior

RuboCop should find the style problem in the if statement

Actual behavior

RuboCop didn't find the style problem

Steps to reproduce the problem

test.rb

a = 1

if a&.to_i = 1
  puts '111'
end

Run:

rubocop --only Lint/AssignmentInCondition -a test.rb

Result:

Inspecting 1 file
.

1 file inspected, no offenses detected

RuboCop version

root@localhost:~$ rubocop -v
1.61.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions