neeto-compliance 1.0.58

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +7 -0
  2. data/.editorconfig +10 -0
  3. data/.husky/helpers/verify_neeto_audit.sh +18 -0
  4. data/.husky/pre-push +7 -0
  5. data/.neetoci/neetoci.yml +18 -0
  6. data/.overcommit.yml +47 -0
  7. data/.rubocop.yml +596 -0
  8. data/.ruby-version +1 -0
  9. data/.semaphore/semaphore.yml +33 -0
  10. data/CHANGELOG.md +375 -0
  11. data/Gemfile +36 -0
  12. data/Gemfile.lock +435 -0
  13. data/README.md +85 -0
  14. data/Rakefile +12 -0
  15. data/bin/console +15 -0
  16. data/bin/neeto-audit +11 -0
  17. data/bin/neeto_repos_verifier/client_config.json +7 -0
  18. data/bin/neeto_repos_verifier/list_verifier.rb +93 -0
  19. data/bin/setup +8 -0
  20. data/bin/sync-neeto-repos +5 -0
  21. data/bin/sync-with-neeto-commons +5 -0
  22. data/config/brakeman.ignore +604 -0
  23. data/data/neeto_repos.json +295 -0
  24. data/lib/neeto-compliance.rb +21 -0
  25. data/lib/neeto_compliance/github_access.rb +29 -0
  26. data/lib/neeto_compliance/neeto_commons.rb +16 -0
  27. data/lib/neeto_compliance/neeto_repos.rb +59 -0
  28. data/lib/neeto_compliance/runner.rb +43 -0
  29. data/lib/neeto_compliance/skippable.rb +19 -0
  30. data/lib/neeto_compliance/sync_neeto_commons/sync_bin.rb +32 -0
  31. data/lib/neeto_compliance/sync_neeto_commons/sync_formatters.rb +28 -0
  32. data/lib/neeto_compliance/sync_neeto_commons/sync_husky.rb +33 -0
  33. data/lib/neeto_compliance/sync_neeto_commons/sync_misc.rb +36 -0
  34. data/lib/neeto_compliance/sync_neeto_commons/sync_test_support.rb +38 -0
  35. data/lib/neeto_compliance/sync_neeto_commons.rb +36 -0
  36. data/lib/neeto_compliance/verifiers/auto_update_prs_with_latest_master_verifier.rb +25 -0
  37. data/lib/neeto_compliance/verifiers/base.rb +77 -0
  38. data/lib/neeto_compliance/verifiers/bump_version_with_pr_label_verifier.rb +25 -0
  39. data/lib/neeto_compliance/verifiers/bundler_version_verifier.rb +48 -0
  40. data/lib/neeto_compliance/verifiers/circleci_config_verifier.rb +25 -0
  41. data/lib/neeto_compliance/verifiers/common_gemfile_verifier.rb +25 -0
  42. data/lib/neeto_compliance/verifiers/common_initializers_verifier.rb +25 -0
  43. data/lib/neeto_compliance/verifiers/cypress_config_verifier.rb +46 -0
  44. data/lib/neeto_compliance/verifiers/cypress_plugins_index_verifier.rb +25 -0
  45. data/lib/neeto_compliance/verifiers/docker_file_dev_verifier.rb +25 -0
  46. data/lib/neeto_compliance/verifiers/environment_config_verifier.rb +38 -0
  47. data/lib/neeto_compliance/verifiers/gem_version_verifier.rb +33 -0
  48. data/lib/neeto_compliance/verifiers/gems_verifier_base.rb +44 -0
  49. data/lib/neeto_compliance/verifiers/gitignore_file_verifier.rb +37 -0
  50. data/lib/neeto_compliance/verifiers/jsconfig_verifier.rb +187 -0
  51. data/lib/neeto_compliance/verifiers/neeto_commons_sync_verifier.rb +42 -0
  52. data/lib/neeto_compliance/verifiers/neeto_gems_version_verifier.rb +36 -0
  53. data/lib/neeto_compliance/verifiers/newrelic_verifier.rb +25 -0
  54. data/lib/neeto_compliance/verifiers/node_version_verifier.rb +84 -0
  55. data/lib/neeto_compliance/verifiers/package_dependencies_version_verifier.rb +59 -0
  56. data/lib/neeto_compliance/verifiers/package_json_verifier.rb +46 -0
  57. data/lib/neeto_compliance/verifiers/roles_verifier.rb +22 -0
  58. data/lib/neeto_compliance/verifiers/ruby_version_verifier.rb +25 -0
  59. data/lib/neeto_compliance/verifiers/semaphoreci_config_verifier.rb +74 -0
  60. data/lib/neeto_compliance/verifiers/sidekiq_queues_verifier.rb +36 -0
  61. data/lib/neeto_compliance/verifiers/simplecov_config_verifier.rb +29 -0
  62. data/lib/neeto_compliance/verifiers/sitemap_config_verifier.rb +29 -0
  63. data/lib/neeto_compliance/verifiers/slugignore_file_verifier.rb +25 -0
  64. data/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/bin_files_verifier.rb +29 -0
  65. data/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/formatter_files_verifier.rb +29 -0
  66. data/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/husky_files_verifier.rb +29 -0
  67. data/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/misc_files_verifier.rb +29 -0
  68. data/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/test_support_files_verifier.rb +28 -0
  69. data/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier.rb +31 -0
  70. data/lib/neeto_compliance/verifiers/webpacker_config_verifier.rb +32 -0
  71. data/lib/neeto_compliance/verifiers_list.rb +55 -0
  72. data/lib/neeto_compliance/version.rb +5 -0
  73. data/neeto-compliance.gemspec +35 -0
  74. data/package.json +9 -0
  75. data/yarn.lock +8 -0
  76. metadata +177 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 80a41780984edd6a4481921f2531dbc8def78b1bfdbf0ee46f0d0da373ed68c5
