refactor tables check generate code (#90) #91
Merged
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.
Closes #90
This PR refactors the operations logic in the analyzer module to improve maintainability and extensibility. The core change is moving the definition and handling of validation operations into a dedicated
operationspackage, replacing the previous static map with a more structured and encapsulated approach. This update also introduces new helper methods and corresponding tests for operation validation.Refactoring and modularization of operations logic:
internal/analyzer/operations.goto a newoperationspackage, splitting the logic intooperations.go(core logic and helpers) andoperations_list.go(operation definitions). The old file was deleted and replaced with the new structure. [1] [2] [3]internal/analyzer/analyzer.goandinternal/analyzer/parser_validation.goto use the newoperationspackage and its helper methods, improving encapsulation and code clarity. [1] [2] [3] [4] [5] [6]Testing improvements:
operations_test.goin theoperationspackage to comprehensively test the validity of operations and their compatibility with field types.These changes make it easier to extend and maintain operation validation logic, and ensure correctness with improved test coverage.