Ensure that Rubocop catches `||= true`
We recently were hit by a nasty bug: https://gitlab.com/gitlab-org/gitlab-ee/issues/4915.
It seems to be quite a common mistake of assuming that ||= true
has an expected behavior when used in this scenario:
@variable = false
@variable ||= true => developer in this case expects to have `false`, but in real it is set to `true`
We should ensure that Rubocop forbids the usage of ||= true
or || true
anywhere in the shipped code.
Edited by Kamil Trzciński