4
+ data.tar.gz: a9f929ca04d1b40c423129d687b17478bde30ccf61f756ce35319bb7ce8d7bd8
5
+ SHA512:
6
+ metadata.gz: 5345b662e2a758765a303f1dae06efd3d1064cbb59d11e83f4084dd326b60160c30500c2866e16bd6b8336c521ca0b1ad59e036c30eb8e10aef4b2b9eb4f78b8
7
+ data.tar.gz: f7e2b81b92bc1710e70ee69c2c5ee71e740972fd6a6319282a4a4c25db60a89179c17d321a8e0e62423495553297df778e0e29fb7eea1278e4c5667f3c8563c2
data/.editorconfig ADDED
@@ -0,0 +1,10 @@
1
+ # VScode respects this. More info at editorconfig.org
2
+ root = true
3
+
4
+ [*]
5
+ charset = utf-8
6
+ end_of_line = lf
7
+ indent_size = 2
8
+ indent_style = space
9
+ insert_final_newline = true
10
+ trim_trailing_whitespace = true
@@ -0,0 +1,18 @@
1
+ #!/bin/sh
2
+
3
+ print_running_neeto_audit() {
4
+ cat <<EOT
5
+ ======================================================================================
6
+ Running:
7
+
8
+ bundle exec neeto-audit
9
+ ======================================================================================
10
+ EOT
11
+ }
12
+
13
+ verify_neeto_audit() {
14
+ print_running_neeto_audit
15
+
16
+ bundle exec neeto-audit
17
+ }
18
+
data/.husky/pre-push ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+ . "$(dirname "$0")/helpers/verify_neeto_audit.sh"
4
+
5
+ verify_neeto_audit
6
+ bundle exec sync-neeto-repos
7
+
@@ -0,0 +1,18 @@
1
+ version: v1.0
2
+ name: neetoCi
3
+ global_job_config:
4
+ setup:
5
+ - checkout
6
+ - neetoci-version ruby 3.2.2
7
+ - bundle config path 'vendor/bundle'
8
+ - bundle config set --local without 'development'
9
+ - cache restore
10
+ - bundle install --jobs 1
11
+ - cache store
12
+ jobs:
13
+ - name: CiChecks
14
+ commands:
15
+ - bundle exec neeto-audit
16
+ - bundle exec rubocop
17
+ - bundle exec rake test
18
+ - bundle exec sync-neeto-repos
data/.overcommit.yml ADDED
@@ -0,0 +1,47 @@
1
+ # Use this file to configure the Overcommit hooks you wish to use. This will
2
+ # extend the default configuration defined in:
3
+ # https://github.com/sds/overcommit/blob/master/config/default.yml
4
+ #
5
+ # At the topmost level of this YAML file is a key representing type of hook
6
+ # being run (e.g. pre-commit, commit-msg, etc.). Within each type you can
7
+ # customize each hook, such as whether to only run it on certain files (via
8
+ # `include`), whether to only display output if it fails (via `quiet`), etc.
9
+ #
10
+ # For a complete list of hooks, see:
11
+ # https://github.com/sds/overcommit/tree/master/lib/overcommit/hook
12
+ #
13
+ # For a complete list of options that you can use to customize hooks, see:
14
+ # https://github.com/sds/overcommit#configuration
15
+
16
+ PreCommit:
17
+ RuboCop:
18
+ enabled: true
19
+ command: ["bundle", "exec", "rubocop"]
20
+ flags: ["-A"]
21
+ on_warn: fail # Treat all warnings as failures
22
+ include: "**/*.rb"
23
+ ForbiddenBranches:
24
+ enabled: true
25
+ branch_patterns: ["master", "main"]
26
+ BundleInstall:
27
+ enabled: true
28
+ BundleCheck:
29
+ enabled: true
30
+
31
+ PrePush:
32
+ ForbiddenBranches:
33
+ enabled: true
34
+ branch_patterns: ["master", "main"]
35
+ RakeTarget:
36
+ enabled: true
37
+ command: ["bundle", "exec", "rake"]
38
+ targets: ["test"]
39
+ SyncNeetoRepos:
40
+ enabled: true
41
+ command: ["bundle", "exec", "sync-neeto-repos"]
42
+
43
+ CommitMsg:
44
+ SingleLineSubject:
45
+ enabled: false
46
+ TextWidth:
47
+ enabled: false
data/.rubocop.yml ADDED
@@ -0,0 +1,596 @@
1
+ # cspell:Disable
2
+ AllCops:
3
+ TargetRubyVersion: 3.1.3
4
+ # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
5
+ # to ignore them, so only the ones explicitly set in this file are enabled.
6
+ DisabledByDefault: true
7
+ # From time to time rubocop adds new cops to say rails etc.
8
+ # So rather than disabling them it's better to enable them,
9
+ # try it out and then disable them manually one by one.
10
+ NewCops: enable
11
+ Exclude:
12
+ - ".vscode/**/*"
13
+ - ".bundle/**/*"
14
+ - ".circleci/**/*"
15
+ - ".semaphore/**/*"
16
+ - "**/log/**/*"
17
+ - "**/public/**/*"
18
+ - "**/tmp/**/*"
19
+ - "**/templates/**/*"
20
+ - "**/vendor/**/*"
21
+ - "bin/**/*"
22
+ - "*.gemspec"
23
+ - "*.yml"
24
+
25
+ # ====================================================================================================
26
+ # All access modifier related rules
27
+ # ====================================================================================================
28
+ # Add a newline before and after private keyword or other access modifiers
29
+ Layout/EmptyLinesAroundAccessModifier:
30
+ Enabled: true
31
+
32
+ # This cop checks for redundant access modifiers, including those with no code,
33
+ # those which are repeated, and leading `public` modifiers in a class or module body.
34
+ Lint/UselessAccessModifier:
35
+ Enabled: true
36
+
37
+ # # bad
38
+ # class Foo
39
+ # private def bar; end
40
+ # private def baz; end
41
+ # end
42
+ # # good
43
+ # class Foo
44
+ # private
45
+ #
46
+ # def bar; end
47
+ # def baz; end
48
+ # end
49
+ Style/AccessModifierDeclarations:
50
+ Enabled: true
51
+
52
+ # # bad
53
+ # class Plumbus
54
+ # private
55
+ # def smooth; end
56
+ # end
57
+ # # good
58
+ # class Plumbus
59
+ # private
60
+ # def smooth; end
61
+ # end
62
+ Layout/AccessModifierIndentation:
63
+ Enabled: true
64
+
65
+ # ====================================================================================================
66
+ # All comment related rules
67
+ # ====================================================================================================
68
+ # Align comments with method definitions.
69
+ Layout/CommentIndentation:
70
+ Enabled: true
71
+
72
+ # Requires an empty line after frozen_string_literal: true comment
73
+ Layout/EmptyLineAfterMagicComment:
74
+ Enabled: true
75
+
76
+ # frozen_string_literal: true magic comment is required on the top of files
77
+ Style/FrozenStringLiteralComment:
78
+ Enabled: true
79
+ EnforcedStyle: always
80
+ SafeAutoCorrect: true
81
+
82
+ # ====================================================================================================
83
+ # All Class related rules
84
+ # ====================================================================================================
85
+ # Helps in brining the include statements etc to top of the class definition
86
+ Layout/ClassStructure:
87
+ Enabled: true
88
+ Description: "Enforces a canonical order of definitions within a class body."
89
+ StyleGuide: "https://github.com/rubocop/rails-style-guide#macro-style-methods"
90
+ Categories:
91
+ module_inclusions:
92
+ - include
93
+ - prepend
94
+ - extend
95
+ third_party:
96
+ - neeto_sso_track_widget_tokens
97
+ - devise
98
+ scopes:
99
+ - default_scope
100
+ - scope
101
+ attributes:
102
+ - attribute
103
+ - attr_reader
104
+ - attr_writer
105
+ - attr_accessor
106
+ enum:
107
+ - enum
108
+ store:
109
+ # https://api.rubyonrails.org/classes/ActiveRecord/Store.html
110
+ - store
111
+ associations:
112
+ - belongs_to
113
+ - has_one
114
+ - has_many
115
+ - has_and_belongs_to_many
116
+ other_macros:
117
+ - delegate
118
+ - accepts_nested_attributes_for
119
+ validations:
120
+ - validate
121
+ - validates
122
+ - validates_acceptance_of
123
+ - validates_associated
124
+ - validates_confirmation_of
125
+ - validates_exclusion_of
126
+ - validates_format_of
127
+ - validates_inclusion_of
128
+ - validates_length_of
129
+ - validates_numericality_of
130
+ - validates_presence_of
131
+ - validates_uniqueness_of
132
+ - validates_each
133
+ - validate_with
134
+ callbacks:
135
+ - before_validation
136
+ - after_validation
137
+ - before_save
138
+ - around_save
139
+ - after_save
140
+ - before_update
141
+ - around_update
142
+ - after_update
143
+ - before_create
144
+ - after_create
145
+ - before_destroy
146
+ - around_destroy
147
+ - after_destroy
148
+ - after_commit
149
+ - after_create_commit
150
+ ExpectedOrder:
151
+ - module_inclusions
152
+ - third_party
153
+ - scopes
154
+ - constants
155
+ - attributes
156
+ - enum
157
+ - store
158
+ - associations
159
+ - validations
160
+ - callbacks
161
+ - other_macros
162
+ - initializer
163
+ - public_class_methods
164
+ - public_methods
165
+ - protected_methods
166
+ - private_methods
167
+
168
+ # In a regular class definition, no empty lines around the body.
169
+ # bad
170
+ # class Foo
171
+ #
172
+ # def bar
173
+ # # ...
174
+ # end
175
+ #
176
+ # end
177
+ #
178
+ # good
179
+ # class Foo
180
+ # def bar
181
+ # # ...
182
+ # end
183
+ # end
184
+ Layout/EmptyLinesAroundClassBody:
185
+ Enabled: true
186
+
187
+ # ====================================================================================================
188
+ # All Method related rules
189
+ # ====================================================================================================
190
+ # This cop checks whether class/module/method definitions are separated by one or more empty lines.
191
+ Layout/EmptyLineBetweenDefs:
192
+ Enabled: true
193
+
194
+ # This cop checks the . position in multi-line method calls.
195
+ # The dot should be leading rather than trailing.
196
+ Layout/DotPosition:
197
+ Enabled: true
198
+ EnforcedStyle: leading
199
+
200
+ # No space in method name and the arguments
201
+ Lint/ParenthesesAsGroupedExpression:
202
+ Enabled: true
203
+
204
+ # Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg,
205
+ # when a boolean operator, && or ||, is chained along with this method/argument
206
+ Lint/RequireParentheses:
207
+ Enabled: true
208
+
209
+ # avoid redundant `return` expressions
210
+ Style/RedundantReturn:
211
+ Enabled: true
212
+ AllowMultipleReturnValues: true
213
+
214
+ # Ensures that exactly one space is used between a method name and the
215
+ # first argument for method calls without parentheses
216
+ Layout/SpaceBeforeFirstArg:
217
+ Enabled: true
218
+
219
+ # Methods that doesn't take any parameters shouldn't have paranthesis in its definition
220
+ Style/DefWithParentheses:
221
+ Enabled: true
222
+
223
+ # Defining a method with parameters needs parentheses.
224
+ Style/MethodDefParentheses:
225
+ Enabled: true
226
+
227
+ # # bad
228
+ # def some_method(arg1=:default, arg2=nil, arg3=[])
229
+ # # good
230
+ # def some_method(arg1 = :default, arg2 = nil, arg3 = [])
231
+ Layout/SpaceAroundEqualsInParameterDefault:
232
+ Enabled: true
233
+
234
+ # This cop checks for a line break before the first argument in a multi-line method call.
235
+ # # bad
236
+ # method(foo, bar,
237
+ # baz)
238
+ # # good
239
+ # method(
240
+ # foo, bar,
241
+ # baz)
242
+ Layout/FirstMethodArgumentLineBreak:
243
+ Enabled: true
244
+
245
+ # Method definitions after `private` or `protected` isolated calls need one
246
+ # extra level of indentation.
247
+ Layout/IndentationConsistency:
248
+ Enabled: true
249
+ EnforcedStyle: indented_internal_methods
250
+
251
+ # This cop checks the indentation of the method name part in method calls that span more than one line.
252
+ # # bad
253
+ # while myvariable
254
+ # .instance_method_call1
255
+ # .instance_method_call2
256
+ # # do something
257
+ # end
258
+ #
259
+ # # good
260
+ # while myvariable
261
+ # .instance_method_call1
262
+ # .instance_method_call2
263
+ #
264
+ # # do something
265
+ # end
266
+ Layout/MultilineMethodCallIndentation:
267
+ Enabled: true
268
+ EnforcedStyle: indented
269
+
270
+ # This cop ensures the indentation of the first parameter in a method definition.
271
+ Layout/FirstParameterIndentation:
272
+ Enabled: true
273
+ EnforcedStyle: consistent
274
+
275
+ # When we write method arguments in next line, indent it.
276
+ Layout/FirstArgumentIndentation:
277
+ Enabled: true
278
+ EnforcedStyle: consistent
279
+
280
+ # Alignment of args from second argument onwards should be indented
281
+ # # bad
282
+ # json.extract! comment,
283
+ # :id,
284
+ # :content,
285
+ # :created_at
286
+ # # good
287
+ # json.extract! comment,
288
+ # :id,
289
+ # :content,
290
+ # :created_at
291
+ Layout/ArgumentAlignment:
292
+ Enabled: true
293
+ EnforcedStyle: with_fixed_indentation
294
+
295
+ # In a regular method definition, no empty lines around the body.
296
+ Layout/EmptyLinesAroundMethodBody:
297
+ Enabled: true
298
+
299
+ # ====================================================================================================
300
+ # All Hash related rules
301
+ # ====================================================================================================
302
+ # EnforcedColonStyle: key
303
+ # # bad
304
+ # {
305
+ # foo: bar,
306
+ # ba: baz
307
+ # }
308
+ # {
309
+ # foo: bar,
310
+ # ba: baz
311
+ # }
312
+ # # good
313
+ # {
314
+ # foo: bar,
315
+ # ba: baz
316
+ # }
317
+ # EnforcedLastArgumentHashStyle: always_inspect
318
+ # # bad
319
+ # do_something({foo: 1,
320
+ # bar: 2})
321
+ # # good
322
+ # do_something(foo: 1,
323
+ # bar: 2)
324
+ Layout/HashAlignment:
325
+ Enabled: true
326
+ EnforcedColonStyle: key
327
+ EnforcedLastArgumentHashStyle: always_inspect
328
+
329
+ # This cop checks for a line break before the first element in a multi-line hash.
330
+ # # bad
331
+ # { a: 1,
332
+ # b: 2}
333
+ # # good
334
+ # {
335
+ # a: 1,
336
+ # b: 2 }
337
+ Layout/FirstHashElementLineBreak:
338
+ Enabled: true
339
+
340
+ # When using the `new_line` style:
341
+ # The closing brace of a multi-line hash literal must be on
342
+ # the line after the last element of the hash.
343
+ Layout/MultilineHashBraceLayout:
344
+ Enabled: true
345
+ EnforcedStyle: new_line
346
+
347
+ # # bad
348
+ # hash = {
349
+ # key: :value
350
+ # }
351
+ # but_in_a_method_call({
352
+ # its_like: :this
353
+ # })
354
+ # # good
355
+ # hash = {
356
+ # key: :value
357
+ # }
358
+ # and_in_a_method_call({
359
+ # no: :difference
360
+ # })
361
+ Layout/FirstHashElementIndentation:
362
+ Enabled: true
363
+ EnforcedStyle: consistent
364
+
365
+ # Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
366
+ Style/HashSyntax:
367
+ Enabled: true
368
+
369
+ # Use `{ a: 1 }` not `{a:1}`.
370
+ Layout/SpaceInsideHashLiteralBraces:
371
+ Enabled: true
372
+
373
+ # `no_comma`: Does not requires a comma after the last item in a hash
374
+ Style/TrailingCommaInHashLiteral:
375
+ Enabled: true
376
+
377
+ # ====================================================================================================
378
+ # All misc whitespace related rules
379
+ # ====================================================================================================
380
+ # bad
381
+ # def f(a:, b:2); {a:3}; end
382
+ # good
383
+ # def f(a:, b: 2); {a: 3}; end
384
+ Layout/SpaceAfterColon:
385
+ Enabled: true
386
+
387
+ # Ensures comma (,) is followed by some kind of space.
388
+ Layout/SpaceAfterComma:
389
+ Enabled: true
390
+
391
+ # Every ruby keyword should be surrounded by spaces
392
+ Layout/SpaceAroundKeyword:
393
+ Enabled: true
394
+
395
+ # Requires proper spacing around ruby operator symbols.
396
+ Layout/SpaceAroundOperators:
397
+ Enabled: true
398
+ ## Allows multiple spaces for keeping alignment
399
+ # {
400
+ # 1 => 2,
401
+ # 11 => 3
402
+ # }
403
+ AllowForAlignment: true
404
+
405
+ # Ensures comma symbol is not preceded by space
406
+ Layout/SpaceBeforeComma:
407
+ Enabled: true
408
+
409
+ # Use `foo {}` not `foo{}`.
410
+ Layout/SpaceBeforeBlockBraces:
411
+ Enabled: true
412
+
413
+ # Use `foo { bar }` not `foo {bar}`.
414
+ Layout/SpaceInsideBlockBraces:
415
+ Enabled: true
416
+
417
+ # enforces that parentheses do not have spaces
418
+ Layout/SpaceInsideParens:
419
+ Enabled: true
420
+
421
+ # No trailing whitespace.
422
+ Layout/TrailingWhitespace:
423
+ Enabled: true
424
+
425
+ # Require a space after comment
426
+ Layout/LeadingCommentSpace:
427
+ Enabled: true
428
+
429
+ # ====================================================================================================
430
+ # All empty lines related rules
431
+ # ====================================================================================================
432
+ # The `lf` style means that LF (Line Feed) is enforced on
433
+ # all platforms.
434
+ # # bad
435
+ # puts 'Hello' # Return character is CR+LF on all platfoms.
436
+ #
437
+ # # good
438
+ # puts 'Hello' # Return character is LF on all platfoms.
439
+ Layout/EndOfLine:
440
+ Enabled: true
441
+ EnforcedStyle: lf
442
+
443
+ # In a regular module definition, no empty lines around the body.
444
+ Layout/EmptyLinesAroundModuleBody:
445
+ Enabled: true
446
+
447
+ # # bad
448
+ # def foo
449
+ # return if need_return?
450
+ # bar
451
+ # end
452
+ #
453
+ # # good
454
+ # def foo
455
+ # return if need_return?
456
+ #
457
+ # bar
458
+ # end
459
+ Layout/EmptyLineAfterGuardClause:
460
+ Enabled: true
461
+
462
+ # Requires a single final blank line to the file.
463
+ # `final_blank_line` ensures a blank line before EOF.
464
+ # # bad
465
+ # class Foo; end # EOF
466
+ #
467
+ # # good
468
+ # class Foo; end
469
+ #
470
+ # # EOF
471
+ Layout/TrailingEmptyLines:
472
+ Enabled: true
473
+
474
+ # This cop checks for two or more consecutive blank lines.
475
+ # This rule is not same as TrailingEmptyLines, because:
476
+ # 1) It looks for empty lines throughout the file. Not just the end.
477
+ # # bad - It has two empty lines.
478
+ # some_method
479
+ # # one empty line
480
+ # # two empty lines
481
+ # some_method
482
+ #
483
+ # # good
484
+ # some_method
485
+ # # one empty line
486
+ # some_method
487
+ Layout/EmptyLines:
488
+ Enabled: true
489
+
490
+ # ====================================================================================================
491
+ # All naming convetion related rules for variables
492
+ # ====================================================================================================
493
+ # Refer: https://www.bigbinary.com/learn-rubyonrails-book/n+1-queries-and-memoization#bb-generated-p-id-44
494
+ # Sadly this cannot be auto-corrected.
495
+ Naming/MemoizedInstanceVariableName:
496
+ Enabled: true
497
+ EnforcedStyleForLeadingUnderscores: required
498
+
499
+ # ====================================================================================================
500
+ # All misc rules that don't fall into other categories
501
+ # ====================================================================================================
502
+ # Prefer &&/|| over and/or.
503
+ Style/AndOr:
504
+ Enabled: true
505
+
506
+ # Align `when` with `case`.
507
+ Layout/CaseIndentation:
508
+ Enabled: true
509
+
510
+ Layout/LineLength:
511
+ Enabled: true
512
+ Max: 120
513
+ AllowedPatterns: [
514
+ '^\s*#', # line that begins with comment
515
+ '^\s*"', # line that begins with double quote (long string literal)
516
+ '^\s*%{', # line that begins with percent literals (long string literal)
517
+ "^\\s*'", # line that begins with single quote (long string literal)
518
+ '"$', # line that ends with double quote (long string variable assignment)
519
+ "'$", # line that ends with single quote (long string variable assignment)
520
+ '}$', # line that ends with percent literals (long regex variable assignment)
521
+ '\/$', # line that ends with slash (long regex variable assignment)
522
+ ]
523
+
524
+ # Indent using two spaces
525
+ Layout/IndentationWidth:
526
+ Enabled: true
527
+ Width: 2
528
+
529
+ # Use spaces for indentation. Not tabs
530
+ Layout/IndentationStyle:
531
+ Enabled: true
532
+ EnforcedStyle: spaces
533
+
534
+ # Remove extra/unnecessary whitespace which's used for alignment.
535
+ # A developer shouldn't waste time indenting code with whitespaces.
536
+ Layout/ExtraSpacing:
537
+ Enabled: true
538
+ AllowForAlignment: false
539
+
540
+ # Helps in removing unwanted parentheses.
541
+ # # bad
542
+ # x += 1 while (x < 10)
543
+ # foo unless (bar || baz)
544
+ #
545
+ # if (x > 10)
546
+ # elsif (x < 3)
547
+ # end
548
+ #
549
+ # # good
550
+ # x += 1 while x < 10
551
+ # foo unless bar || baz
552
+ #
553
+ # if x > 10
554
+ # elsif x < 3
555
+ # end
556
+ Style/ParenthesesAroundCondition:
557
+ Enabled: true
558
+
559
+ # Enforce string literals to use double quotes everywhere
560
+ Style/StringLiterals:
561
+ Enabled: true
562
+ EnforcedStyle: double_quotes
563
+
564
+ # Use quotes for string literals when they are enough.
565
+ Style/RedundantPercentQ:
566
+ Enabled: true
567
+
568
+ # Align `end` with the matching keyword or starting expression except for
569
+ # assignments, where it should be aligned with the LHS.
570
+ Layout/EndAlignment:
571
+ Enabled: true
572
+ EnforcedStyleAlignWith: variable
573
+
574
+ # avoid lines terminated with a semicolon.
575
+ Style/Semicolon:
576
+ Enabled: true
577
+ # disallow multiple statements in a line
578
+ AllowAsExpressionSeparator: false
579
+
580
+ # Corrects usage of :true/:false to true/false
581
+ Lint/BooleanSymbol:
582
+ Enabled: true
583
+
584
+ # ====================================================================================================
585
+ # All flow(if/while/for/until) statements related
586
+ # ====================================================================================================
587
+ Lint/AssignmentInCondition:
588
+ Enabled: true
589
+ AllowSafeAssignment: true
590
+
591
+ # ====================================================================================================
592
+ # All Bundler cop rules
593
+ # ====================================================================================================
594
+ Bundler/OrderedGems:
595
+ Enabled: true
596
+ TreatCommentsAsGroupSeparators: true
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.2.2