Skip to content

Conversation

@alexgarzao
Copy link
Collaborator

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:

  • Test functions in internal/analyzer/parser_validation_test.go and internal/common/normalized_base_type_test.go were renamed to camelCase (e.g., Test_ValidParserValidationTestValidParserValidation, TestNormalizedBaseType_StringTestNormalizedBaseTypeString) [1] [2] [3].
  • Test functions in internal/common/types_test.go were updated to camelCase (e.g., TestFieldType_ToStringTestFieldTypeToString) [1] [2].

End-to-end and helper function renaming:

Template and code generation updates:

  • Function names and template-generated calls in tests/endtoend/generate_tests/numeric.tpl were 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.

Instead of 'type NumericTypeuint struct' generates 'NumericTypeUint'
@alexgarzao alexgarzao self-assigned this Oct 6, 2025
@alexgarzao alexgarzao requested a review from Copilot October 6, 2025 17:30
Copy link
Contributor

Copilot AI left a 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

@alexgarzao alexgarzao changed the title 82 func names using go conventions func names using go conventions Oct 6, 2025
@alexgarzao alexgarzao merged commit 01b9c7e into main Oct 7, 2025
4 checks passed
@alexgarzao alexgarzao deleted the 82-func-names-using-go-conventions branch October 7, 2025 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants