Avoid using or-assignment with constants. Open
ALLOWED_KEYS ||= [
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks for unintended or-assignment to a constant.
Constants should always be assigned in the same location. And its value
should always be the same. If constants are assigned in multiple
locations, the result may vary depending on the order of require
.
Safety:
This cop is unsafe because code that is already conditionally assigning a constant may have its behavior changed by autocorrection.
Example:
# bad
CONST ||= 1
# good
CONST = 1
Avoid using or-assignment with constants. Open
INFO ||= "info".freeze
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks for unintended or-assignment to a constant.
Constants should always be assigned in the same location. And its value
should always be the same. If constants are assigned in multiple
locations, the result may vary depending on the order of require
.
Safety:
This cop is unsafe because code that is already conditionally assigning a constant may have its behavior changed by autocorrection.
Example:
# bad
CONST ||= 1
# good
CONST = 1
Avoid using or-assignment with constants. Open
WARN ||= "warn".freeze
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks for unintended or-assignment to a constant.
Constants should always be assigned in the same location. And its value
should always be the same. If constants are assigned in multiple
locations, the result may vary depending on the order of require
.
Safety:
This cop is unsafe because code that is already conditionally assigning a constant may have its behavior changed by autocorrection.
Example:
# bad
CONST ||= 1
# good
CONST = 1
Avoid using or-assignment with constants. Open
ERROR ||= "error".freeze
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks for unintended or-assignment to a constant.
Constants should always be assigned in the same location. And its value
should always be the same. If constants are assigned in multiple
locations, the result may vary depending on the order of require
.
Safety:
This cop is unsafe because code that is already conditionally assigning a constant may have its behavior changed by autocorrection.
Example:
# bad
CONST ||= 1
# good
CONST = 1