-
Notifications
You must be signed in to change notification settings - Fork 40
/
.rubocop.yml
157 lines (131 loc) · 3.75 KB
/
.rubocop.yml
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
AllCops:
Exclude:
- 'db/schema.rb'
- 'db/seeds.rb'
## Layout
Layout/DotPosition:
EnforcedStyle: leading
SupportedStyles:
- leading
- trailing
## Lint
Lint/AmbiguousBlockAssociation:
Enabled: false
## Metrics
Metrics/AbcSize:
# The ABC size is a calculated magnitude, so this number can be a Fixnum or
# a Float.
Max: 20
Metrics/BlockLength:
Description: 'Avoid long blocks with many lines.'
Enabled: false
## Performance
# Performance/RegexpMatch:
# Enabled: false
## Style
Style/BlockDelimiters:
EnforcedStyle: line_count_based
SupportedStyles:
# The `line_count_based` style enforces braces around single line blocks and
# do..end around multi-line blocks.
- line_count_based
# The `semantic` style enforces braces around functional blocks, where the
# primary purpose of the block is to return a value and do..end for
# procedural blocks, where the primary purpose of the block is its
# side-effects.
#
# This looks at the usage of a block's method to determine its type (e.g. is
# the result of a `map` assigned to a variable or passed to another
# method) but exceptions are permitted in the `ProceduralMethods`,
# `FunctionalMethods` and `IgnoredMethods` sections below.
- semantic
# The `braces_for_chaining` style enforces braces around single line blocks
# and do..end around multi-line blocks, except for multi-line blocks whose
# return value is being chained with another method (in which case braces
# are enforced).
- braces_for_chaining
ProceduralMethods:
# Methods that are known to be procedural in nature but look functional from
# their usage, e.g.
#
# time = Benchmark.realtime do
# foo.bar
# end
#
# Here, the return value of the block is discarded but the return value of
# `Benchmark.realtime` is used.
- benchmark
- bm
- bmbm
- create
- each_with_object
- measure
- new
- realtime
- tap
- with_object
FunctionalMethods:
# Methods that are known to be functional in nature but look procedural from
# their usage, e.g.
#
# let(:foo) { Foo.new }
#
# Here, the return value of `Foo.new` is used to define a `foo` helper but
# doesn't appear to be used from the return value of `let`.
- let
- let!
- subject
- watch
IgnoredMethods:
# Methods that can be either procedural or functional and cannot be
# categorised from their usage alone, e.g.
#
# foo = lambda do |x|
# puts "Hello, #{x}"
# end
#
# foo = lambda do |x|
# x * 100
# end
#
# Here, it is impossible to tell from the return value of `lambda` whether
# the inner block's return value is significant.
- lambda
- proc
- it
Style/Documentation:
Description: 'Document classes and non-namespace modules.'
Enabled: false
Exclude:
- 'spec/**/*'
- 'test/**/*'
Style/DoubleNegation:
Description: 'Avoid the use of double negation (`!!`).'
Enabled: false
Style/FrozenStringLiteralComment:
Enabled: false
Style/MultilineBlockChain:
Description: 'Avoid multi-line chains of blocks.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
Enabled: false
Style/MutableConstant:
Description: 'Do not assign mutable objects to constants.'
Enabled: false
Style/SafeNavigation:
Enabled: false
Style/StringLiterals:
EnforcedStyle: double_quotes
Exclude:
- Gemfile
Style/FrozenStringLiteralComment:
Enabled: false
Exclude:
- app/hyperstack/components
- app/hyperstack/libs
Layout/MultilineMethodCallIndentation:
Exclude:
- 'bin/yarn'
- app/hyperstack/components
Lint/ConstantDefinitionInBlock:
Exclude:
- !ruby/regexp /_spec\.rb$/