Class: Rubocop::Cop::Style::Semicolon
- Defined in:
- lib/rubocop/cop/style/semicolon.rb
Overview
This cop checks for multiple expressions placed on the same line. It also checks for lines terminated with a semicolon.
Constant Summary collapse
- MSG =
'Do not use semicolons to terminate expressions.'
Constants inherited from Cop
Instance Attribute Summary
Attributes inherited from Cop
#config, #corrections, #offences, #processed_source
Instance Method Summary collapse
Methods inherited from Cop
#add_offence, all, #autocorrect?, #convention, #cop_config, cop_name, #cop_name, cop_type, #debug?, #ignore_node, inherited, #initialize, lint?, #message, non_rails, rails?, style?, #support_autocorrect?, #warning
Constructor Details
This class inherits a constructor from Rubocop::Cop::Cop
Instance Method Details
#investigate(processed_source) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/rubocop/cop/style/semicolon.rb', line 11 def investigate(processed_source) return unless processed_source.ast unless cop_config['AllowAsExpressionSeparator'] check_for_expr_separator(processed_source) end check_for_line_terminator(processed_source) end |