Skip to content

Files

Latest commit

 

History

History
21 lines (13 loc) · 362 Bytes

Style-MutableConstant.md

File metadata and controls

21 lines (13 loc) · 362 Bytes

Pattern: Use of mutable constant

Issue: -

Description

This rule checks whether some constant value isn't a mutable literal (e.g. array or hash).

Examples

# bad
CONST = [1, 2, 3]

# good
CONST = [1, 2, 3].freeze

Further Reading