rubocop-inhouse 0.1.8 → 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: 874a0aa1b66e253256357908b57673b8656451f5b7e6c04db26fe8fff27d92a2
4
- data.tar.gz: 12f9db69d12eda04234603042a8420699d76580dec09cc5fd87f1d92571d0d6c
3
+ metadata.gz: 98d160ba6828e46ab71ef1afdf695c9acf928c600199dc08d1fd53350059b3e3
4
+ data.tar.gz: f0c637b591446b93c3129a7f7bff6a1b0d8bf9811b7931f4555e7b489c468ed2
5
5
  SHA512:
6
- metadata.gz: 5c68c7d2fb6b92c4f523f0f2b91582f1ffcbefbb52219ca8017e0acf4039d42b5c71abd518fcdbfff1c116b9a967f9fd207be032537cb7c717abe1dbcf7131a0
7
- data.tar.gz: f9dd32c19e0c5d33016eee61023a70bc343ec836275d0d324bfd896ef9b5829491762dd9c975553a76220d09d2141007dcab5bc2165b5bbdcc9218e33b6ff61a
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"
@@ -41,4 +46,3 @@ Security/CompoundHash:
41
46
 
42
47
  Security/IoMethods:
43
48
  Enabled: true
44
-
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
 
@@ -71,7 +117,7 @@ Layout/LineEndStringConcatenationIndentation:
71
117
  Layout/LineLength:
72
118
  Max: 80
73
119
  Exclude:
74
- - "spec/**/*"
120
+ - "**/spec/**/*"
75
121
 
76
122
  Layout/MultilineArrayBraceLayout:
77
123
  EnforcedStyle: new_line
@@ -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/lint.yml CHANGED
@@ -3,7 +3,7 @@ Lint/AmbiguousAssignment:
3
3
 
4
4
  Lint/AmbiguousBlockAssociation:
5
5
  Exclude:
6
- - "spec/**/*.rb"
6
+ - "**/spec/**/*.rb"
7
7
 
8
8
  Lint/AmbiguousOperatorPrecedence:
9
9
  Enabled: true
data/config/metrics.yml CHANGED
@@ -4,17 +4,17 @@ Metrics/AbcSize:
4
4
  # Excluding controllers here because respond_to blocks and others make this
5
5
  # higher than they otherwise should be
6
6
  Exclude:
7
- - "app/controllers/**/*"
8
- - "app/views/**/*.rb"
7
+ - "**/app/controllers/**/*"
8
+ - "**/app/views/**/*.rb"
9
9
 
10
10
  Metrics/BlockLength:
11
11
  CountComments: false
12
12
  Max: 25
13
13
  Exclude:
14
- - "spec/**/*.rb"
15
- - "config/**/*.rb"
16
- - "app/views/**/*.rb"
17
- - "lib/tasks/**/*.rake"
14
+ - "**/app/controllers/**/*.rb"
15
+ - "**/spec/**/*.rb"
16
+ - "**/config/**/*.rb"
17
+ - "**/app/views/**/*.rb"
18
18
  - "**/*.rake"
19
19
 
20
20
  Metrics/CollectionLiteralLength:
@@ -24,8 +24,8 @@ Metrics/ClassLength:
24
24
  CountAsOne: ["array", "hash"]
25
25
  Max: 100
26
26
  Exclude:
27
- - "app/controllers/**/*.rb"
28
- - "app/views/**/*.rb"
27
+ - "**/app/controllers/**/*.rb"
28
+ - "**/app/views/**/*.rb"
29
29
 
30
30
  Metrics/CyclomaticComplexity:
31
31
  Max: 10
@@ -34,19 +34,22 @@ Metrics/MethodLength:
34
34
  CountAsOne: ["array", "hash", "method_call"]
35
35
  Max: 20
36
36
  Exclude:
37
- - "app/views/**/*.rb"
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"]
41
44
  Max: 100
42
45
  Exclude:
43
- - "spec/**/*.rb"
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:
50
53
  Max: 8
51
54
  Exclude:
52
- - "app/views/**/*.rb"
55
+ - "**/app/views/**/*.rb"
@@ -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
 
@@ -159,9 +169,9 @@ Rails/SaveBang:
159
169
  Enabled: true
160
170
  AllowImplicitReturn: false
161
171
  Exclude:
162
- - "spec/**/*.rb"
163
- - "config/**/*.rb"
164
- - "lib/**/*.rb"
172
+ - "**/spec/**/*.rb"
173
+ - "**/config/**/*.rb"
174
+ - "**/lib/**/*.rb"
165
175
 
166
176
  Rails/ShortI18n:
167
177
  Enabled: true
data/config/rspec.yml CHANGED
@@ -67,96 +67,96 @@ RSpec/VerifiedDoubleReference:
67
67
  RSpec/SpecFilePathFormat:
68
68
  Enabled: true
