unibuf 0.1.0 → 0.1.2

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.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop_todo.yml +178 -330
  3. data/CODE_OF_CONDUCT.md +132 -0
  4. data/README.adoc +443 -254
  5. data/docs/CAPNPROTO.adoc +436 -0
  6. data/docs/FLATBUFFERS.adoc +430 -0
  7. data/docs/PROTOBUF.adoc +515 -0
  8. data/docs/TXTPROTO.adoc +369 -0
  9. data/lib/unibuf/commands/convert.rb +60 -2
  10. data/lib/unibuf/commands/schema.rb +68 -11
  11. data/lib/unibuf/errors.rb +23 -26
  12. data/lib/unibuf/models/capnproto/enum_definition.rb +72 -0
  13. data/lib/unibuf/models/capnproto/field_definition.rb +81 -0
  14. data/lib/unibuf/models/capnproto/interface_definition.rb +70 -0
  15. data/lib/unibuf/models/capnproto/method_definition.rb +81 -0
  16. data/lib/unibuf/models/capnproto/schema.rb +84 -0
  17. data/lib/unibuf/models/capnproto/struct_definition.rb +96 -0
  18. data/lib/unibuf/models/capnproto/union_definition.rb +62 -0
  19. data/lib/unibuf/models/flatbuffers/enum_definition.rb +69 -0
  20. data/lib/unibuf/models/flatbuffers/field_definition.rb +88 -0
  21. data/lib/unibuf/models/flatbuffers/schema.rb +102 -0
  22. data/lib/unibuf/models/flatbuffers/struct_definition.rb +70 -0
  23. data/lib/unibuf/models/flatbuffers/table_definition.rb +73 -0
  24. data/lib/unibuf/models/flatbuffers/union_definition.rb +60 -0
  25. data/lib/unibuf/models/message.rb +10 -0
  26. data/lib/unibuf/models/values/scalar_value.rb +2 -2
  27. data/lib/unibuf/parsers/binary/wire_format_parser.rb +199 -19
  28. data/lib/unibuf/parsers/capnproto/binary_parser.rb +267 -0
  29. data/lib/unibuf/parsers/capnproto/grammar.rb +272 -0
  30. data/lib/unibuf/parsers/capnproto/list_reader.rb +208 -0
  31. data/lib/unibuf/parsers/capnproto/pointer_decoder.rb +163 -0
  32. data/lib/unibuf/parsers/capnproto/processor.rb +348 -0
  33. data/lib/unibuf/parsers/capnproto/segment_reader.rb +131 -0
  34. data/lib/unibuf/parsers/capnproto/struct_reader.rb +199 -0
  35. data/lib/unibuf/parsers/flatbuffers/binary_parser.rb +325 -0
  36. data/lib/unibuf/parsers/flatbuffers/grammar.rb +235 -0
  37. data/lib/unibuf/parsers/flatbuffers/processor.rb +299 -0
  38. data/lib/unibuf/parsers/textproto/grammar.rb +1 -1
  39. data/lib/unibuf/parsers/textproto/processor.rb +10 -0
  40. data/lib/unibuf/serializers/binary_serializer.rb +218 -0
  41. data/lib/unibuf/serializers/capnproto/binary_serializer.rb +402 -0
  42. data/lib/unibuf/serializers/capnproto/list_writer.rb +199 -0
  43. data/lib/unibuf/serializers/capnproto/pointer_encoder.rb +118 -0
  44. data/lib/unibuf/serializers/capnproto/segment_builder.rb +124 -0
  45. data/lib/unibuf/serializers/capnproto/struct_writer.rb +139 -0
  46. data/lib/unibuf/serializers/flatbuffers/binary_serializer.rb +167 -0
  47. data/lib/unibuf/validators/type_validator.rb +1 -1
  48. data/lib/unibuf/version.rb +1 -1
  49. data/lib/unibuf.rb +27 -0
  50. metadata +36 -1
data/.rubocop_todo.yml CHANGED
@@ -1,96 +1,74 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2025-11-19 06:24:19 UTC using RuboCop version 1.81.7.
3
+ # on 2025-11-19 16:03:19 UTC using RuboCop version 1.81.7.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 2
10
- # This cop supports safe autocorrection (--autocorrect).
11
- # Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation.
12
- Bundler/OrderedGems:
13
- Exclude:
14
- - 'Gemfile'
15
-
16
- # Offense count: 3
17
- # This cop supports safe autocorrection (--autocorrect).
18
- # Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation.
19
- Gemspec/OrderedDependencies:
20
- Exclude:
21
- - 'unibuf.gemspec'
22
-
23
- # Offense count: 1
24
- # This cop supports safe autocorrection (--autocorrect).
25
- # Configuration parameters: Severity.
26
- Gemspec/RequireMFA:
27
- Exclude:
28
- - 'unibuf.gemspec'
29
-
30
- # Offense count: 32
9
+ # Offense count: 110
31
10
  # This cop supports safe autocorrection (--autocorrect).
