Skip to content

Commit

Permalink
[Fix rubocop#9328] Added some examples to the cop
Browse files Browse the repository at this point in the history
  • Loading branch information
thearjunmdas committed Aug 22, 2021
1 parent a89c08b commit e5258d4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/rubocop/cop/style/mutable_constant.rb
Expand Up @@ -57,6 +57,21 @@ module Style
# puts 1
# end
# end.freeze
#
# @example
# # Magic comment - shareable_constant_value: literal
#
# # bad
# CONST = [1, 2, 3]
#
# # good
# # shareable_constant_value: literal
# CONST = [1, 2, 3]
#
# NOTE: This special directive helps to create constants
# that hold only immutable objects, or Ractor-shareable
# constants. - ruby docs
#
class MutableConstant < Base
# Handles magic comment shareable_constant_value with O(n ^ 2) complexity
# n - number of lines in the source
Expand Down

0 comments on commit e5258d4

Please sign in to comment.