rubocop-github 0.18.0 → 0.19.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3 @@
1
+ GitHub/InsecureHashAlgorithm:
2
+ Description: 'Encourage usage of secure hash algorithms'
3
+ Enabled: pending
data/config/rails.yml CHANGED
@@ -1,127 +1,414 @@
1
1
  require:
2
+ - rubocop-github-rails
2
3
  - rubocop-rails
3
4
 
4
- Rails/OutputSafety:
5
- Enabled: true
6
-
7
- Rails/PluralizationGrammar:
8
- Enabled: true
9
-
10
- Rails/RequestReferer:
11
- Enabled: true
12
- EnforcedStyle: referrer
13
-
14
- Rails/ScopeArgs:
15
- Enabled: true
16
-
17
- Rails/UniqBeforePluck:
18
- Enabled: true
19
-
20
5
  GitHub/RailsApplicationRecord:
21
6
  Enabled: true
22
7
 
23
8
  GitHub/RailsControllerRenderActionSymbol:
24
9
  Enabled: true
25
- Include:
26
- - 'app/controllers/**/*.rb'
27
10
 
28
11
  GitHub/RailsControllerRenderLiteral:
29
12
  Enabled: true
30
- StyleGuide: https://github.com/github/rubocop-github/blob/master/guides/rails-render-literal.md
31
- Include:
32
- - 'app/controllers/**/*.rb'
33
13
 
34
14
  GitHub/RailsControllerRenderPathsExist:
35
15
  Enabled: true
36
- ViewPath:
37
- - 'app/views'
38
- Include:
39
- - 'app/controllers/**/*.rb'
40
16
 
41
17
  GitHub/RailsControllerRenderShorthand:
42
18
  Enabled: true
43
- StyleGuide: https://github.com/github/rubocop-github/blob/master/guides/rails-controller-render-shorthand.md
44
- Include:
45
- - 'app/controllers/**/*.rb'
46
19
 
47
20
  GitHub/RailsRenderInline:
48
21
  Enabled: true
49
- StyleGuide: https://github.com/github/rubocop-github/blob/master/guides/rails-controller-render-inline.md
50
- Include:
51
- - 'app/controllers/**/*.rb'
52
- - 'app/helpers/**/*.rb'
53
- - 'app/view_models/**/*.rb'
54
- - 'app/views/**/*.erb'
55
22
 
56
23
  GitHub/RailsRenderObjectCollection:
57
24
  Enabled: false
58
25
 
59
26
  GitHub/RailsViewRenderLiteral:
60
27
  Enabled: true
61
- StyleGuide: https://github.com/github/rubocop-github/blob/master/guides/rails-render-literal.md
62
- Include:
63
- - 'app/helpers/**/*.rb'
64
- - 'app/view_models/**/*.rb'
65
- - 'app/views/**/*.erb'
66
28
 
67
29
  GitHub/RailsViewRenderPathsExist:
68
30
  Enabled: true
69
- ViewPath:
70
- - 'app/views'
71
- Include:
72
- - 'app/helpers/**/*.rb'
73
- - 'app/view_models/**/*.rb'
74
- - 'app/views/**/*.erb'
75
31
 
76
32
  GitHub/RailsViewRenderShorthand:
77
33
  Enabled: true
78
- Include:
79
- - 'app/helpers/**/*.rb'
80
- - 'app/view_models/**/*.rb'
81
- - 'app/views/**/*.erb'
82
-
83
- # Exclude Rails ERB files from incompatible cops
84
34
 
85
35
  Layout/BlockAlignment:
86
36
  Exclude:
87
- - 'app/views/**/*.erb'
37
+ - app/views/**/*.erb
88
38
 
89
- Style/For:
90
- Exclude:
91
- - 'app/views/**/*.erb'
92
-
93
- Style/OneLineConditional:
39
+ Layout/IndentationWidth:
94
40
  Exclude:
95
- - 'app/views/**/*.erb'
41
+ - app/views/**/*.erb
96
42
 
97
- Style/Semicolon:
43
+ Layout/InitialIndentation:
98
44
  Exclude:
99
- - 'app/views/**/*.erb'
45
+ - app/views/**/*.erb
100
46
 
101
47
  Layout/SpaceInsideParens:
102
48
  Exclude:
103
- - 'app/views/**/*.erb'
104
-
105
- Style/StringLiterals:
106
- Exclude:
107
- - 'app/views/**/*.erb'
49
+ - app/views/**/*.erb
108
50
 
109
51
  Layout/TrailingEmptyLines:
110
52
  Exclude:
