class RuboCop::MagicComment::EmacsComment
Wrapper for Emacs style magic comments.
@example Emacs style comment
comment = RuboCop::MagicComment.parse( '# -*- encoding: ASCII-8BIT -*-' ) comment.encoding # => 'ascii-8bit'
@see www.gnu.org/software/emacs/manual/html_node/emacs/Specify-Coding.html @see github.com/ruby/ruby/blob/3f306dc/parse.y#L6873-L6892 Emacs handling in parse.y
Constants
- FORMAT
- OPERATOR
- REGEXP
- SEPARATOR
Public Instance Methods
Source
# File lib/rubocop/magic_comment.rb, line 196 def new_frozen_string_literal(value) "# -*- frozen_string_literal: #{value} -*-" end
Private Instance Methods
Source
# File lib/rubocop/magic_comment.rb, line 202 def extract_frozen_string_literal match(KEYWORDS[:frozen_string_literal]) end
Source
# File lib/rubocop/magic_comment.rb, line 211 def extract_typed; end
Emacs comments cannot specify Sorbet typechecking behavior.