32
11
  # Configuration parameters: EnforcedStyle, IndentationWidth.
33
12
  # SupportedStyles: with_first_argument, with_fixed_indentation
34
13
  Layout/ArgumentAlignment:
35
- Enabled: false
14
+ Exclude:
15
+ - 'spec/unibuf/models/capnproto/field_definition_spec.rb'
16
+ - 'spec/unibuf/models/capnproto/interface_definition_spec.rb'
17
+ - 'spec/unibuf/models/capnproto/struct_definition_spec.rb'
18
+ - 'spec/unibuf/parsers/capnproto/additional_coverage_spec.rb'
19
+ - 'spec/unibuf/parsers/capnproto/comprehensive_spec.rb'
20
+ - 'spec/unibuf/parsers/capnproto/error_handling_spec.rb'
36
21
 
37
- # Offense count: 4
22
+ # Offense count: 5
38
23
  # This cop supports safe autocorrection (--autocorrect).
39
24
  # Configuration parameters: EnforcedStyle, IndentationWidth.
40
25
  # SupportedStyles: with_first_element, with_fixed_indentation
41
26
  Layout/ArrayAlignment:
42
27
  Exclude:
43
- - 'lib/unibuf/models/values/scalar_value.rb'
44
- - 'lib/unibuf/validators/type_validator.rb'
45
- - 'unibuf.gemspec'
28
+ - 'spec/unibuf/models/capnproto/field_definition_spec.rb'
29
+ - 'spec/unibuf/parsers/capnproto/comprehensive_spec.rb'
30
+ - 'spec/unibuf/parsers/capnproto/error_handling_spec.rb'
46
31
 
47
- # Offense count: 17
32
+ # Offense count: 33
48
33
  # This cop supports safe autocorrection (--autocorrect).
49
34
  # Configuration parameters: EnforcedStyleAlignWith.
50
35
  # SupportedStylesAlignWith: either, start_of_block, start_of_line
51
36
  Layout/BlockAlignment:
52
37
  Exclude:
53
- - 'lib/unibuf/models/values/list_value.rb'
54
38
  - 'lib/unibuf/models/values/scalar_value.rb'
55
- - 'lib/unibuf/parsers/proto3/grammar.rb'
56
- - 'lib/unibuf/parsers/proto3/processor.rb'
57
- - 'lib/unibuf/parsers/textproto/grammar.rb'
58
- - 'lib/unibuf/parsers/textproto/processor.rb'
59
- - 'spec/unibuf/models/message_definition_spec.rb'
60
- - 'spec/unibuf/parsers/textproto/integration_spec.rb'
39
+ - 'spec/unibuf/models/capnproto/enum_definition_spec.rb'
40
+ - 'spec/unibuf/models/capnproto/field_definition_spec.rb'
41
+ - 'spec/unibuf/models/capnproto/interface_definition_spec.rb'
42
+ - 'spec/unibuf/models/capnproto/schema_spec.rb'
43
+ - 'spec/unibuf/models/capnproto/struct_definition_spec.rb'
44
+ - 'spec/unibuf/parsers/capnproto/additional_coverage_spec.rb'
45
+ - 'spec/unibuf/parsers/capnproto/comprehensive_spec.rb'
46
+ - 'spec/unibuf/parsers/capnproto/error_handling_spec.rb'
61
47
 
62
- # Offense count: 16
48
+ # Offense count: 32
63
49
  # This cop supports safe autocorrection (--autocorrect).
64
50
  Layout/BlockEndNewline:
65
51
  Exclude:
66
- - 'lib/unibuf/models/values/list_value.rb'
67
- - 'lib/unibuf/models/values/scalar_value.rb'
68
- - 'lib/unibuf/parsers/proto3/grammar.rb'
69
- - 'lib/unibuf/parsers/proto3/processor.rb'
70
- - 'lib/unibuf/parsers/textproto/grammar.rb'
71
- - 'lib/unibuf/parsers/textproto/processor.rb'
72
- - 'spec/unibuf/models/message_definition_spec.rb'
73
- - 'spec/unibuf/parsers/textproto/integration_spec.rb'
74
-
75
- # Offense count: 5
76
- # This cop supports safe autocorrection (--autocorrect).
77
- Layout/EmptyLineAfterGuardClause:
78
- Exclude:
79
- - 'lib/unibuf/commands/convert.rb'
80
- - 'lib/unibuf/models/enum_definition.rb'
81
- - 'lib/unibuf/models/field_definition.rb'
82
- - 'lib/unibuf/models/values/list_value.rb'
83
- - 'lib/unibuf/models/values/map_value.rb'
52
+ - 'spec/unibuf/models/capnproto/enum_definition_spec.rb'
53
+ - 'spec/unibuf/models/capnproto/field_definition_spec.rb'
54
+ - 'spec/unibuf/models/capnproto/interface_definition_spec.rb'
55
+ - 'spec/unibuf/models/capnproto/schema_spec.rb'
56
+ - 'spec/unibuf/models/capnproto/struct_definition_spec.rb'
57
+ - 'spec/unibuf/parsers/capnproto/additional_coverage_spec.rb'
58
+ - 'spec/unibuf/parsers/capnproto/comprehensive_spec.rb'
59
+ - 'spec/unibuf/parsers/capnproto/error_handling_spec.rb'
84
60
 