69
69
  Exclude:
70
- - "spec/factories/**/*.rb"
71
- - "spec/components/**/*.rb"
70
+ - "**/spec/factories/**/*.rb"
71
+ - "**/spec/components/**/*.rb"
72
72
 
73
73
  RSpec/MissingExampleGroupArgument:
74
74
  Enabled: true
75
75
  Exclude:
76
- - 'spec/factories/**/*.rb'
76
+ - '**/spec/factories/**/*.rb'
77
77
 
78
78
  RSpec/EmptyExampleGroup:
79
79
  Enabled: true
80
80
  Exclude:
81
- - 'spec/factories/**/*.rb'
81
+ - '**/spec/factories/**/*.rb'
82
82
 
83
83
  RSpec/AnyInstance:
84
84
  Enabled: false
85
85
  Exclude:
86
- - 'spec/factories/**/*.rb'
86
+ - '**/spec/factories/**/*.rb'
87
87
 
88
88
  RSpec/BeforeAfterAll:
89
89
  Enabled: false
90
90
  Exclude:
91
- - 'spec/factories/**/*.rb'
91
+ - '**/spec/factories/**/*.rb'
92
92
 
93
93
  RSpec/ContextWording:
94
94
  Enabled: false
95
95
  Exclude:
96
- - 'spec/factories/**/*.rb'
96
+ - '**/spec/factories/**/*.rb'
97
97
 
98
98
  RSpec/DescribeClass:
99
99
  Enabled: false
100
100
  Exclude:
101
- - 'spec/factories/**/*.rb'
101
+ - '**/spec/factories/**/*.rb'
102
102
 
103
103
  RSpec/ExampleLength:
104
104
  Enabled: false
105
105
  Exclude:
106
- - 'spec/factories/**/*.rb'
106
+ - '**/spec/factories/**/*.rb'
107
107
 
108
108
  RSpec/ExpectInHook:
109
109
  Enabled: false
110
110
  Exclude:
111
- - 'spec/factories/**/*.rb'
111
+ - '**/spec/factories/**/*.rb'
112
112
 
113
113
  RSpec/InstanceVariable:
114
114
  Enabled: false
115
115
  Exclude:
116
- - 'spec/factories/**/*.rb'
116
+ - '**/spec/factories/**/*.rb'
117
117
 
118
118
  RSpec/LetSetup:
119
119
  Enabled: false
120
120
  Exclude:
121
- - 'spec/factories/**/*.rb'
121
+ - '**/spec/factories/**/*.rb'
122
122
 
123
123
  RSpec/MessageChain:
124
124
  Enabled: false
125
125
  Exclude:
126
- - 'spec/factories/**/*.rb'
126
+ - '**/spec/factories/**/*.rb'
127
127
 
128
128
  RSpec/MessageSpies:
129
129
  Enabled: false
130
130
  Exclude:
131
- - 'spec/factories/**/*.rb'
131
+ - '**/spec/factories/**/*.rb'
132
132
 
133
133
  RSpec/MultipleExpectations:
134
134
  Enabled: false
135
135
  Exclude:
136
- - 'spec/factories/**/*.rb'
136
+ - '**/spec/factories/**/*.rb'
137
137
 
138
138
  RSpec/NamedSubject:
139
139
  Enabled: false
140
140
  Exclude:
141
- - 'spec/factories/**/*.rb'
141
+ - '**/spec/factories/**/*.rb'
142
142
 
143
143
  RSpec/NestedGroups:
144
144
  Max: 7
145
145
  Exclude:
146
- - 'spec/factories/**/*.rb'
146
+ - '**/spec/factories/**/*.rb'
147
147
 
148
148
  RSpec/SubjectStub:
149
149
  Enabled: false
150
150
  Exclude:
151
- - 'spec/factories/**/*.rb'
151
+ - '**/spec/factories/**/*.rb'
152
152
 
153
153
  RSpec/VerifiedDoubles:
154
154
  Enabled: false
155
155
  Exclude:
156
- - 'spec/factories/**/*.rb'
156
+ - '**/spec/factories/**/*.rb'
157
157
 
158
158
  RSpec/VoidExpect:
159
159
  Enabled: false
160
160
  Exclude:
161
- - 'spec/factories/**/*.rb'
161
+ - '**/spec/factories/**/*.rb'
162
162
 
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
 
@@ -12,7 +16,11 @@ Style/AutoResourceCleanup:
12
16
 
13
17
  Style/BlockDelimiters:
14
18
  Exclude:
15
- - app/views/**/*.rb
19
+ - "**/app/views/**/*.rb"
20
+
21
+ # Prefer Foo.method over Foo::method
22
+ Style/ColonMethodCall:
23
+ Enabled: true
16
24
 
17
25
  Style/CollectionCompact:
18
26
  Enabled: true
@@ -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.8"
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.8
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-07-07 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