chem_scanner 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +13 -0
  3. data/.rspec +3 -0
  4. data/.rubocop.yml +604 -0
  5. data/.ruby-gemset +1 -0
  6. data/.ruby-version +1 -0
  7. data/.travis.yml +5 -0
  8. data/CODE_OF_CONDUCT.md +74 -0
  9. data/Gemfile +20 -0
  10. data/LICENSE.txt +661 -0
  11. data/README.md +177 -0
  12. data/Rakefile +8 -0
  13. data/bin/console +14 -0
  14. data/bin/setup +8 -0
  15. data/chem_scanner.gemspec +43 -0
  16. data/lib/chem_scanner.rb +79 -0
  17. data/lib/chem_scanner/cdx.rb +67 -0
  18. data/lib/chem_scanner/cdxml.rb +72 -0
  19. data/lib/chem_scanner/chem_draw/cdx_reader.rb +101 -0
  20. data/lib/chem_scanner/chem_draw/node/base_node.rb +123 -0
  21. data/lib/chem_scanner/chem_draw/node/base_value.rb +257 -0
  22. data/lib/chem_scanner/chem_draw/node/bond.rb +100 -0
  23. data/lib/chem_scanner/chem_draw/node/bracket_attachment.rb +17 -0
  24. data/lib/chem_scanner/chem_draw/node/bracket_group.rb +32 -0
  25. data/lib/chem_scanner/chem_draw/node/chem_geometry.rb +58 -0
  26. data/lib/chem_scanner/chem_draw/node/color_table.rb +46 -0
  27. data/lib/chem_scanner/chem_draw/node/font_table.rb +54 -0
  28. data/lib/chem_scanner/chem_draw/node/fragment.rb +149 -0
  29. data/lib/chem_scanner/chem_draw/node/fragment_node.rb +145 -0
  30. data/lib/chem_scanner/chem_draw/node/graphic.rb +94 -0
  31. data/lib/chem_scanner/chem_draw/node/text.rb +242 -0
  32. data/lib/chem_scanner/chem_draw/parser.rb +214 -0
  33. data/lib/chem_scanner/chem_draw/yaml/cdx_objects.yaml +32 -0
  34. data/lib/chem_scanner/chem_draw/yaml/cdx_props.yaml +263 -0
  35. data/lib/chem_scanner/chem_draw/yaml/cdxml_objects.yaml +36 -0
  36. data/lib/chem_scanner/chem_draw/yaml/cdxml_props.yaml +263 -0
  37. data/lib/chem_scanner/chem_draw/yaml/props_data_type.yaml +263 -0
  38. data/lib/chem_scanner/configuration/abbreviation.rb +76 -0
  39. data/lib/chem_scanner/configuration/superatom.rb +76 -0
  40. data/lib/chem_scanner/configuration/superatom.txt +2874 -0
  41. data/lib/chem_scanner/configuration/util.rb +40 -0
  42. data/lib/chem_scanner/configuration/yaml/abbreviations.yaml +6399 -0
  43. data/lib/chem_scanner/configuration/yaml/elements.yaml +115 -0
  44. data/lib/chem_scanner/configuration/yaml/solvents.yaml +16 -0
  45. data/lib/chem_scanner/doc.rb +56 -0
  46. data/lib/chem_scanner/docx.rb +86 -0
  47. data/lib/chem_scanner/export/cml.rb +176 -0
  48. data/lib/chem_scanner/extension/element_map.rb +9 -0
  49. data/lib/chem_scanner/extension/geometry/bounding_box.rb +84 -0
  50. data/lib/chem_scanner/extension/geometry/line.rb +123 -0
  51. data/lib/chem_scanner/extension/geometry/point.rb +18 -0
  52. data/lib/chem_scanner/extension/geometry/polygon.rb +115 -0
  53. data/lib/chem_scanner/extension/geometry/segment.rb +196 -0
  54. data/lib/chem_scanner/extension/passthrough.rb +7 -0
  55. data/lib/chem_scanner/interpreter/element/arrow.rb +298 -0
  56. data/lib/chem_scanner/interpreter/element/atom.rb +134 -0
  57. data/lib/chem_scanner/interpreter/element/fragment.rb +59 -0
  58. data/lib/chem_scanner/interpreter/element/molecule.rb +473 -0
  59. data/lib/chem_scanner/interpreter/element/molecule_group.rb +34 -0
  60. data/lib/chem_scanner/interpreter/element/reaction.rb +186 -0
  61. data/lib/chem_scanner/interpreter/element/reaction_step.rb +39 -0
  62. data/lib/chem_scanner/interpreter/formula_to_mol.rb +75 -0
  63. data/lib/chem_scanner/interpreter/post_process/assemble.rb +38 -0
  64. data/lib/chem_scanner/interpreter/post_process/label_by_molecule.rb +37 -0
  65. data/lib/chem_scanner/interpreter/post_process/reaction_info.rb +225 -0
  66. data/lib/chem_scanner/interpreter/post_process/reaction_step.rb +95 -0
  67. data/lib/chem_scanner/interpreter/post_process/reagent_label.rb +46 -0
  68. data/lib/chem_scanner/interpreter/post_process/text_as_molecule.rb +52 -0
  69. data/lib/chem_scanner/interpreter/post_process/text_label.rb +40 -0
  70. data/lib/chem_scanner/interpreter/pre_process/arrow.rb +197 -0
  71. data/lib/chem_scanner/interpreter/pre_process/graphic.rb +41 -0
  72. data/lib/chem_scanner/interpreter/pre_process/molecule.rb +150 -0
  73. data/lib/chem_scanner/interpreter/reaction_detection/assign_to_reaction.rb +129 -0
  74. data/lib/chem_scanner/interpreter/reaction_detection/duplicate_reagents.rb +50 -0
  75. data/lib/chem_scanner/interpreter/reaction_detection/molecule_group.rb +55 -0
  76. data/lib/chem_scanner/interpreter/reaction_detection/multi_line_chain_reaction.rb +85 -0
  77. data/lib/chem_scanner/interpreter/reaction_detection/remove_separated_mol.rb +115 -0
  78. data/lib/chem_scanner/interpreter/reaction_detection/text_assignment.rb +166 -0
  79. data/lib/chem_scanner/interpreter/scheme.rb +173 -0
  80. data/lib/chem_scanner/interpreter/scheme_base.rb +64 -0
  81. data/lib/chem_scanner/interpreter/text_group/bold_groups.rb +183 -0
  82. data/lib/chem_scanner/interpreter/text_group/molecule_text_group.rb +138 -0
  83. data/lib/chem_scanner/interpreter/text_group/reaction_text_groups.rb +221 -0
  84. data/lib/chem_scanner/interpreter/text_group/retrieve_alias_info.rb +41 -0
  85. data/lib/chem_scanner/interpreter/text_group/retrieve_n_atoms.rb +106 -0
  86. data/lib/chem_scanner/interpreter/text_group/text_group_interpreter.rb +92 -0
  87. data/lib/chem_scanner/perkin_eln.rb +287 -0
  88. data/lib/chem_scanner/version.rb +5 -0
  89. data/lib/rubygems_plugin.rb +5 -0
  90. metadata +244 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: e0655cfdabb52bc65a8cd3e819727242ea0f05ae55640441c8cbfc96dbbdb975
