Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Ruby] Split messages files per message type (#225)
* Set minimum ruby to 2.7 and minimum rubygems to 3.2.3 * Remove ruby 2.6 and 2.7 from workflows - Add in ruby 3.3 * Update target rubocop version * Update misc files * Update to use latest CCK in testing * Remove some gitignore files * Spike of non-working code * Spike of using both private and public methods * Compare / contrast the two ways of performing the new cck path reference * Working example for iterative checks on each item * Use file exist to simplify code - Remove wildcards * Update minimum deps for rake / rspec * Fix up all gemspec cops * Move towards a spec support structure to remove any oddities flagged by rubocop * Remove duplicate dummy messages * Split up composiite dummy message class into individual items * Remove top level leaked fake class for utils testing * Fix up some minor simple offenses for utils spec * Slight update to check rubocop works and then regenerate autogenconfig * Bump rubocop performance and rubocop rake to latest. Slight bump to rubocop / rubocop-rspec * Fix up issue whereby error was being rescued incorrectly and was being stored without requirement * Tidy up serialization formatting * Ignore line length cop as it's un-enforceable * Attempt to distinguish what are the actual objects in the acceptance tests * Re-gen the autogen config using bundler to ensure correct version (For now) * Set minimum ruby to 3.0 * Reduce line count of spec for acceptance as we just want a wrap/unwrap call * Fix up typos and named subject issue in serialization spec * Fix up a couple of spec support Lint/MissingSuper calls * Simplify deserialization protocol into just a single class method which is extended * underscore as a method isn't used in the utils implementation * Remove underscore tests * Simplify Utils to just be extended as class methods * Utils aren't used in the deserialization protocol * Move all serialization into the message proper as it's just a single module with 1 method used in 1 location * Move the deserialization spec tests into message proper Fix describe block as they're class methods not instance methods * Remove utils class and place camelize inside the message proper * Don't create an extra object * Split id generator into individual class files * AF: Style/SpecialGlobalVars * Simplify serialization spec by not creating 10 different subjects * AF: Gemspec/OrderedDependencies * AF: Layout/EmptyLineAfterMagicComment * Partial fix for the Layout/FirstArrayElementIndentation cop offenses * AF: Layout/LeadingEmptyLines * Re-generate todo file with May's marker - 50 offenses cleared with the gem upgrade and rubocop bump * Fix rubocop error * Alter UUID test to just check for a securerandom uuid and simplify the code * Alter incrementing spec to only have 1 assertion line * Move serialization into message model proper * Fix up Layout cops after copying over serialization messages * AF: Lint/ToJSON should allow optional discarded args * In ruby 2.6+ #to_h permits a block assign so we can refine this code better * Refine the compacting of the resultant hash in the message adhering to the Style/CollectionCompact rule * AF: Style/SlicingWithRange * Update tests to remove redundant failing ones and fix up some legacy named subject offenses * Re-order and tidy up messages class * Add super() call to each message generation - Should remedy Lint/MissingSuper cop offense * Re-generate config * Fix up args to JSONSchema generation to use Ruby 3.0+ idioms * Fix up the Trailing Whitespace cop by fixing a generation bug * AF: Lint/AmbiguousOperatorPrecedence * Fix up RSpec/DescribedClass issue with ndjson spec * Partial fix of RSpec/ExampleLength * Alter the Enum generator enabling us to autofix Style/ClassAndModuleChildren * AF: FrozenStringLiteral * Remove redundant spec * Configure and permit AllowedNames to also include as a name and Exclusion lists to be merged * Disable Style/AccessorGrouping * Fix up namespacing issues when migrating tests * Move some logic out into let/subject blocks * Fix up auto-fix offenses in rubocop * Remove frozen string literal pragma's whilst we haven't fixed up autogen * Add new requirements pending migration to one class per file logic like in java/cpp * Fix up line spacing in generic ruby file and begin to split file into constituent ones * Move all helpers to helpers namespace * Fix up tests and require path * Rename confusingly named make targets * Generate files in new way * Leave leakage item on dtos file for now as it will serve well when we come to fix filename * Add new generation logic to .generate-messages * add new clean command * Add new filename checking for template Fix clean process not to remove helpers * Alter generation to use snake cased names * Re-generate files * Remove extra line that's not needed * Make inheritance from message simpler * Alter enum generation to also make new unique files * Add .from_h method to ruby.rb.erb template to begin process of removing redundant template * Add enum generation to the generator script Clean up all redundant strings * Remove all trace to referencing the .dtos.rb file including using the now un-needed jsonschema template for the deserializers * Remove all trace to referencing the .deserializers.rb file * Fix up namespace for UUID * Require all new messages when requiring one message * Only add comma after properties that aren't final * Remove un-required requirement now we are recursively loading items in * Re-generate messages using new templates * Remove duplicate comma on the if/elsif/else statement * Add comma into correct spot in template * Fixed mismatched comment style from template * Fix frozen string literal pragmas in templates * Enum template was assigning an un-needed index during iteration * Re-generated messages * Re-generate TODO file after minor fixes in templates * AF: Style/StringConcatenation * Manual fix for RSpec/ExampleLength * AF: RSpec/DescribedClass£ * AF: Layout/SpaceInsideBlockBraces * Remove duplicate files missed by bad merge conflict * Re-generate TODO file owing to conflict clash * Fix up RSpec/MultipleExpectations * Disable ParameterLists cop as most messages will have 5+ properties * Fix up RSpec/NestedGroups * Ignore method length for same reason as parameter lists * AF: Layout/EmptyLineAfterGuardClause * Remove TODO file as we have < 10 offenses to fix now * Ignore all generated files * Switch from metric blanket overrides to generated code overrides * Only ignore Metrics and Layout/LineLength for generated messages * Fix up line length offenses in message class proper * Fix up all remaining line length issues in the specs * Fix up LineLength offenses by moving extraction of message out to a private sub method * Update changelogs * Slight update to some rubocop gems that don't affect signoff of rubocop conformance * Accessor grouping should only be unenforceable in generated messages * Update docs
- Loading branch information