85
- # Offense count: 2
61
+ # Offense count: 6
86
62
  # This cop supports safe autocorrection (--autocorrect).
87
63
  # Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
88
64
  Layout/ExtraSpacing:
89
65
  Exclude:
90
- - 'lib/unibuf/cli.rb'
91
- - 'lib/unibuf/parsers/textproto/processor.rb'
66
+ - 'spec/spec_helper.rb'
67
+ - 'spec/unibuf/models/capnproto/interface_definition_spec.rb'
68
+ - 'spec/unibuf/parsers/capnproto/comprehensive_spec.rb'
69
+ - 'spec/unibuf/parsers/capnproto/error_handling_spec.rb'
92
70
 
93
- # Offense count: 9
71
+ # Offense count: 90
94
72
  # This cop supports safe autocorrection (--autocorrect).
95
73
  # Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
96
74
  # SupportedHashRocketStyles: key, separator, table
@@ -98,70 +76,77 @@ Layout/ExtraSpacing:
98
76
  # SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
99
77
  Layout/HashAlignment:
100
78
  Exclude:
101
- - 'spec/unibuf/models/field_spec.rb'
102
- - 'spec/unibuf/models/message_definition_spec.rb'
103
- - 'unibuf.gemspec'
79
+ - 'spec/unibuf/models/capnproto/interface_definition_spec.rb'
80
+ - 'spec/unibuf/parsers/capnproto/additional_coverage_spec.rb'
81
+ - 'spec/unibuf/parsers/capnproto/comprehensive_spec.rb'
82
+ - 'spec/unibuf/parsers/capnproto/error_handling_spec.rb'
83
+ - 'spec/unibuf/parsers/capnproto/processor_spec.rb'
104
84
 
105
- # Offense count: 1
106
- # This cop supports safe autocorrection (--autocorrect).
107
- # Configuration parameters: EnforcedStyle.
108
- # SupportedStyles: normal, indented_internal_methods
109
- Layout/IndentationConsistency:
110
- Exclude:
111
- - 'unibuf.gemspec'
112
-
113
- # Offense count: 32
85
+ # Offense count: 64
114
86
  # This cop supports safe autocorrection (--autocorrect).
115
87
  # Configuration parameters: Width, AllowedPatterns.
116
88
  Layout/IndentationWidth:
117
89
  Exclude:
118
- - 'lib/unibuf/models/values/list_value.rb'
119
- - 'lib/unibuf/models/values/scalar_value.rb'
120
- - 'lib/unibuf/parsers/proto3/grammar.rb'
121
- - 'lib/unibuf/parsers/proto3/processor.rb'
122
- - 'lib/unibuf/parsers/textproto/grammar.rb'
123
- - 'lib/unibuf/parsers/textproto/processor.rb'
124
- - 'spec/unibuf/models/message_definition_spec.rb'
125
- - 'spec/unibuf/parsers/textproto/integration_spec.rb'
90
+ - 'spec/unibuf/models/capnproto/enum_definition_spec.rb'
91
+ - 'spec/unibuf/models/capnproto/field_definition_spec.rb'
92
+ - 'spec/unibuf/models/capnproto/interface_definition_spec.rb'
93
+ - 'spec/unibuf/models/capnproto/schema_spec.rb'
94
+ - 'spec/unibuf/models/capnproto/struct_definition_spec.rb'
95
+ - 'spec/unibuf/parsers/capnproto/additional_coverage_spec.rb'
96
+ - 'spec/unibuf/parsers/capnproto/comprehensive_spec.rb'
97
+ - 'spec/unibuf/parsers/capnproto/error_handling_spec.rb'
126
98
 
127
- # Offense count: 77
99
+ # Offense count: 229
128
100
  # This cop supports safe autocorrection (--autocorrect).
129
101
  # Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
130
102
  # URISchemes: http, https
131
103
  Layout/LineLength:
132
104
  Enabled: false
133
105
 
134
- # Offense count: 13
106
+ # Offense count: 3
135
107
  # This cop supports safe autocorrection (--autocorrect).
136
108
  # Configuration parameters: EnforcedStyle, IndentationWidth.
137
- # SupportedStyles: aligned, indented, indented_relative_to_receiver
138
- Layout/MultilineMethodCallIndentation:
109
+ # SupportedStyles: aligned, indented
110
+ Layout/MultilineOperationIndentation:
139
111
  Exclude:
140
- - 'lib/unibuf/models/field.rb'
141
- - 'lib/unibuf/models/values/scalar_value.rb'
142
- - 'lib/unibuf/parsers/textproto/processor.rb'
112
+ - 'spec/unibuf/parsers/capnproto/error_handling_spec.rb'
143
113
 
144
- # Offense count: 19
114
+ # Offense count: 9
145
115
  # This cop supports safe autocorrection (--autocorrect).
146
116
  # Configuration parameters: EnforcedStyle.
147
117
  # SupportedStyles: final_newline, final_blank_line
148
118
  Layout/TrailingEmptyLines:
149
- Enabled: false
119
+ Exclude:
120
+ - 'spec/unibuf/models/capnproto/enum_definition_spec.rb'
121
+ - 'spec/unibuf/models/capnproto/field_definition_spec.rb'
122
+ - 'spec/unibuf/models/capnproto/interface_definition_spec.rb'
123
+ - 'spec/unibuf/models/capnproto/schema_spec.rb'
124
+ - 'spec/unibuf/models/capnproto/struct_definition_spec.rb'
125
+ - 'spec/unibuf/parsers/capnproto/additional_coverage_spec.rb'
126
+ - 'spec/unibuf/parsers/capnproto/comprehensive_spec.rb'
127
+ - 'spec/unibuf/parsers/capnproto/error_handling_spec.rb'
128
+ - 'spec/unibuf/parsers/capnproto/processor_spec.rb'
150
129
 
151
- # Offense count: 32
130
+ # Offense count: 65
152
131
  # This cop supports safe autocorrection (--autocorrect).
153
132
  # Configuration parameters: AllowInHeredoc.
154
133
  Layout/TrailingWhitespace:
155
- Enabled: false
134
+ Exclude:
135
+ - 'spec/unibuf/models/capnproto/field_definition_spec.rb'
136
+ - 'spec/unibuf/models/capnproto/interface_definition_spec.rb'
137
+ - 'spec/unibuf/models/capnproto/struct_definition_spec.rb'
138
+ - 'spec/unibuf/parsers/capnproto/additional_coverage_spec.rb'
139
+ - 'spec/unibuf/parsers/capnproto/comprehensive_spec.rb'
140
+ - 'spec/unibuf/parsers/capnproto/error_handling_spec.rb'
141
+ - 'spec/unibuf/parsers/capnproto/processor_spec.rb'
156
142
 
157
- # Offense count: 8
143
+ # Offense count: 6
158
144
  # This cop supports safe autocorrection (--autocorrect).
159
145
  Lint/AmbiguousOperatorPrecedence:
160
146
  Exclude:
161
- - 'lib/unibuf/parsers/textproto/grammar.rb'
162
- - 'lib/unibuf/validators/type_validator.rb'
147
+ - 'spec/unibuf/parsers/capnproto/error_handling_spec.rb'
163
148
 
164
- # Offense count: 8
149
+ # Offense count: 21
165
150
  # Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches, IgnoreDuplicateElseBranch.
166
151
  Lint/DuplicateBranch:
167
152
  Exclude:
@@ -171,21 +156,17 @@ Lint/DuplicateBranch:
171
156
  - 'lib/unibuf/models/values/list_value.rb'
172
157
  - 'lib/unibuf/models/values/map_value.rb'
173
158
  - 'lib/unibuf/models/values/scalar_value.rb'
174
-
175
- # Offense count: 2
176
- # This cop supports unsafe autocorrection (--autocorrect-all).
177
- Lint/RedundantDirGlobSort:
178
- Exclude:
179
- - 'spec/unibuf/parsers/textproto/integration_spec.rb'
159
+ - 'lib/unibuf/parsers/binary/wire_format_parser.rb'
160
+ - 'lib/unibuf/parsers/capnproto/binary_parser.rb'
161
+ - 'lib/unibuf/parsers/flatbuffers/binary_parser.rb'
162
+ - 'lib/unibuf/serializers/binary_serializer.rb'
163
+ - 'lib/unibuf/serializers/capnproto/binary_serializer.rb'
164
+ - 'lib/unibuf/serializers/flatbuffers/binary_serializer.rb'
180
165
 
181
166
  # Offense count: 1
182
- # This cop supports unsafe autocorrection (--autocorrect-all).
183
- # Configuration parameters: AllowedMethods, InferNonNilReceiver, AdditionalNilMethods.
184
- # AllowedMethods: instance_of?, kind_of?, is_a?, eql?, respond_to?, equal?
185
- # AdditionalNilMethods: present?, blank?, try, try!
186
- Lint/RedundantSafeNavigation:
167
+ Lint/DuplicateMethods:
187
168
  Exclude:
188
- - 'lib/unibuf/parsers/textproto/processor.rb'
169
+ - 'lib/unibuf/serializers/capnproto/segment_builder.rb'
189
170
 
190
171
  # Offense count: 1
191
172
  # Configuration parameters: AllowedPatterns.
@@ -194,132 +175,72 @@ Lint/UnreachableLoop:
194
175
  Exclude:
195
176
  - 'lib/unibuf/models/message.rb'
196
177
 
197
- # Offense count: 3
178
+ # Offense count: 1
198
179
  # This cop supports safe autocorrection (--autocorrect).
199
180
  # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods, NotImplementedExceptions.
200
181
  # NotImplementedExceptions: NotImplementedError
201
182
  Lint/UnusedMethodArgument:
202
183
  Exclude:
203
- - 'lib/unibuf/commands/validate.rb'
204
- - 'lib/unibuf/models/message.rb'
205
184
  - 'lib/unibuf/models/values/scalar_value.rb'
206
185
 
207
- # Offense count: 19
186
+ # Offense count: 62
208
187
  # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
209
188
  Metrics/AbcSize:
210
- Exclude:
211
- - 'lib/unibuf/commands/convert.rb'
212
- - 'lib/unibuf/commands/parse.rb'
213
- - 'lib/unibuf/commands/schema.rb'
214
- - 'lib/unibuf/commands/validate.rb'
215
- - 'lib/unibuf/models/field.rb'
216
- - 'lib/unibuf/models/field_definition.rb'
217
- - 'lib/unibuf/models/message_definition.rb'
218
- - 'lib/unibuf/models/schema.rb'
219
- - 'lib/unibuf/models/values/scalar_value.rb'
220
- - 'lib/unibuf/parsers/proto3/processor.rb'
221
- - 'lib/unibuf/parsers/textproto/parser.rb'
222
- - 'lib/unibuf/parsers/textproto/processor.rb'
223
- - 'lib/unibuf/validators/schema_validator.rb'
224
- - 'lib/unibuf/validators/type_validator.rb'
189
+ Enabled: false
190
+
191
+ # Offense count: 1
192
+ # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
193
+ # AllowedMethods: refine
194
+ Metrics/BlockLength:
195
+ Max: 58
225
196
 
226
- # Offense count: 13
197
+ # Offense count: 1
198
+ # Configuration parameters: CountBlocks, CountModifierForms.
199
+ Metrics/BlockNesting:
200
+ Max: 4
201
+
202
+ # Offense count: 38
227
203
  # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
228
204
  Metrics/CyclomaticComplexity:
229
- Exclude:
230
- - 'lib/unibuf.rb'
231
- - 'lib/unibuf/commands/validate.rb'
232
- - 'lib/unibuf/models/field_definition.rb'
233
- - 'lib/unibuf/models/message_definition.rb'
234
- - 'lib/unibuf/models/schema.rb'
235
- - 'lib/unibuf/models/values/base_value.rb'
236
- - 'lib/unibuf/models/values/scalar_value.rb'
237
- - 'lib/unibuf/parsers/proto3/processor.rb'
238
- - 'lib/unibuf/parsers/textproto/processor.rb'
239
- - 'lib/unibuf/validators/schema_validator.rb'
205
+ Enabled: false
240
206
 
241
- # Offense count: 38
207
+ # Offense count: 121
242
208
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
243
209
  Metrics/MethodLength:
244
- Max: 38
210
+ Max: 102
245
211
 
246
- # Offense count: 5
212
+ # Offense count: 19
247
213
  # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
248
214
  Metrics/PerceivedComplexity:
249
- Exclude:
250
- - 'lib/unibuf/models/field_definition.rb'
251
- - 'lib/unibuf/models/values/scalar_value.rb'
252
- - 'lib/unibuf/parsers/proto3/processor.rb'
253
- - 'lib/unibuf/parsers/textproto/processor.rb'
254
-
255
- # Offense count: 7
256
- # This cop supports safe autocorrection (--autocorrect).
257
- # Configuration parameters: EnforcedStyle, BlockForwardingName.
258
- # SupportedStyles: anonymous, explicit
259
- Naming/BlockForwarding:
260
- Exclude:
261
- - 'lib/unibuf/models/message.rb'
262
- - 'lib/unibuf/models/values/list_value.rb'
215
+ Enabled: false
263
216
 
264
- # Offense count: 11
217
+ # Offense count: 26
265
218
  # Configuration parameters: Mode, AllowedMethods, AllowedPatterns, AllowBangMethods, WaywardPredicates.
266
219
  # AllowedMethods: call
267
220
  # WaywardPredicates: nonzero?
268
221
  Naming/PredicateMethod:
269
- Exclude:
270
- - 'lib/unibuf/models/enum_definition.rb'
271
- - 'lib/unibuf/models/field_definition.rb'
272
- - 'lib/unibuf/models/message.rb'
273
- - 'lib/unibuf/models/message_definition.rb'
274
- - 'lib/unibuf/models/schema.rb'
275
- - 'lib/unibuf/models/values/base_value.rb'
276
- - 'lib/unibuf/models/values/list_value.rb'
277
- - 'lib/unibuf/models/values/map_value.rb'
278
- - 'lib/unibuf/models/values/message_value.rb'
279
- - 'lib/unibuf/models/values/scalar_value.rb'
280
- - 'lib/unibuf/validators/type_validator.rb'
281
-
282
- # Offense count: 2
283
- # This cop supports safe autocorrection (--autocorrect).
284
- Performance/BlockGivenWithExplicitBlock:
285
- Exclude:
286
- - 'lib/unibuf/models/message.rb'
287
-
288
- # Offense count: 1
289
- # This cop supports unsafe autocorrection (--autocorrect-all).
290
- Performance/MapCompact:
291
- Exclude:
292
- - 'lib/unibuf/parsers/proto3/processor.rb'
293
-
294
- # Offense count: 1
295
- # This cop supports unsafe autocorrection (--autocorrect-all).
296
- # Configuration parameters: AllowRegexpMatch.
297
- Performance/RedundantEqualityComparisonBlock:
298
- Exclude:
299
- - 'lib/unibuf/models/values/list_value.rb'
300
-
301
- # Offense count: 1
302
- # This cop supports unsafe autocorrection (--autocorrect-all).
303
- RSpec/BeEq:
304
- Exclude:
305
- - 'spec/unibuf/models/field_spec.rb'
222
+ Enabled: false
306
223
 
307
- # Offense count: 1
308
- # This cop supports safe autocorrection (--autocorrect).
309
- # Configuration parameters: EnforcedStyle.
310
- # SupportedStyles: be, be_nil
311
- RSpec/BeNil:
224
+ # Offense count: 19
225
+ # Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
226
+ # SupportedStyles: snake_case, normalcase, non_integer
227
+ # AllowedIdentifiers: TLS1_1, TLS1_2, capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64
228
+ Naming/VariableNumber:
312
229
  Exclude:
313
- - 'spec/unibuf_spec.rb'
230
+ - 'lib/unibuf/parsers/binary/wire_format_parser.rb'
231
+ - 'lib/unibuf/serializers/binary_serializer.rb'
232
+ - 'spec/unibuf/parsers/binary/wire_format_parser_spec.rb'
233
+ - 'spec/unibuf/serializers/binary_serializer_spec.rb'
314
234
 
315
- # Offense count: 1
235
+ # Offense count: 7
316
236
  # Configuration parameters: Prefixes, AllowedPatterns.
317
237
  # Prefixes: when, with, without
318
238
  RSpec/ContextWording:
319
239
  Exclude:
320
240
  - 'spec/unibuf/parsers/textproto/integration_spec.rb'
241
+ - 'spec/unibuf/serializers/binary_serializer_spec.rb'
321
242
 
322
- # Offense count: 1
243
+ # Offense count: 10
323
244
  # Configuration parameters: IgnoredMetadata.
324
245
  RSpec/DescribeClass:
325
246
  Exclude:
@@ -328,34 +249,51 @@ RSpec/DescribeClass:
328
249
  - '**/spec/routing/**/*'
329
250
  - '**/spec/system/**/*'
330
251
  - '**/spec/views/**/*'
252
+ - 'spec/unibuf/parsers/capnproto/additional_coverage_spec.rb'
253
+ - 'spec/unibuf/parsers/capnproto/binary_parser_spec.rb'
254
+ - 'spec/unibuf/parsers/capnproto/comprehensive_spec.rb'
255
+ - 'spec/unibuf/parsers/capnproto/error_handling_spec.rb'
256
+ - 'spec/unibuf/parsers/capnproto/integration_spec.rb'
257
+ - 'spec/unibuf/parsers/proto3/parser_spec.rb'
331
258
  - 'spec/unibuf/parsers/textproto/integration_spec.rb'
259
+ - 'spec/unibuf/serializers/binary_integration_spec.rb'
260
+ - 'spec/unibuf/serializers/capnproto/binary_serializer_spec.rb'
261
+ - 'spec/unibuf/serializers/flatbuffers/binary_serializer_debug_spec.rb'
332
262
 
333
- # Offense count: 34
263
+ # Offense count: 230
334
264
  # Configuration parameters: CountAsOne.
335
265
  RSpec/ExampleLength:
336
- Max: 22
266
+ Max: 50
337
267
 
338
- # Offense count: 2
268
+ # Offense count: 14
339
269
  # Configuration parameters: Max, AllowedIdentifiers, AllowedPatterns.
340
270
  RSpec/IndexedLet:
341
271
  Exclude:
272
+ - 'spec/unibuf/models/capnproto/interface_definition_spec.rb'
273
+ - 'spec/unibuf/models/capnproto/schema_spec.rb'
274
+ - 'spec/unibuf/models/capnproto/struct_definition_spec.rb'
342
275
  - 'spec/unibuf/models/message_definition_spec.rb'
276
+ - 'spec/unibuf/models/schema_spec.rb'
277
+ - 'spec/unibuf/parsers/capnproto/comprehensive_spec.rb'
278
+ - 'spec/unibuf/validators/schema_validator_spec.rb'
279
+
280
+ # Offense count: 1
281
+ RSpec/MultipleDescribes:
282
+ Exclude:
283
+ - 'spec/unibuf/models/capnproto/interface_definition_spec.rb'
343
284
 
344
- # Offense count: 36
285
+ # Offense count: 235
345
286
  RSpec/MultipleExpectations:
346
- Max: 5
287
+ Max: 8
347
288
 
348
- # Offense count: 6
349
- # This cop supports safe autocorrection (--autocorrect).
350
- # Configuration parameters: AllowOnlyRestArgument, UseAnonymousForwarding, RedundantRestArgumentNames, RedundantKeywordRestArgumentNames, RedundantBlockArgumentNames.
351
- # RedundantRestArgumentNames: args, arguments
352
- # RedundantKeywordRestArgumentNames: kwargs, options, opts
353
- # RedundantBlockArgumentNames: blk, block, proc
354
- Style/ArgumentsForwarding:
289
+ # Offense count: 1
290
+ # Configuration parameters: AllowedPatterns.
291
+ # AllowedPatterns: ^expect_, ^assert_
292
+ RSpec/NoExpectationExample:
355
293
  Exclude:
356
- - 'lib/unibuf/models/values/list_value.rb'
294
+ - 'spec/unibuf/serializers/flatbuffers/binary_serializer_debug_spec.rb'
357
295
 
358
- # Offense count: 25
296
+ # Offense count: 56
359
297
  # This cop supports safe autocorrection (--autocorrect).
360
298
  # Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
361
299
  # SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
@@ -364,135 +302,45 @@ Style/ArgumentsForwarding:
364
302
  # AllowedMethods: lambda, proc, it
365
303
  Style/BlockDelimiters:
366
304
  Exclude:
367
- - 'lib/unibuf/models/values/list_value.rb'
368
- - 'lib/unibuf/models/values/scalar_value.rb'
369
- - 'lib/unibuf/parsers/proto3/grammar.rb'
370
- - 'lib/unibuf/parsers/proto3/processor.rb'
371
- - 'lib/unibuf/parsers/textproto/grammar.rb'
372
- - 'lib/unibuf/parsers/textproto/processor.rb'
373
- - 'spec/unibuf/models/message_definition_spec.rb'
374
- - 'spec/unibuf/parsers/textproto/integration_spec.rb'
375
-
376
- # Offense count: 3
377
- # This cop supports unsafe autocorrection (--autocorrect-all).
378
- Style/ComparableBetween:
379
- Exclude:
380
- - 'lib/unibuf.rb'
381
- - 'lib/unibuf/validators/type_validator.rb'
305
+ - 'spec/unibuf/models/capnproto/enum_definition_spec.rb'
306
+ - 'spec/unibuf/models/capnproto/field_definition_spec.rb'
307
+ - 'spec/unibuf/models/capnproto/interface_definition_spec.rb'
308
+ - 'spec/unibuf/models/capnproto/schema_spec.rb'
309
+ - 'spec/unibuf/models/capnproto/struct_definition_spec.rb'
310
+ - 'spec/unibuf/parsers/capnproto/additional_coverage_spec.rb'
311
+ - 'spec/unibuf/parsers/capnproto/comprehensive_spec.rb'
312
+ - 'spec/unibuf/parsers/capnproto/error_handling_spec.rb'
382
313
 
383
314
  # Offense count: 1
384
315
  # This cop supports safe autocorrection (--autocorrect).
385
- Style/DefWithParentheses:
316
+ # Configuration parameters: EnforcedStyle, AllowComments.
317
+ # SupportedStyles: empty, nil, both
318
+ Style/EmptyElse:
386
319
  Exclude:
387
- - 'lib/unibuf/models/message.rb'
320
+ - 'lib/unibuf/serializers/capnproto/binary_serializer.rb'
388
321
 
389
- # Offense count: 1
390
- # This cop supports unsafe autocorrection (--autocorrect-all).
391
- Style/MapIntoArray:
392
- Exclude:
393
- - 'lib/unibuf/models/message.rb'
394
-
395
- # Offense count: 11
396
- # This cop supports safe autocorrection (--autocorrect).
397
- Style/MultilineIfModifier:
398
- Exclude:
399
- - 'lib/unibuf.rb'
400
- - 'lib/unibuf/commands/convert.rb'
401
- - 'lib/unibuf/models/enum_definition.rb'
402
- - 'lib/unibuf/models/field_definition.rb'
403
- - 'lib/unibuf/parsers/textproto/parser.rb'
404
- - 'lib/unibuf/validators/type_validator.rb'
405
-
406
- # Offense count: 1
407
- # This cop supports safe autocorrection (--autocorrect).
408
- Style/NestedFileDirname:
409
- Exclude:
410
- - 'bin/import-google-fonts-fixtures'
411
-
412
- # Offense count: 2
413
- # This cop supports safe autocorrection (--autocorrect).
414
- # Configuration parameters: AllowSafeAssignment, AllowInMultilineConditions.
415
- Style/ParenthesesAroundCondition:
416
- Exclude:
417
- - 'lib/unibuf.rb'
418
-
419
- # Offense count: 2
420
- # This cop supports safe autocorrection (--autocorrect).
421
- Style/RedundantParentheses:
422
- Exclude:
423
- - 'lib/unibuf.rb'
424
-
425
- # Offense count: 1
426
- # This cop supports unsafe autocorrection (--autocorrect-all).
427
- # Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
428
- # AllowedMethods: present?, blank?, presence, try, try!
429
- Style/SafeNavigation:
430
- Exclude:
431
- - 'lib/unibuf/parsers/textproto/processor.rb'
432
-
433
- # Offense count: 1
434
- # This cop supports unsafe autocorrection (--autocorrect-all).
435
- # Configuration parameters: Mode.
436
- Style/StringConcatenation:
437
- Exclude:
438
- - 'lib/unibuf/validators/schema_validator.rb'
439
-
440
- # Offense count: 7
441
- # This cop supports safe autocorrection (--autocorrect).
442
- # Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
443
- # SupportedStyles: single_quotes, double_quotes
444
- Style/StringLiterals:
445
- Exclude:
446
- - 'lib/unibuf/parsers/proto3/grammar.rb'
447
- - 'lib/unibuf/parsers/textproto/processor.rb'
448
- - 'unibuf.gemspec'
449
-
450
- # Offense count: 1
451
- # This cop supports safe autocorrection (--autocorrect).
452
- # Configuration parameters: EnforcedStyle.
453
- # SupportedStyles: single_quotes, double_quotes
454
- Style/StringLiteralsInInterpolation:
455
- Exclude:
456
- - 'lib/unibuf/parsers/textproto/parser.rb'
457
-
458
- # Offense count: 1
459
- # This cop supports safe autocorrection (--autocorrect).
460
- Style/SuperArguments:
461
- Exclude:
462
- - 'lib/unibuf/models/values/message_value.rb'
463
-
464
- # Offense count: 34
322
+ # Offense count: 72
465
323
  # This cop supports safe autocorrection (--autocorrect).
466
324
  # Configuration parameters: EnforcedStyleForMultiline.
467
325
  # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
468
326
  Style/TrailingCommaInArguments:
469
327
  Exclude:
470
- - 'lib/unibuf/parsers/proto3/processor.rb'
471
- - 'spec/unibuf/models/field_spec.rb'
472
- - 'spec/unibuf/models/message_definition_spec.rb'
473
- - 'spec/unibuf/models/message_spec.rb'
328
+ - 'spec/unibuf/models/capnproto/enum_definition_spec.rb'
329
+ - 'spec/unibuf/models/capnproto/field_definition_spec.rb'
330
+ - 'spec/unibuf/models/capnproto/interface_definition_spec.rb'
331
+ - 'spec/unibuf/models/capnproto/schema_spec.rb'
332
+ - 'spec/unibuf/models/capnproto/struct_definition_spec.rb'
333
+ - 'spec/unibuf/parsers/capnproto/additional_coverage_spec.rb'
334
+ - 'spec/unibuf/parsers/capnproto/comprehensive_spec.rb'
335
+ - 'spec/unibuf/parsers/capnproto/error_handling_spec.rb'
474
336
 
475
- # Offense count: 20
337
+ # Offense count: 26
476
338
  # This cop supports safe autocorrection (--autocorrect).
477
339
  # Configuration parameters: EnforcedStyleForMultiline.
478
340
  # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
479
341
  Style/TrailingCommaInArrayLiteral:
480
342
  Exclude:
481
- - 'spec/unibuf/models/message_spec.rb'
482
- - 'spec/unibuf/parsers/textproto/processor_spec.rb'
483
-
484
- # Offense count: 35
485
- # This cop supports safe autocorrection (--autocorrect).
486
- # Configuration parameters: EnforcedStyleForMultiline.
487
- # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
488
- Style/TrailingCommaInHashLiteral:
489
- Exclude:
490
- - 'lib/unibuf/models/enum_definition.rb'
491
- - 'lib/unibuf/models/field_definition.rb'
492
- - 'lib/unibuf/models/message.rb'
493
- - 'lib/unibuf/models/message_definition.rb'
494
- - 'lib/unibuf/models/schema.rb'
495
- - 'lib/unibuf/parsers/proto3/processor.rb'
496
- - 'lib/unibuf/validators/type_validator.rb'
497
- - 'spec/unibuf/models/message_spec.rb'
498
- - 'spec/unibuf/parsers/textproto/processor_spec.rb'
343
+ - 'spec/unibuf/models/capnproto/schema_spec.rb'
344
+ - 'spec/unibuf/parsers/capnproto/additional_coverage_spec.rb'
345
+ - 'spec/unibuf/parsers/capnproto/comprehensive_spec.rb'
346
+ - 'spec/unibuf/parsers/capnproto/error_handling_spec.rb'