rubocop-inhouse 0.1.9 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 48f54735ce42a48166773964182081e2c6bf5bb318ac6cd14d111ec507abb883
4
- data.tar.gz: 23a1296e201ccaacd634607cad7549aa5fe61142dc6f9aa6c9cf3817408bb6fc
3
+ metadata.gz: 98d160ba6828e46ab71ef1afdf695c9acf928c600199dc08d1fd53350059b3e3
4
+ data.tar.gz: f0c637b591446b93c3129a7f7bff6a1b0d8bf9811b7931f4555e7b489c468ed2
5
5
  SHA512:
6
- metadata.gz: e5845c84fa0bdfb15792a6de131f27033b11cc35e8d0594456d0f91139b6ddc4118a825ec14cb95bfa4cfa871d4ad6a3dad57dc682d42fa59632905298197e57
7
- data.tar.gz: 76c4324593f42790e40cbf3201e61b4c3f82db287e48369d469ebd4ae899dbe12407dba9a04b655a740fc84783f3dde511f25b85bc00b97941592be6fd0b6a6d
6
+ metadata.gz: f99a568c805e79b5e3fa34726ceea2bb5793c30c7190c40b2016705e6fed324983d0503109daf91c64d89358d767f3ad00359aaeb0b437108110dc9045c8a606
7
+ data.tar.gz: cb7b055f488480d1550f3c4fb3f59581003abd1d18a0fc966711adb20df10bc8bd7cad5145ebaf1159f34e2a912f290427d3f8da45a622f6aa027e14fa622feb
data/config/default.yml CHANGED
@@ -1,9 +1,12 @@
1
1
  require:
2
- - rubocop-inhouse
3
2
  - rubocop-performance
4
3
  - rubocop-rspec
5
4
  - rubocop-rake
6
5
 
6
+ inherit_mode:
7
+ merge:
8
+ - Exclude
9
+
7
10
  inherit_from:
8
11
  - ./layout.yml
9
12
  - ./lint.yml
@@ -14,7 +17,9 @@ inherit_from:
14
17
 
15
18
  AllCops:
16
19
  NewCops: enable
20
+ SuggestExtensions: false
17
21
  Exclude:
22
+ - "data/**/*"
18
23
  - "**/bin/*"
19
24
  - "**/db/migrate/*.rb"
20
25
  - "**/db/schema.rb"
data/config/layout.yml CHANGED
@@ -26,8 +26,40 @@ Layout/ClassStructure:
26
26
  - private_delegate
27
27
  - private_methods
28
28
 
29
+ Layout/CaseIndentation:
30
+ Enabled: true
31
+ EnforcedStyle: end
32
+
33
+ Layout/CommentIndentation:
34
+ Enabled: true
35
+
36
+ Layout/ElseAlignment:
37
+ Enabled: true
38
+
39
+ Layout/EmptyLineAfterMagicComment:
40
+ Enabled: true
41
+
42
+ Layout/EmptyLinesAroundBlockBody:
43
+ Enabled: true
44
+ EnforcedStyle: no_empty_lines
45
+
46
+ Layout/EmptyLinesAroundClassBody:
47
+ Enabled: true
48
+ EnforcedStyle: no_empty_lines
49
+
50
+ Layout/EmptyLinesAroundMethodBody:
51
+ Enabled: true
52
+
53
+ Layout/EmptyLinesAroundModuleBody:
54
+ Enabled: true
55
+ EnforcedStyle: no_empty_lines
56
+
57
+ # Align `end` with the matching keyword or starting expression except for
58
+ # assignments, where it should be aligned with the LHS.
29
59
  Layout/EndAlignment:
60
+ Enabled: true
30
61
  EnforcedStyleAlignWith: variable
62
+ AutoCorrect: true
31
63
 
32
64
  Layout/FirstArgumentIndentation:
33
65
  EnforcedStyle: consistent
@@ -50,7 +82,18 @@ Layout/FirstMethodArgumentLineBreak:
50
82
  Layout/FirstMethodParameterLineBreak:
51
83
  Enabled: true
52
84
 
85
+ Layout/IndentationConsistency:
86
+ Enabled: true
87
+
88
+ # Detect hard tabs, no hard tabs.
89
+ Layout/IndentationStyle:
90
+ Enabled: true
91
+
92
+ # Two spaces, no tabs (for indentation).
93
+ #
94
+ # Doesn't behave properly with private-only concerns, so it's disabled.
53
95
  Layout/IndentationWidth:
96
+ Enabled: false
54
97
  Exclude:
55
98
  - "**/*.erb"
56
99
 
@@ -58,6 +101,9 @@ Layout/InitialIndentation:
58
101
  Exclude:
59
102
  - "**/*.erb"
60
103
 
104
+ Layout/LeadingCommentSpace:
105
+ Enabled: true
106
+
61
107
  Layout/LineContinuationSpacing:
62
108
  Enabled: true
63
109
 
@@ -102,13 +148,6 @@ Layout/MultilineMethodCallBraceLayout:
102
148
  Layout/MultilineMethodCallIndentation:
103
149
  EnforcedStyle: indented
104
150
 
105
- Layout/SpaceAroundMethodCallOperator:
106
- Enabled: true
107
-
108
- Layout/SpaceInsideParens:
109
- Exclude:
110
- - "**/*.erb"
111
-
112
151
  Layout/MultilineMethodDefinitionBraceLayout:
113
152
  EnforcedStyle: new_line
114
153
 
@@ -118,14 +157,65 @@ Layout/MultilineMethodParameterLineBreaks:
118
157
  Layout/ParameterAlignment:
119
158
  EnforcedStyle: with_fixed_indentation
120
159
 
121
- Layout/SingleLineBlockChain:
160
+ # Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
161
+ Lint/RequireParentheses:
122
162
  Enabled: true
123
163
 
124
- Layout/SpaceBeforeBrackets:
164
+ Lint/UriEscapeUnescape:
165
+ Enabled: true
166
+
167
+ Layout/SpaceAfterColon:
125
168
  Enabled: true
126
169
 
170
+ Layout/SpaceAfterComma:
171
+ Enabled: true
172
+
173
+ Layout/SpaceAroundEqualsInParameterDefault:
174
+ Enabled: true
175
+
176
+ Layout/SpaceAroundKeyword:
177
+ Enabled: true
178
+
179
+ # Use `foo {}` not `foo{}`.
180
+ Layout/SpaceBeforeBlockBraces:
181
+ Enabled: true
182
+
183
+ Layout/SpaceBeforeComma:
184
+ Enabled: true
185
+
186
+ Layout/SpaceBeforeFirstArg:
187
+ Enabled: true
188
+
189
+ # Use `->(x, y) { x + y }` not `-> (x, y) { x + y }`
127
190
  Layout/SpaceInLambdaLiteral:
128
- EnforcedStyle: require_no_space
191
+ Enabled: true
192
+
193
+ Layout/SpaceInsideBlockBraces:
194
+ Enabled: true
195
+ EnforcedStyleForEmptyBraces: space
196
+
197
+ Layout/SpaceInsideHashLiteralBraces:
198
+ Enabled: true
199
+ EnforcedStyle: space
200
+ EnforcedStyleForEmptyBraces: no_space
201
+
202
+ Layout/SpaceAroundMethodCallOperator:
203
+ Enabled: true
204
+
205
+ Layout/SpaceInsideParens:
206
+ Enabled: true
207
+ Exclude:
208
+ - "**/*.erb"
209
+
210
+ # Use `hash[:key]` not `hash[ :key ]`
211
+ Layout/SpaceInsideReferenceBrackets:
212
+ Enabled: true
213
+
214
+ Layout/SingleLineBlockChain:
215
+ Enabled: true
216
+
217
+ Layout/SpaceBeforeBrackets:
218
+ Enabled: true
129
219
 
130
220
  Layout/TrailingEmptyLines:
131
221
  Exclude:
data/config/metrics.yml CHANGED
@@ -11,10 +11,10 @@ Metrics/BlockLength:
11
11
  CountComments: false
12
12
  Max: 25
13
13
  Exclude:
14
+ - "**/app/controllers/**/*.rb"
14
15
  - "**/spec/**/*.rb"
15
16
  - "**/config/**/*.rb"
16
17
  - "**/app/views/**/*.rb"
