Eliminate instance allocation in validation by converting to stateless modules#341
Merged
Conversation
- Transitioned `Validation` and `Performer` from classes to modules for a simpler structure. - Removed redundant instance variables and caching, favoring local variables for clarity and maintainability. - Simplified method signatures and reduced complexity by consolidating and refactoring validation and error handling logic. - Updated related type signatures in `.rbs` files to match refactored implementation. - Enhanced error propagation for clearer exception handling in validation workflows.
- Replaced `validation_classes_from` with direct calls to `collection_of_options.validation_classes` for simplicity. - Removed redundant private methods in `Performer` and `Validation` for cleaner implementation. - Added `check_options` parameter to maintain uniformity across validation interfaces. - Updated type signatures in `.rbs` files to reflect the refactored method signatures and structure. - Improved readability and streamlined validation workflows.
- Removed `rubocop:disable Metrics/MethodLength` as it is no longer necessary. - Simplified `process_option` method declaration for cleaner and more concise readability. - Retained consistency with the existing `validation_classes` structure.
- Enhanced exception creation in `Performer` to include attribute names. - Fixed error propagation in `Validation` with clearer mapping to failed inputs. - Improved method parameter formatting for better readability and consistency. - Refined internal workflows to ensure accurate error context and clearer logic flow.
- Renamed `desired_attribute_hash` to `typed_actor_kwargs` for improved semantic clarity. - Updated related method calls and type signatures in `.rb` and `.rbs` files to reflect the new method name. - Ensured consistency in validation workflows by adjusting references to the renamed attribute. - Preserved functionality while improving readability and expressiveness of the codebase.
- Replaced verbose exception creation with streamlined method call to `fail_<system_name>!`. - Removed redundant attributes in error raising logic. - Enhanced clarity and conciseness of error handling implementation.
- Added `# rubocop:disable Metrics/MethodLength` to `process`, `process_option`, and `validate!` methods to comply with RuboCop rules without refactoring. - Change maintains current functionality while addressing style enforcement.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.