Module: RuboCop::Cop::FrozenStringLiteral
- Included in:
- Lint::DuplicateMagicComment, Lint::OrderedMagicComments, Style::EmptyLiteral, Style::FrozenStringLiteralComment, Style::MutableConstant, Style::RedundantFetchBlock, Style::RedundantFreeze, Style::RedundantInterpolationUnfreeze
- Defined in:
- lib/rubocop/cop/mixin/frozen_string_literal.rb
Overview
Common functionality for dealing with frozen string literals.
Constant Summary collapse
- FROZEN_STRING_LITERAL =
'# frozen_string_literal:'
- FROZEN_STRING_LITERAL_ENABLED =
'# frozen_string_literal: true'
Class Method Summary collapse
Class Method Details
.frozen_string_literal_comment_exists? ⇒ Boolean
15 16 17 |
# File 'lib/rubocop/cop/mixin/frozen_string_literal.rb', line 15 def frozen_string_literal_comment_exists? leading_comment_lines.any? { |line| MagicComment.parse(line).valid_literal_value? } end |