forked from simplecov-ruby/simplecov
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.rubocop.yml
194 lines (155 loc) · 5.64 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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
AllCops:
Exclude:
- "spec/fixtures/iso-8859.rb"
- "spec/fixtures/utf-8.rb"
- "spec/fixtures/utf-8-magic.rb"
- "spec/fixtures/euc-jp.rb"
- "spec/fixtures/empty_euc-jp.rb"
- "spec/fixtures/euc-jp-shebang.rb"
- "test_projects/**/*"
- "tmp/**/*"
- "vendor/bundle/**/*"
- "vendor/bundle/**/.*"
TargetRubyVersion: 2.4
Bundler/OrderedGems:
Description: Gems should be alphabetically sorted within groups.
Enabled: false
# Open for revision would like table style but the impact
# would probably be huge
Layout/HashAlignment:
Enabled: false
Lint/AmbiguousRegexpLiteral:
Description: Checks for ambiguous regexp literals in the first argument of a method invocation without parentheses.
Exclude:
- "features/**/*_steps.rb"
- "spec/**/*_steps.rb"
- "tmp/**/*_steps.rb"
Metrics/AbcSize:
Description: Checks that the ABC size of methods is not higher than the configured maximum.
Max: 25 # TODO: Lower to 15
Metrics/BlockLength:
Description: Checks if the length of a block exceeds some maximum value.
Exclude:
- "spec/**/*.rb"
Metrics/BlockNesting:
Description: Avoid excessive block nesting.
StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#three-is-the-number-thou-shalt-count
Max: 2
Metrics/ClassLength:
Max: 300
Layout/LineLength:
Description: Checks the length of lines in the source code.
AllowURI: true
Enabled: false
Metrics/MethodLength:
Description: Checks if the length of a method exceeds some maximum value.
CountComments: false
Max: 12 # TODO: Lower to 10
Metrics/ModuleLength:
Description: Avoid modules longer than 100 lines of code.
Exclude:
- "lib/simplecov.rb"
Metrics/ParameterLists:
Description: Avoid parameter lists longer than three or four parameters.
StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#too-many-params
Max: 4
CountKeywordArgs: true
Layout/AccessModifierIndentation:
Description: Modifiers should be indented as deep as method definitions,
or as deep as the class/module keyword, depending on configuration.
EnforcedStyle: outdent
Style/CollectionMethods:
Description: Enforces the use of consistent method names from the Enumerable module.
PreferredMethods:
map: "collect"
reduce: "inject"
find: "detect"
find_all: "select"
Style/Documentation:
Description: Checks for missing top-level documentation of classes and modules.
Enabled: false
Style/DoubleNegation:
Description: Checks for uses of double negation (!!).
StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-bang-bang
Enabled: false
Style/HashSyntax:
Description: Checks hash literal syntax.
EnforcedStyle: ruby19
Layout/HeredocIndentation:
Description: Checks the indentation of the here document bodies.
Enabled: false
Style/RegexpLiteral:
Description: Use / or %r around regular expressions.
StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#percent-r
Enabled: false
Layout/SpaceInsideHashLiteralBraces:
Description: Use spaces inside hash literal braces - or don't.
StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#spaces-operators
EnforcedStyle: no_space
Style/SpecialGlobalVars:
Description: Looks for uses of Perl-style global variables.
Exclude:
- "spec/deleted_source_spec.rb"
- "spec/return_codes_spec.rb"
- "lib/simplecov/defaults.rb"
Style/StringLiterals:
Description: Allow double-quoted strings without interpolation.
EnforcedStyle: double_quotes
Naming/FileName:
Description: makes sure that Ruby source files have snake_case names.
Exclude:
- "spec/fixtures/utf-8.rb"
Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: no_comma
Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: no_comma
Style/GuardClause:
Description: Use a guard clause instead of wrapping the code inside a conditional expression.
Enabled: false
Style/FrozenStringLiteralComment:
Description:
Add the frozen_string_literal comment to the top of files to help transition
from Ruby 2.3.0 to Ruby 3.0.
Enabled: true
EnforcedStyle: always
Exclude:
- "spec/fixtures/**/*"
Layout/EmptyLinesAroundAttributeAccessor:
Description: Keep blank lines around attribute accessors.
Enabled: true
Layout/SpaceAroundMethodCallOperator:
Description: Checks method call operators to not have spaces around them.
Enabled: true
Lint/DeprecatedOpenSSLConstant:
Description: Don't use algorithm constants for `OpenSSL::Cipher` and `OpenSSL::Digest`.
Enabled: true
Lint/MixedRegexpCaptureTypes:
Description: Do not mix named captures and numbered captures in a Regexp literal.
Enabled: true
Lint/RaiseException:
Description: Checks for `raise` or `fail` statements which are raising `Exception` class.
Enabled: true
Lint/StructNewOverride:
Description: Disallow overriding the `Struct` built-in methods via `Struct.new`.
Enabled: true
Style/ExponentialNotation:
Description: When using exponential notation, favor a mantissa between 1 (inclusive) and 10 (exclusive).
Enabled: true
Style/HashEachMethods:
Description: Use Hash#each_key and Hash#each_value.
Enabled: true
Style/HashTransformKeys:
Description: Prefer `transform_keys` over `each_with_object` and `map`.
Enabled: true
Style/HashTransformValues:
Description: Prefer `transform_values` over `each_with_object` and `map`.
Enabled: true
Style/RedundantRegexpCharacterClass:
Description: Checks for unnecessary single-element Regexp character classes.
Enabled: true
Style/RedundantRegexpEscape:
Description: Checks for redundant escapes in Regexps.
Enabled: true
Style/SlicingWithRange:
Description: Checks array slicing is done with endless ranges when suitable.
Enabled: true