111
- - 'app/views/**/*.erb'
53
+ - app/views/**/*.erb
112
54
 
113
55
  Layout/TrailingWhitespace:
114
56
  Exclude:
115
- - 'app/views/**/*.erb'
57
+ - app/views/**/*.erb
116
58
 
117
- Layout/IndentationWidth:
59
+ Lint/UselessAccessModifier:
60
+ ContextCreatingMethods:
61
+ - concerning
62
+
63
+ Rails/ActionControllerTestCase:
64
+ Enabled: false
65
+
66
+ Rails/ActionFilter:
67
+ Enabled: false
68
+
69
+ Rails/ActiveRecordAliases:
70
+ Enabled: false
71
+
72
+ Rails/ActiveRecordCallbacksOrder:
73
+ Enabled: false
74
+
75
+ Rails/ActiveRecordOverride:
76
+ Enabled: false
77
+
78
+ Rails/ActiveSupportAliases:
79
+ Enabled: false
80
+
81
+ Rails/AddColumnIndex:
82
+ Enabled: false
83
+
84
+ Rails/AfterCommitOverride:
85
+ Enabled: false
86
+
87
+ Rails/ApplicationController:
88
+ Enabled: false
89
+
90
+ Rails/ApplicationJob:
91
+ Enabled: false
92
+
93
+ Rails/ApplicationMailer:
94
+ Enabled: false
95
+
96
+ Rails/ApplicationRecord:
97
+ Enabled: false
98
+
99
+ Rails/ArelStar:
100
+ Enabled: false
101
+
102
+ Rails/AssertNot:
103
+ Enabled: false
104
+
105
+ Rails/AttributeDefaultBlockValue:
106
+ Enabled: false
107
+
108
+ Rails/BelongsTo:
109
+ Enabled: false
110
+
111
+ Rails/Blank:
112
+ Enabled: false
113
+
114
+ Rails/BulkChangeTable:
115
+ Enabled: false
116
+
117
+ Rails/CompactBlank:
118
+ Enabled: false
119
+
120
+ Rails/ContentTag:
121
+ Enabled: false
122
+
123
+ Rails/CreateTableWithTimestamps:
124
+ Enabled: false
125
+
126
+ Rails/Date:
127
+ Enabled: false
128
+
129
+ Rails/DefaultScope:
130
+ Enabled: false
131
+
132
+ Rails/Delegate:
133
+ Enabled: false
134
+
135
+ Rails/DelegateAllowBlank:
136
+ Enabled: false
137
+
138
+ Rails/DeprecatedActiveModelErrorsMethods:
139
+ Enabled: false
140
+
141
+ Rails/DotSeparatedKeys:
142
+ Enabled: false
143
+
144
+ Rails/DuplicateAssociation:
145
+ Enabled: false
146
+
147
+ Rails/DuplicateScope:
148
+ Enabled: false
149
+
150
+ Rails/DurationArithmetic:
151
+ Enabled: false
152
+
153
+ Rails/DynamicFindBy:
154
+ Enabled: false
155
+
156
+ Rails/EagerEvaluationLogMessage:
157
+ Enabled: false
158
+
159
+ Rails/EnumHash:
160
+ Enabled: false
161
+
162
+ Rails/EnumUniqueness:
163
+ Enabled: false
164
+
165
+ Rails/EnvironmentComparison:
166
+ Enabled: false
167
+
168
+ Rails/EnvironmentVariableAccess:
169
+ Enabled: false
170
+
171
+ Rails/Exit:
172
+ Enabled: false
173
+
174
+ Rails/ExpandedDateRange:
175
+ Enabled: false
176
+
177
+ Rails/FilePath:
178
+ Enabled: false
179
+
180
+ Rails/FindBy:
181
+ Enabled: false
182
+
183
+ Rails/FindById:
184
+ Enabled: false
185
+
186
+ Rails/FindEach:
187
+ Enabled: false
188
+
189
+ Rails/HasAndBelongsToMany:
190
+ Enabled: false
191
+
192
+ Rails/HasManyOrHasOneDependent:
193
+ Enabled: false
194
+
195
+ Rails/HelperInstanceVariable:
196
+ Enabled: false
197
+
198
+ Rails/HttpPositionalArguments:
199
+ Enabled: false
200
+
201
+ Rails/HttpStatus:
202
+ Enabled: false
203
+
204
+ Rails/I18nLazyLookup:
205
+ Enabled: false
206
+
207
+ Rails/I18nLocaleAssignment:
208
+ Enabled: false
209
+
210
+ Rails/I18nLocaleTexts:
211
+ Enabled: false
212
+
213
+ Rails/IgnoredSkipActionFilterOption:
214
+ Enabled: false
215
+
216
+ Rails/IndexBy:
217
+ Enabled: false
218
+
219
+ Rails/IndexWith:
220
+ Enabled: false
221
+
222
+ Rails/Inquiry:
223
+ Enabled: false
224
+
225
+ Rails/InverseOf:
226
+ Enabled: false
227
+
228
+ Rails/LexicallyScopedActionFilter:
229
+ Enabled: false
230
+
231
+ Rails/LinkToBlank:
232
+ Enabled: false
233
+
234
+ Rails/MailerName:
235
+ Enabled: false
236
+
237
+ Rails/MatchRoute:
238
+ Enabled: false
239
+
240
+ Rails/MigrationClassName:
241
+ Enabled: false
242
+
243
+ Rails/NegateInclude:
244
+ Enabled: false
245
+
246
+ Rails/NotNullColumn:
247
+ Enabled: false
248
+
249
+ Rails/OrderById:
250
+ Enabled: false
251
+
252
+ Rails/Output:
253
+ Enabled: false
254
+
255
+ Rails/OutputSafety:
256
+ Enabled: true
257
+
258
+ Rails/Pick:
259
+ Enabled: false
260
+
261
+ Rails/Pluck:
262
+ Enabled: false
263
+
264
+ Rails/PluckId:
265
+ Enabled: false
266
+
267
+ Rails/PluckInWhere:
268
+ Enabled: false
269
+
270
+ Rails/PluralizationGrammar:
271
+ Enabled: true
272
+
273
+ Rails/Presence:
274
+ Enabled: false
275
+
276
+ Rails/Present:
277
+ Enabled: false
278
+
279
+ Rails/RakeEnvironment:
280
+ Enabled: false
281
+
282
+ Rails/ReadWriteAttribute:
283
+ Enabled: false
284
+
285
+ Rails/RedundantAllowNil:
286
+ Enabled: false
287
+
288
+ Rails/RedundantForeignKey:
289
+ Enabled: false
290
+
291
+ Rails/RedundantPresenceValidationOnBelongsTo:
292
+ Enabled: false
293
+
294
+ Rails/RedundantReceiverInWithOptions:
295
+ Enabled: false
296
+
297
+ Rails/RedundantTravelBack:
298
+ Enabled: false
299
+
300
+ Rails/ReflectionClassName:
301
+ Enabled: false
302
+
303
+ Rails/RefuteMethods:
304
+ Enabled: false
305
+
306
+ Rails/RelativeDateConstant:
307
+ Enabled: false
308
+
309
+ Rails/RenderInline:
310
+ Enabled: false
311
+
312
+ Rails/RenderPlainText:
313
+ Enabled: false
314
+
315
+ Rails/RequestReferer:
316
+ Enabled: true
317
+ EnforcedStyle: referrer
318
+
319
+ Rails/RequireDependency:
320
+ Enabled: false
321
+
322
+ Rails/ReversibleMigration:
323
+ Enabled: false
324
+
325
+ Rails/ReversibleMigrationMethodDefinition:
326
+ Enabled: false
327
+
328
+ Rails/RootJoinChain:
329
+ Enabled: false
330
+
331
+ Rails/RootPublicPath:
332
+ Enabled: false
333
+
334
+ Rails/SafeNavigation:
335
+ Enabled: false
336
+
337
+ Rails/SafeNavigationWithBlank:
338
+ Enabled: false
339
+
340
+ Rails/SaveBang:
341
+ Enabled: false
342
+
343
+ Rails/SchemaComment:
344
+ Enabled: false
345
+
346
+ Rails/ScopeArgs:
347
+ Enabled: true
348
+
349
+ Rails/ShortI18n:
350
+ Enabled: false
351
+
352
+ Rails/SkipsModelValidations:
353
+ Enabled: false
354
+
355
+ Rails/SquishedSQLHeredocs:
356
+ Enabled: false
357
+
358
+ Rails/StripHeredoc:
359
+ Enabled: false
360
+
361
+ Rails/TableNameAssignment:
362
+ Enabled: false
363
+
364
+ Rails/TimeZone:
365
+ Enabled: false
366
+
367
+ Rails/TimeZoneAssignment:
368
+ Enabled: false
369
+
370
+ Rails/ToFormattedS:
371
+ Enabled: false
372
+
373
+ Rails/TransactionExitStatement:
374
+ Enabled: false
375
+
376
+ Rails/UniqBeforePluck:
377
+ Enabled: true
378
+
379
+ Rails/UniqueValidationWithoutIndex:
380
+ Enabled: false
381
+
382
+ Rails/UnknownEnv:
383
+ Enabled: false
384
+
385
+ Rails/UnusedIgnoredColumns:
386
+ Enabled: false
387
+
388
+ Rails/Validation:
389
+ Enabled: false
390
+
391
+ Rails/WhereEquals:
392
+ Enabled: false
393
+
394
+ Rails/WhereExists:
395
+ Enabled: false
396
+
397
+ Rails/WhereNot:
398
+ Enabled: false
399
+
400
+ Style/For:
118
401
  Exclude:
119
- - 'app/views/**/*.erb'
402
+ - app/views/**/*.erb
120
403
 
121
- Layout/InitialIndentation:
404
+ Style/OneLineConditional:
122
405
  Exclude:
123
- - 'app/views/**/*.erb'
406
+ - app/views/**/*.erb
124
407
 
125
- Lint/UselessAccessModifier:
126
- ContextCreatingMethods:
127
- - concerning
408
+ Style/Semicolon:
409
+ Exclude:
410
+ - app/views/**/*.erb
411
+
412
+ Style/StringLiterals:
413
+ Exclude:
414
+ - app/views/**/*.erb
@@ -0,0 +1,62 @@
1
+ GitHub/RailsApplicationRecord:
2
+ Enabled: pending
3
+
4
+ GitHub/RailsControllerRenderActionSymbol:
5
+ Enabled: pending
6
+ Include:
7
+ - 'app/controllers/**/*.rb'
8
+
9
+ GitHub/RailsControllerRenderLiteral:
10
+ Enabled: pending
11
+ StyleGuide: https://github.com/github/rubocop-github/blob/master/guides/rails-render-literal.md
12
+ Include:
13
+ - 'app/controllers/**/*.rb'
14
+
15
+ GitHub/RailsControllerRenderPathsExist:
16
+ Enabled: pending
17
+ ViewPath:
18
+ - 'app/views'
19
+ Include:
20
+ - 'app/controllers/**/*.rb'
21
+
22
+ GitHub/RailsControllerRenderShorthand:
23
+ Enabled: pending
24
+ StyleGuide: https://github.com/github/rubocop-github/blob/master/guides/rails-controller-render-shorthand.md
25
+ Include:
26
+ - 'app/controllers/**/*.rb'
27
+
28
+ GitHub/RailsRenderInline:
29
+ Enabled: pending
30
+ StyleGuide: https://github.com/github/rubocop-github/blob/master/guides/rails-controller-render-inline.md
31
+ Include:
32
+ - 'app/controllers/**/*.rb'
33
+ - 'app/helpers/**/*.rb'
34
+ - 'app/view_models/**/*.rb'
35
+ - 'app/views/**/*.erb'
36
+
37
+ GitHub/RailsRenderObjectCollection:
38
+ Enabled: pending
39
+
40
+ GitHub/RailsViewRenderLiteral:
41
+ Enabled: pending
42
+ StyleGuide: https://github.com/github/rubocop-github/blob/master/guides/rails-render-literal.md
43
+ Include:
44
+ - 'app/helpers/**/*.rb'
45
+ - 'app/view_models/**/*.rb'
46
+ - 'app/views/**/*.erb'
47
+
48
+ GitHub/RailsViewRenderPathsExist:
49
+ Enabled: pending
50
+ ViewPath:
51
+ - 'app/views'
52
+ Include:
53
+ - 'app/helpers/**/*.rb'
54
+ - 'app/view_models/**/*.rb'
55
+ - 'app/views/**/*.erb'
56
+
57
+ GitHub/RailsViewRenderShorthand:
58
+ Enabled: pending
59
+ Include:
60
+ - 'app/helpers/**/*.rb'
61
+ - 'app/view_models/**/*.rb'
62
+ - 'app/views/**/*.erb'
@@ -1,13 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "rubocop/cop/github/insecure_hash_algorithm"
4
- require "rubocop/cop/github/rails_application_record"
5
- require "rubocop/cop/github/rails_controller_render_action_symbol"
6
- require "rubocop/cop/github/rails_controller_render_literal"
7
- require "rubocop/cop/github/rails_controller_render_paths_exist"
8
- require "rubocop/cop/github/rails_controller_render_shorthand"
9
- require "rubocop/cop/github/rails_render_inline"
10
- require "rubocop/cop/github/rails_render_object_collection"
11
- require "rubocop/cop/github/rails_view_render_literal"
12
- require "rubocop/cop/github/rails_view_render_paths_exist"
13
- require "rubocop/cop/github/rails_view_render_shorthand"
3
+ require "rubocop-github"
4
+ require "rubocop-rails"
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RuboCop
4
+ module GitHub
5
+ # Because RuboCop doesn't yet support plugins, we have to monkey patch in a
6
+ # bit of our configuration. Borrowed from:
7
+ # https://github.com/rubocop/rubocop-rails/blob/f36121946359615a26c9a941763abd1470693e8d/lib/rubocop/rails/inject.rb
8
+ module Inject
9
+ def self.default_defaults!
10
+ _load_config(CONFIG_DEFAULT)
11
+ end
12
+
13
+ def self.rails_defaults!
14
+ _load_config(CONFIG_RAILS)
15
+ end
16
+
17
+ def self._load_config(path)
18
+ path = path.to_s
19
+ hash = ConfigLoader.send(:load_yaml_configuration, path)
20
+ config = Config.new(hash, path).tap(&:make_excludes_absolute)
21
+ puts "configuration from #{path}" if ConfigLoader.debug?
22
+ config = ConfigLoader.merge_with_default(config, path, unset_nil: false)
23
+ ConfigLoader.instance_variable_set(:@default_configuration, config)
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RuboCop
4
+ module GitHub
5
+ PROJECT_ROOT = Pathname.new(__dir__).parent.parent.expand_path.freeze
6
+ CONFIG_DEFAULT = PROJECT_ROOT.join("config", "default_cops.yml").freeze
7
+ CONFIG_RAILS = PROJECT_ROOT.join("config", "rails_cops.yml").freeze
8
+ end
9
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rubocop"
4
+ require "rubocop/github"
5
+ require "rubocop/github/inject"
6
+
7
+ RuboCop::GitHub::Inject.rails_defaults!
8
+
9
+ require "rubocop/cop/github/rails_application_record"
10
+ require "rubocop/cop/github/rails_controller_render_action_symbol"
11
+ require "rubocop/cop/github/rails_controller_render_literal"
12
+ require "rubocop/cop/github/rails_controller_render_paths_exist"
13
+ require "rubocop/cop/github/rails_controller_render_shorthand"
14
+ require "rubocop/cop/github/rails_render_inline"
15
+ require "rubocop/cop/github/rails_render_object_collection"
16
+ require "rubocop/cop/github/rails_view_render_literal"
17
+ require "rubocop/cop/github/rails_view_render_paths_exist"
18
+ require "rubocop/cop/github/rails_view_render_shorthand"
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rubocop"
4
+ require "rubocop/github"
5
+ require "rubocop/github/inject"
6
+
7
+ RuboCop::GitHub::Inject.default_defaults!
8
+
9
+ require "rubocop/cop/github/insecure_hash_algorithm"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-github
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.0
4
+ version: 0.19.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-27 00:00:00.000000000 Z
11
+ date: 2022-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -104,10 +104,14 @@ files:
104
104
  - README.md
