Class: RuboCop::MagicComment::VimComment
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
EditorComment,
MagicComment
|
|
|
Instance Chain:
self,
EditorComment,
MagicComment
|
|
| Inherits: |
RuboCop::MagicComment::EditorComment
|
| Defined in: | lib/rubocop/magic_comment.rb |
Overview
Wrapper for Vim style magic comments.
Constant Summary
-
FORMAT =
# File 'lib/rubocop/magic_comment.rb', line 237'# vim: %s' -
KEYWORDS =
# File 'lib/rubocop/magic_comment.rb', line 240MagicComment::KEYWORDS.merge(encoding: 'fileencoding').freeze
-
OPERATOR =
# File 'lib/rubocop/magic_comment.rb', line 239'=' -
REGEXP =
# File 'lib/rubocop/magic_comment.rb', line 236/#\s*vim:\s*(?<token>.+)/.freeze
-
SEPARATOR =
# File 'lib/rubocop/magic_comment.rb', line 238', '
Instance Method Summary
-
#encoding
For some reason the fileencoding keyword only works if there is at least one other token included in the string.
-
#extract_rbs_inline_value
Vim comments cannot specify RBS::inline behavior.
-
#extract_typed
Vim comments cannot specify Sorbet typechecking behavior.
-
#frozen_string_literal
Vim comments cannot specify frozen string literal behavior.
-
#shareable_constant_value
Vim comments cannot specify shareable constant values behavior.
EditorComment - Inherited
Instance Method Details
#encoding
For some reason the fileencoding keyword only works if there is at least one other token included in the string. For example
# works
# vim: foo=bar, fileencoding=ascii-8bit
# does nothing
# vim: foo=bar, fileencoding=ascii-8bit
# File 'lib/rubocop/magic_comment.rb', line 251
def encoding super if tokens.size > 1 end
#extract_rbs_inline_value
Vim comments cannot specify RBS::inline behavior.
# File 'lib/rubocop/magic_comment.rb', line 259
def extract_rbs_inline_value; end
#extract_typed
Vim comments cannot specify Sorbet typechecking behavior.
# File 'lib/rubocop/magic_comment.rb', line 265
def extract_typed; end
#frozen_string_literal
Vim comments cannot specify frozen string literal behavior.
# File 'lib/rubocop/magic_comment.rb', line 256
def frozen_string_literal; end