-
-
Notifications
You must be signed in to change notification settings - Fork 3k
/
empty_lines_around_module_body.rb
59 lines (56 loc) · 1.11 KB
/
empty_lines_around_module_body.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# frozen_string_literal: true
module RuboCop
module Cop
module Layout
# This cop checks if empty lines around the bodies of modules match
# the configuration.
#
# @example EnforcedStyle: empty_lines
# # good
#
# module Foo
#
# def bar
# # ...
# end
#
# end
#
# @example EnforcedStyle: empty_lines_except_namespace
# # good
#
# module Foo
# module Bar
#
# # ...
#
# end
# end
#
# @example EnforcedStyle: empty_lines_special
# # good
# module Foo
#
# def bar; end
#
# end
#
# @example EnforcedStyle: no_empty_lines (default)
# # good
#
# module Foo
# def bar
# # ...
# end
# end
class EmptyLinesAroundModuleBody < Base
include EmptyLinesAroundBody
extend AutoCorrector
KIND = 'module'
def on_module(node)
check(node, node.body)
end
end
end
end
end