Class: RuboCop::Cop::Elegant::NoEmptyLinesInBlocks

Inherits:
Base
  • Object
show all
Extended by:
AutoCorrector
Defined in:
lib/rubocop/cop/elegant/no_empty_lines_in_blocks.rb

Overview

SPDX-FileCopyrightText: Copyright © 2019-2026 Yegor Bugayenko SPDX-License-Identifier: MIT

Constant Summary collapse

MSG =
'Empty line inside block body is not allowed'

Instance Method Summary collapse

Instance Method Details

#on_block(node) ⇒ Object



18
19
20
# File 'lib/rubocop/cop/elegant/no_empty_lines_in_blocks.rb', line 18

def on_block(node)
  check(node)
end

#on_case(node) ⇒ Object



42
43
44
# File 'lib/rubocop/cop/elegant/no_empty_lines_in_blocks.rb', line 42

def on_case(node)
  check(node)
end

#on_case_match(node) ⇒ Object



46
47
48
# File 'lib/rubocop/cop/elegant/no_empty_lines_in_blocks.rb', line 46

def on_case_match(node)
  check(node)
end

#on_for(node) ⇒ Object



38
39
40
# File 'lib/rubocop/cop/elegant/no_empty_lines_in_blocks.rb', line 38

def on_for(node)
  check(node)
end

#on_if(node) ⇒ Object



26
27
28
# File 'lib/rubocop/cop/elegant/no_empty_lines_in_blocks.rb', line 26

def on_if(node)
  check(node)
end

#on_kwbegin(node) ⇒ Object



50
51
52
# File 'lib/rubocop/cop/elegant/no_empty_lines_in_blocks.rb', line 50

def on_kwbegin(node)
  check(node)
end

#on_new_investigationObject



12
13
14
15
16
# File 'lib/rubocop/cop/elegant/no_empty_lines_in_blocks.rb', line 12

def on_new_investigation
  super
  @reported = []
  @gaps = scan
end

#on_numblock(node) ⇒ Object



22
23
24
# File 'lib/rubocop/cop/elegant/no_empty_lines_in_blocks.rb', line 22

def on_numblock(node)
  check(node)
end

#on_until(node) ⇒ Object



34
35
36
# File 'lib/rubocop/cop/elegant/no_empty_lines_in_blocks.rb', line 34

def on_until(node)
  check(node)
end

#on_while(node) ⇒ Object



30
31
32
# File 'lib/rubocop/cop/elegant/no_empty_lines_in_blocks.rb', line 30

def on_while(node)
  check(node)
end