17
- - "**/lib/tasks/**/*.rake"
18
18
  - "**/*.rake"
19
19
 
20
20
  Metrics/CollectionLiteralLength:
@@ -35,6 +35,9 @@ Metrics/MethodLength:
35
35
  Max: 20
36
36
  Exclude:
37
37
  - "**/app/views/**/*.rb"
38
+ - "**/app/controllers/**/*.rb"
39
+ - "**/app/views/**/*.rb"
40
+ - "**/spec/**/*.rb"
38
41
 
39
42
  Metrics/ModuleLength:
40
43
  CountAsOne: ["array", "hash"]
@@ -43,7 +46,7 @@ Metrics/ModuleLength:
43
46
  - "**/spec/**/*.rb"
44
47
 
45
48
  Metrics/ParameterLists:
46
- Max: 2
49
+ Max: 3
47
50
  CountKeywordArgs: false
48
51
 
49
52
  Metrics/PerceivedComplexity:
@@ -1,3 +1,8 @@
1
+ Performance:
2
+ Exclude:
3
+ - "spec/**/*"
4
+ - "test/**/*"
5
+
1
6
  Performance/AncestorsInclude:
2
7
  Enabled: true
3
8
 
@@ -16,6 +21,9 @@ Performance/ConcurrentMonotonicTime:
16
21
  Performance/ConstantRegexp:
17
22
  Enabled: true
18
23
 
24
+ Performance/FlatMap:
25
+ Enabled: true
26
+
19
27
  Performance/MapCompact:
20
28
  Enabled: true
21
29
 
@@ -54,3 +62,6 @@ Performance/StringInclude:
54
62
 
55
63
  Performance/Sum:
56
64
  Enabled: true
65
+
66
+ Performance/UnfreezeString:
67
+ Enabled: true
data/config/rails.yml CHANGED
@@ -33,6 +33,16 @@ Rails/ActiveSupportOnLoad:
33
33
  Rails/AddColumnIndex:
34
34
  Enabled: true
35
35
 
36
+ # Prefer assert_not over assert !
37
+ Rails/AssertNot:
38
+ Include:
39
+ - "test/**/*"
40
+
41
+ # Prefer assert_not_x over refute_x
42
+ Rails/RefuteMethods:
43
+ Include:
44
+ - "test/**/*"
45
+
36
46
  Rails/AttributeDefaultBlockValue:
37
47
  Enabled: true
38
48
 
data/config/style.yml CHANGED
@@ -1,3 +1,7 @@
1
+ # We generally prefer &&/|| but like low-precedence and/or in context
2
+ Style/AndOr:
3
+ Enabled: false
4
+
1
5
  Style/ArgumentsForwarding:
2
6
  Enabled: true
3
7
 
@@ -14,6 +18,10 @@ Style/BlockDelimiters:
14
18
  Exclude:
15
19
  - "**/app/views/**/*.rb"
16
20
 
21
+ # Prefer Foo.method over Foo::method
22
+ Style/ColonMethodCall:
23
+ Enabled: true
24
+
17
25
  Style/CollectionCompact:
18
26
  Enabled: true
19
27
 
@@ -32,6 +40,9 @@ Style/ConcatArrayLiterals:
32
40
  Style/DataInheritance:
33
41
  Enabled: true
34
42
 
43
+ Style/DefWithParentheses:
44
+ Enabled: true
45
+
35
46
  Style/DirEmpty:
36
47
  Enabled: true
37
48
 
@@ -41,6 +52,9 @@ Style/Documentation:
41
52
  Style/DocumentDynamicEvalDefinition:
42
53
  Enabled: true
43
54
 
55
+ Style/EmptyMethod:
56
+ Enabled: false
57
+
44
58
  Style/EmptyHeredoc:
45
59
  Enabled: true
46
60
 
@@ -75,6 +89,11 @@ Style/HashConversion:
75
89
  Style/HashExcept:
76
90
  Enabled: true
77
91
 
92
+ # Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
93
+ Style/HashSyntax:
94
+ Enabled: true
95
+ EnforcedShorthandSyntax: either
96
+
78
97
  Style/IfWithBooleanLiteralBranches:
79
98
  Enabled: true
80
99
 
@@ -117,6 +136,10 @@ Style/MethodCallWithArgsParentheses:
117
136
  Style/MethodCalledOnDoEndBlock:
118
137
  Enabled: true
119
138
 
139
+ # Defining a method with parameters needs parentheses.
140
+ Style/MethodDefParentheses:
141
+ Enabled: true
142
+
120
143
  Style/MinMaxComparison:
121
144
  Enabled: true
122
145
 
@@ -144,6 +167,20 @@ Style/NumericLiterals:
144
167
  Exclude:
145
168
  - '**/db/migrate/*'
146
169
 
170
+ Style/PercentLiteralDelimiters:
171
+ Enabled: true
172
+ PreferredDelimiters:
173
+ default: "()"
174
+ "%i": "[]"
175
+ "%I": "[]"
176
+ "%r": "{}"
177
+ "%w": "[]"
178
+ "%W": "[]"
179
+
180
+ # Use quotes for string literals when they are enough.
181
+ Style/RedundantPercentQ:
182
+ Enabled: false
183
+
147
184
  Style/ObjectThen:
148
185
  Enabled: true
149
186
  EnforcedStyle: then
@@ -160,6 +197,9 @@ Style/OptionHash:
160
197
  Style/QuotedSymbols:
161
198
  Enabled: true
162
199
 
200
+ Style/ParenthesesAroundCondition:
201
+ Enabled: true
202
+
163
203
  Style/RedundantArrayConstructor:
164
204
  Enabled: true
165
205
 
@@ -181,6 +221,10 @@ Style/RedundantRegexpArgument:
181
221
  Style/RedundantRegexpConstructor:
182
222
  Enabled: true
183
223
 
224
+ Style/RedundantReturn:
225
+ Enabled: true
226
+ AllowMultipleReturnValues: true
227
+
184
228
  Style/RedundantSelfAssignmentBranch:
185
229
  Enabled: true
186
230
 
@@ -208,6 +252,10 @@ Style/ReturnNilInPredicateMethodDefinition:
208
252
  Style/SelectByRegexp:
209
253
  Enabled: true
210
254
 
255
+ Style/Semicolon:
256
+ Enabled: true
257
+ AllowAsExpressionSeparator: true
258
+
211
259
  Style/SingleLineDoEndBlock:
212
260
  Enabled: true
213
261
 
@@ -220,11 +268,23 @@ Style/StringChars:
220
268
  Style/StringHashKeys:
221
269
  Enabled: false
222
270
 
271
+ Style/StabbyLambdaParentheses:
272
+ Enabled: true
273
+
223
274
  Style/SwapValues:
224
275
  Enabled: true
225
276
 
277
+ # Use `"foo"` not `'foo'` unless escaping is required
226
278
  Style/StringLiterals:
279
+ Enabled: true
227
280
  EnforcedStyle: double_quotes
281
+ Include:
282
+ - "app/**/*"
283
+ - "config/**/*"
284
+ - "lib/**/*"
285
+ - "test/**/*"
286
+ - "spec/**/*"
287
+ - "Gemfile"
228
288
 
229
289
  Style/StringLiteralsInInterpolation:
230
290
  EnforcedStyle: double_quotes
@@ -235,6 +295,12 @@ Style/TopLevelMethodDefinition:
235
295
  Style/TrailingCommaInBlockArgs:
236
296
  Enabled: true
237
297
 
298
+ Style/TrailingCommaInArrayLiteral:
299
+ Enabled: true
300
+
301
+ Style/TrailingCommaInHashLiteral:
302
+ Enabled: true
303
+
238
304
  Style/YAMLFileRead:
239
305
  Enabled: true
240
306
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rubocop
4
4
  module Inhouse
5
- VERSION = "0.1.9"
5
+ VERSION = "0.2.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-inhouse
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nolan J Tait
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-04 00:00:00.000000000 Z
11
+ date: 2024-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -168,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
168
168
  - !ruby/object:Gem::Version
169
169
  version: '0'
170
170
  requirements: []
171
- rubygems_version: 3.5.14
171
+ rubygems_version: 3.5.11
172
172
  signing_key:
173
173
  specification_version: 4
174
174
  summary: Rubocop configuration for InHouse projects