Skip to content

Lint/AssignmentInCondition: Forbid assignments within conditions

Peter Leitzen requested to merge pl-enable-lint-assignemnt-in-condition into master

What does this MR do and why?

This MR enables 👮 Lint/AssignmentInCondition to forbid assignments with conditions (Option 🅱 from #38 (closed)).

# bad
if (some_var = true)
  do_something
end

# good
some_var = true

if some_var
  do_something
end

Screenshot_from_2023-04-28_12-52-16

Edited by Peter Leitzen

Merge request reports