-
Notifications
You must be signed in to change notification settings - Fork 2
func names using go conventions #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Instead of 'type NumericTypeuint struct' generates 'NumericTypeUint'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR standardizes function naming across the ValidGen codebase by converting snake_case function names to camelCase, aligning with Go naming conventions. This improves code consistency and readability throughout the test suite.
- Converted all test function names from snake_case to camelCase format
- Updated function calls and references to match the new naming convention
- Modified template files to generate camelCase function names
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/endtoend/string.go | Renamed string_tests() to stringTests() |
| tests/endtoend/slice_string.go | Renamed slice_string_tests() to sliceStringTests() |
| tests/endtoend/slice_integer.go | Renamed slice_integer_tests() to sliceIntegerTests() |
| tests/endtoend/numeric.go | Renamed main function and all numeric test functions to camelCase |
| tests/endtoend/nested_struct.go | Renamed nested struct test functions to camelCase |
| tests/endtoend/map_string.go | Renamed map_string_tests() to mapStringTests() |
| tests/endtoend/map_numeric.go | Renamed map_uint8_tests() to mapUint8Tests() |
| tests/endtoend/main.go | Updated all function calls to use new camelCase names |
| tests/endtoend/generate_tests/numeric.tpl | Updated template to generate camelCase function names |
| tests/endtoend/cmp_between_nested_fields.go | Renamed comparison test functions to camelCase |
| tests/endtoend/cmp_between_inner_fields.go | Renamed inner field comparison functions to camelCase |
| tests/endtoend/bool.go | Renamed bool_tests() to boolTests() |
| tests/endtoend/array_string.go | Renamed array_string_tests() to arrayStringTests() |
| internal/common/types_test.go | Renamed test functions to remove underscores |
| internal/common/normalized_base_type_test.go | Renamed test function to camelCase |
| internal/analyzer/parser_validation_test.go | Renamed test functions to camelCase |
This PR standardizes function naming across the codebase by converting test and helper function names from snake_case to camelCase (Go conventions). This improves consistency and aligns with Go naming conventions, making the code easier to read and maintain.
Test function renaming for consistency:
internal/analyzer/parser_validation_test.goandinternal/common/normalized_base_type_test.gowere renamed to camelCase (e.g.,Test_ValidParserValidation→TestValidParserValidation,TestNormalizedBaseType_String→TestNormalizedBaseTypeString) [1] [2] [3].internal/common/types_test.gowere updated to camelCase (e.g.,TestFieldType_ToString→TestFieldTypeToString) [1] [2].End-to-end and helper function renaming:
tests/endtoenddirectory, including files likemain.go,array_string.go,bool.go,cmp_between_inner_fields.go,cmp_between_nested_fields.go,map_numeric.go,map_string.go,nested_struct.go,numeric.go,slice_integer.go,slice_string.go, andstring.go, were renamed from snake_case to camelCase [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33].Template and code generation updates:
tests/endtoend/generate_tests/numeric.tplwere updated to camelCase to match the new naming convention [1] [2].No logic changes were made; all updates are strictly to naming for improved code style and maintainability.