4
+ data.tar.gz: 2e3ce3300dd62db9619ca1155b4a37bd87429edb8a2528414f6ac9634bd67bc9
5
+ SHA512:
6
+ metadata.gz: 274802c0556bfb0d637d10821ede6b7598b9d4ddfdf9d70f3c80f47ad4f79174ac04a12868fd212078b58cbbae84ea5dcb99bb63d97299fcc51a59c7fe4e1f0a
7
+ data.tar.gz: 7bc22fa4f27ba5e3136644fc1df89b78f624744b3411654358ee94c0eb8062912fd9f66f0d21963ef57555e0465772f2efd96b876086bc58f59b2c5af5568284
data/.gitignore ADDED
@@ -0,0 +1,13 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
12
+ .projectile
13
+ .byebug_history
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,604 @@
1
+ # Reference: thoughtbot/.rubocop.yml
2
+
3
+ require: rubocop-performance
4
+
5
+ AllCops:
6
+ DisplayCopNames: true
7
+ TargetRubyVersion: 2.3
8
+ Exclude:
9
+ - db/schema.rb
10
+
11
+ Naming/AccessorMethodName:
12
+ Description: Check the naming of accessor methods for get_/set_.
13
+ Enabled: false
14
+
15
+ Style/Alias:
16
+ Description: 'Use alias_method instead of alias.'
17
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method'
18
+ Enabled: false
19
+
20
+ Style/ArrayJoin:
21
+ Description: 'Use Array#join instead of Array#*.'
22
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#array-join'
23
+ Enabled: false
24
+
25
+ Style/AsciiComments:
26
+ Description: 'Use only ascii symbols in comments.'
27
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments'
28
+ Enabled: false
29
+
30
+ Naming/AsciiIdentifiers:
31
+ Description: 'Use only ascii symbols in identifiers.'
32
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
33
+ Enabled: false
34
+
35
+ Style/Attr:
36
+ Description: 'Checks for uses of Module#attr.'
37
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr'
38
+ Enabled: false
39
+
40
+ Metrics/BlockNesting:
41
+ Description: 'Avoid excessive block nesting'
42
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
43
+ Enabled: false
44
+
45
+ Style/CaseEquality:
46
+ Description: 'Avoid explicit use of the case equality operator(===).'
47
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality'
48
+ Enabled: false
49
+
50
+ Style/CharacterLiteral:
51
+ Description: 'Checks for uses of character literals.'
52
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals'
53
+ Enabled: false
54
+
55
+ Style/ClassAndModuleChildren:
56
+ Description: 'Checks style of children classes and modules.'
57
+ Enabled: true
58
+ EnforcedStyle: nested
59
+
60
+ Metrics/ClassLength:
61
+ Description: 'Avoid classes longer than 100 lines of code.'
62
+ Enabled: false
63
+
64
+ Metrics/ModuleLength:
65
+ Description: 'Avoid modules longer than 100 lines of code.'
66
+ Enabled: false
67
+
68
+ Style/ClassVars:
69
+ Description: 'Avoid the use of class variables.'
70
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars'
71
+ Enabled: false
72
+
73
+ Style/CollectionMethods:
74
+ Enabled: true
75
+ PreferredMethods:
76
+ find: detect
77
+ inject: reduce
78
+ collect: map
79
+ find_all: select
80
+
81
+ Style/ColonMethodCall:
82
+ Description: 'Do not use :: for method call.'
83
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons'
84
+ Enabled: false
85
+
86
+ Style/CommentAnnotation:
87
+ Description: >-
88
+ Checks formatting of special comments
89
+ (TODO, FIXME, OPTIMIZE, HACK, REVIEW).
90
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords'
91
+ Enabled: false
92
+
93
+ Style/Sample:
94
+ Description: >-
95
+ Use `sample` instead of `shuffle.first`,
96
+ `shuffle.last`, and `shuffle[Fixnum]`.
97
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
98
+ Enabled: false
99
+
100
+ Metrics/AbcSize:
101
+ Description: >-
102
+ A calculated magnitude based on number of assignments,
103
+ branches, and conditions.
104
+ Enabled: false
105
+
106
+ Metrics/BlockLength:
107
+ CountComments: true # count full line comments?
108
+ Max: 25
109
+ ExcludedMethods: []
110
+ Exclude:
111
+ - "spec/**/*"
112
+
113
+ Metrics/CyclomaticComplexity:
114
+ Description: >-
115
+ A complexity metric that is strongly correlated to the number
116
+ of test cases needed to validate a method.
117
+ Enabled: false
118
+
119
+ Style/PreferredHashMethods:
120
+ Description: 'Checks use of `has_key?` and `has_value?` Hash methods.'
121
+ StyleGuide: '#hash-key'
122
+ Enabled: false
123
+
124
+ Style/Documentation:
125
+ Description: 'Document classes and non-namespace modules.'
126
+ Enabled: false
127
+
128
+ Style/DoubleNegation:
129
+ Description: 'Checks for uses of double negation (!!).'
130
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-bang-bang'
131
+ Enabled: false
132
+
133
+ Style/EachWithObject:
134
+ Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
135
+ Enabled: false
136
+
137
+ Style/EmptyLiteral:
138
+ Description: 'Prefer literals to Array.new/Hash.new/String.new.'
139
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#literal-array-hash'
140
+ Enabled: false
141
+
142
+ # Checks whether the source file has a utf-8 encoding comment or not
143
+ # AutoCorrectEncodingComment must match the regex
144
+ # /#.*coding\s?[:=]\s?(?:UTF|utf)-8/
145
+ Style/Encoding:
146
+ Enabled: false
147
+
148
+ Style/EvenOdd:
149
+ Description: 'Favor the use of Fixnum#even? && Fixnum#odd?'
150
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
151
+ Enabled: false
152
+
153
+ Naming/FileName:
154
+ Description: 'Use snake_case for source file names.'
155
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
156
+ Enabled: false
157
+
158
+ Style/FrozenStringLiteralComment:
159
+ Description: >-
160
+ Add the frozen_string_literal comment to the top of files
161
+ to help transition from Ruby 2.3.0 to Ruby 3.0.
162
+ Enabled: false
163
+
164
+ Style/FormatString:
165
+ Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
166
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#sprintf'
167
+ Enabled: false
168
+
169
+ Style/GlobalVars:
170
+ Description: 'Do not introduce global variables.'
171
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars'
172
+ Reference: 'http://www.zenspider.com/Languages/Ruby/QuickRef.html'
173
+ Enabled: false
174
+
175
+ Style/GuardClause:
176
+ Description: 'Check for conditionals that can be replaced with guard clauses'
177
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
178
+ Enabled: false
179
+
180
+ Style/IfUnlessModifier:
181
+ Description: >-
182
+ Favor modifier if/unless usage when you have a
183
+ single-line body.
184
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
185
+ Enabled: false
186
+
187
+ Style/IfWithSemicolon:
188
+ Description: 'Do not use if x; .... Use the ternary operator instead.'
189
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs'
190
+ Enabled: false
191
+
192
+ Style/InlineComment:
193
+ Description: 'Avoid inline comments.'
194
+ Enabled: false
195
+
196
+ Style/Lambda:
197
+ Description: 'Use the new lambda literal syntax for single-line blocks.'
198
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#lambda-multi-line'
199
+ Enabled: false
200
+
201
+ Style/LambdaCall:
202
+ Description: 'Use lambda.call(...) instead of lambda.(...).'
203
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc-call'
204
+ Enabled: false
205
+
206
+ Style/LineEndConcatenation:
207
+ Description: >-
208
+ Use \ instead of + or << to concatenate two string literals at
209
+ line end.
210
+ Enabled: false
211
+
212
+ Metrics/LineLength:
213
+ Description: 'Limit lines to 80 characters.'
214
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
215
+ Max: 80
216
+
217
+ Metrics/MethodLength:
218
+ Description: 'Avoid methods longer than 10 lines of code.'
219
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
220
+ Enabled: false
221
+
222
+ Style/ModuleFunction:
223
+ Description: 'Checks for usage of `extend self` in modules.'
224
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#module-function'
225
+ Enabled: false
226
+
227
+ Style/MultilineBlockChain:
228
+ Description: 'Avoid multi-line chains of blocks.'
229
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
230
+ Enabled: false
231
+
232
+ Style/NegatedIf:
233
+ Description: >-
234
+ Favor unless over if for negative conditions
235
+ (or control flow or).
236
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
237
+ Enabled: false
238
+
239
+ Style/NegatedWhile:
240
+ Description: 'Favor until over while for negative conditions.'
241
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#until-for-negatives'
242
+ Enabled: false
243
+
244
+ Style/Next:
245
+ Description: 'Use `next` to skip iteration instead of a condition at the end.'
246
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
247
+ Enabled: false
248
+
249
+ Style/NilComparison:
250
+ Description: 'Prefer x.nil? to x == nil.'
251
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
252
+ Enabled: false
253
+
254
+ Style/Not:
255
+ Description: 'Use ! instead of not.'
256
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not'
257
+ Enabled: false
258
+
259
+ Style/NumericLiterals:
260
+ Description: >-
261
+ Add underscores to large numeric literals to improve their
262
+ readability.
263
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
264
+ Enabled: false
265
+
266
+ Style/OneLineConditional:
267
+ Description: >-
268
+ Favor the ternary operator(?:) over
269
+ if/then/else/end constructs.
270
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator'
271
+ Enabled: false
272
+
273
+ Naming/BinaryOperatorParameterName:
274
+ Description: 'When defining binary operators, name the argument other.'
275
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
276
+ Enabled: false
277
+
278
+ Metrics/ParameterLists:
279
+ Description: 'Avoid parameter lists longer than three or four parameters.'
280
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
281
+ Enabled: false
282
+
283
+ Style/PercentLiteralDelimiters:
284
+ Description: 'Use `%`-literal delimiters consistently'
285
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces'
286
+ Enabled: false
287
+
288
+ Style/PerlBackrefs:
289
+ Description: 'Avoid Perl-style regex back references.'
290
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
291
+ Enabled: false
292
+
293
+ Naming/PredicateName:
294
+ Description: 'Check the names of predicate methods.'
295
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
296
+ NamePrefixBlacklist:
297
+ - is_
298
+ Exclude:
299
+ - spec/**/*
300
+
301
+ Style/Proc:
302
+ Description: 'Use proc instead of Proc.new.'
303
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc'
304
+ Enabled: false
305
+
306
+ Style/RaiseArgs:
307
+ Description: 'Checks the arguments passed to raise/fail.'
308
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#exception-class-messages'
309
+ Enabled: false
310
+
311
+ Style/RegexpLiteral:
312
+ Description: 'Use / or %r around regular expressions.'
313
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r'
314
+ Enabled: false
315
+
316
+ Style/SelfAssignment:
317
+ Description: >-
318
+ Checks for places where self-assignment shorthand should have
319
+ been used.
320
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment'
321
+ Enabled: false
322
+
323
+ Style/SingleLineBlockParams:
324
+ Description: 'Enforces the names of some block params.'
325
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#reduce-blocks'
326
+ Enabled: false
327
+
328
+ Style/SingleLineMethods:
329
+ Description: 'Avoid single-line methods.'
330
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods'
331
+ Enabled: false
332
+
333
+ Style/SignalException:
334
+ Description: 'Checks for proper usage of fail and raise.'
335
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#fail-method'
336
+ Enabled: false
337
+
338
+ Style/SpecialGlobalVars:
339
+ Description: 'Avoid Perl-style global variables.'
340
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms'
341
+ Enabled: false
342
+
343
+ Style/StringLiterals:
344
+ Description: 'Checks if uses of quotes match the configured preference.'
345
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals'
346
+ EnforcedStyle: double_quotes
347
+ Enabled: true
348
+
349
+ Style/TrailingCommaInArguments:
350
+ Description: 'Checks for trailing comma in argument lists.'
351
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
352
+ EnforcedStyleForMultiline: comma
353
+ SupportedStylesForMultiline:
354
+ - comma
355
+ - consistent_comma
356
+ - no_comma
357
+ Enabled: true
358
+
359
+ Style/TrailingCommaInArrayLiteral:
360
+ Description: 'Checks for trailing comma in array literals.'
361
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
362
+ EnforcedStyleForMultiline: comma
363
+ SupportedStylesForMultiline:
364
+ - comma
365
+ - consistent_comma
366
+ - no_comma
367
+ Enabled: true
368
+
369
+ Style/TrailingCommaInHashLiteral:
370
+ Description: 'Checks for trailing comma in hash literals.'
371
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
372
+ EnforcedStyleForMultiline: comma
373
+ SupportedStylesForMultiline:
374
+ - comma
375
+ - consistent_comma
376
+ - no_comma
377
+ Enabled: true
378
+
379
+ Style/TrivialAccessors:
380
+ Description: 'Prefer attr_* methods to trivial readers/writers.'
381
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family'
382
+ Enabled: false
383
+
384
+ Style/VariableInterpolation:
385
+ Description: >-
386
+ Don't interpolate global, instance and class variables
387
+ directly in strings.
388
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate'
389
+ Enabled: false
390
+
391
+ Style/WhenThen:
392
+ Description: 'Use when x then ... for one-line cases.'
393
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#one-line-cases'
394
+ Enabled: false
395
+
396
+ Style/WhileUntilModifier:
397
+ Description: >-
398
+ Favor modifier while/until usage when you have a
399
+ single-line body.
400
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier'
401
+ Enabled: false
402
+
403
+ Style/WordArray:
404
+ Description: 'Use %w or %W for arrays of words.'
405
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
406
+ Enabled: false
407
+
408
+ # Layout
409
+
410
+ Layout/AlignParameters:
411
+ Description: 'Here we check if the parameters on a multi-line method call or definition are aligned.'
412
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent'
413
+ Enabled: false
414
+
415
+ Layout/ConditionPosition:
416
+ Description: >-
417
+ Checks for condition placed in a confusing position relative to
418
+ the keyword.
419
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
420
+ Enabled: false
421
+
422
+ Layout/DotPosition:
423
+ Description: 'Checks the position of the dot in multi-line method calls.'
424
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
425
+ EnforcedStyle: trailing
426
+
427
+ Layout/ExtraSpacing:
428
+ Description: 'Do not use unnecessary spacing.'
429
+ Enabled: true
430
+
431
+ Layout/MultilineOperationIndentation:
432
+ Description: >-
433
+ Checks indentation of binary operations that span more than
434
+ one line.
435
+ Enabled: true
436
+ EnforcedStyle: indented
437
+
438
+ Layout/MultilineMethodCallIndentation:
439
+ Description: >-
440
+ Checks indentation of method calls with the dot operator
441
+ that span more than one line.
442
+ Enabled: true
443
+ EnforcedStyle: indented
444
+
445
+ Layout/InitialIndentation:
446
+ Description: >-
447
+ Checks the indentation of the first non-blank non-comment line in a file.
448
+ Enabled: false
449
+
450
+ # Lint
451
+
452
+ Lint/AmbiguousOperator:
453
+ Description: >-
454
+ Checks for ambiguous operators in the first argument of a
455
+ method invocation without parentheses.
456
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-as-args'
457
+ Enabled: false
458
+
459
+ Lint/AmbiguousRegexpLiteral:
460
+ Description: >-
461
+ Checks for ambiguous regexp literals in the first argument of
462
+ a method invocation without parenthesis.
463
+ Enabled: false
464
+
465
+ Lint/AssignmentInCondition:
466
+ Description: "Don't use assignment in conditions."
467
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition'
468
+ Enabled: false
469
+
470
+ Lint/CircularArgumentReference:
471
+ Description: "Don't refer to the keyword argument in the default value."
472
+ Enabled: false
473
+
474
+ Lint/DeprecatedClassMethods:
475
+ Description: 'Check for deprecated class method calls.'
476
+ Enabled: false
477
+
478
+ Lint/DuplicatedKey:
479
+ Description: 'Check for duplicate keys in hash literals.'
480
+ Enabled: false
481
+
482
+ Lint/EachWithObjectArgument:
483
+ Description: 'Check for immutable argument given to each_with_object.'
484
+ Enabled: false
485
+
486
+ Lint/ElseLayout:
487
+ Description: 'Check for odd code arrangement in an else block.'
488
+ Enabled: false
489
+
490
+ Lint/FlipFlop:
491
+ Description: 'Checks for flip flops'
492
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops'
493
+ Enabled: false
494
+
495
+ Lint/FormatParameterMismatch:
496
+ Description: 'The number of parameters to format/sprint must match the fields.'
497
+ Enabled: false
498
+
499
+ Lint/HandleExceptions:
500
+ Description: "Don't suppress exception."
501
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
502
+ Enabled: false
503
+
504
+ Lint/LiteralAsCondition:
505
+ Description: 'Checks of literals used in conditions.'
506
+ Enabled: false
507
+
508
+ Lint/LiteralInInterpolation:
509
+ Description: 'Checks for literals used in interpolation.'
510
+ Enabled: false
511
+
512
+ Lint/Loop:
513
+ Description: >-
514
+ Use Kernel#loop with break rather than begin/end/until or
515
+ begin/end/while for post-loop tests.
516
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break'
517
+ Enabled: false
518
+
519
+ Lint/NestedMethodDefinition:
520
+ Description: 'Do not use nested method definitions.'
521
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-methods'
522
+ Enabled: false
523
+
524
+ Lint/NonLocalExitFromIterator:
525
+ Description: 'Do not use return in iterator to cause non-local exit.'
526
+ Enabled: false
527
+
528
+ Lint/ParenthesesAsGroupedExpression:
529
+ Description: >-
530
+ Checks for method calls with a space before the opening
531
+ parenthesis.
532
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
533
+ Enabled: false
534
+
535
+ Lint/RequireParentheses:
536
+ Description: >-
537
+ Use parentheses in the method call to avoid confusion
538
+ about precedence.
539
+ Enabled: false
540
+
541
+ Lint/UnderscorePrefixedVariableName:
542
+ Description: 'Do not use prefix `_` for a variable that is used.'
543
+ Enabled: false
544
+
545
+ Lint/UnneededCopDisableDirective:
546
+ Description: >-
547
+ Checks for rubocop:disable comments that can be removed.
548
+ Note: this cop is not disabled when disabling all cops.
549
+ It must be explicitly disabled.
550
+ Enabled: false
551
+
552
+ Lint/Void:
553
+ Description: 'Possible use of operator/literal/variable in void context.'
554
+ Enabled: false
555
+
556
+ # Performance
557
+
558
+ Performance/CaseWhenSplat:
559
+ Description: >-
560
+ Place `when` conditions that use splat at the end
561
+ of the list of `when` branches.
562
+ Enabled: false
563
+
564
+ Performance/Count:
565
+ Description: >-
566
+ Use `count` instead of `select...size`, `reject...size`,
567
+ `select...count`, `reject...count`, `select...length`,
568
+ and `reject...length`.
569
+ Enabled: false
570
+
571
+ Performance/Detect:
572
+ Description: >-
573
+ Use `detect` instead of `select.first`, `find_all.first`,
574
+ `select.last`, and `find_all.last`.
575
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code'
576
+ Enabled: false
577
+
578
+ Performance/FlatMap:
579
+ Description: >-
580
+ Use `Enumerable#flat_map`
581
+ instead of `Enumerable#map...Array#flatten(1)`
582
+ or `Enumberable#collect..Array#flatten(1)`
583
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code'
584
+ Enabled: false
585
+
586
+ Performance/ReverseEach:
587
+ Description: 'Use `reverse_each` instead of `reverse.each`.'
588
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code'
589
+ Enabled: false
590
+
591
+ Performance/Size:
592
+ Description: >-
593
+ Use `size` instead of `count` for counting
594
+ the number of elements in `Array` and `Hash`.
595
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code'
596
+ Enabled: false
597
+
598
+ Performance/StringReplacement:
599
+ Description: >-
600
+ Use `tr` instead of `gsub` when you are replacing the same
601
+ number of characters. Use `delete` instead of `gsub` when
602
+ you are deleting characters.
603
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code'
604
+ Enabled: false