105
105
  - STYLEGUIDE.md
106
106
  - config/default.yml
107
+ - config/default_cops.yml
107
108
  - config/rails.yml
109
+ - config/rails_cops.yml
108
110
  - guides/rails-controller-render-shorthand.md
109
111
  - guides/rails-render-inline.md
110
112
  - guides/rails-render-literal.md
113
+ - lib/rubocop-github-rails.rb
114
+ - lib/rubocop-github.rb
111
115
  - lib/rubocop/cop/github.rb
112
116
  - lib/rubocop/cop/github/insecure_hash_algorithm.rb
113
117
  - lib/rubocop/cop/github/rails_application_record.rb
@@ -121,6 +125,8 @@ files:
121
125
  - lib/rubocop/cop/github/rails_view_render_paths_exist.rb
122
126
  - lib/rubocop/cop/github/rails_view_render_shorthand.rb
123
127
  - lib/rubocop/cop/github/render_literal_helpers.rb
128
+ - lib/rubocop/github.rb
129
+ - lib/rubocop/github/inject.rb
124
130
  homepage: https://github.com/github/rubocop-github
125
131
  licenses:
126
132
  - MIT
@@ -140,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
146
  - !ruby/object:Gem::Version
141
147
  version: '0'
142
148
  requirements: []
143
- rubygems_version: 3.2.22
149
+ rubygems_version: 3.3.7
144
150
  signing_key:
145
151
  specification_version: 4
146
152
  summary: RuboCop GitHub