Repository navigation
Upper-case the enumerators of enum parameters - #448
Conversation
|
Thanks for picking this up! The case check covers the One small suggestion: |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the enum-generation update.
No open issues 🎉
What changed in this PR
Updates enum parameter generation introduced in #446 to use uppercase C++ enumerators and Python members, while preserving the original, case-sensitive ROS parameter strings.
Changes:
- Uppercases generated enum declarations, defaults, and conversion references.
- Rejects values that collide after uppercasing or match listed common C/C++ macros.
- Updates documentation and tests for uppercase members and unchanged string values.
| File | Description |
|---|---|
README.md |
Documents uppercase members, validation rules, and usage. |
generate_parameter_library_py/generate_parameter_library_py/test/test_enum_parameters.py |
Tests uppercase generation, validation, and Python string compatibility. |
generate_parameter_library_py/generate_parameter_library_py/parse_yaml.py |
Separates enumerator names from strings and validates collisions. |
generate_parameter_library_py/generate_parameter_library_py/jinja_templates/python/declare_enum |
Generates uppercase Python members with original string values. |
generate_parameter_library_py/generate_parameter_library_py/jinja_templates/cpp/parameter_library_header |
Updates conversions to use uppercase enumerators. |
generate_parameter_library_py/generate_parameter_library_py/jinja_templates/cpp/declare_enum |
Generates uppercase C++ enumerators. |
example/test/test_params_consistency.cpp |
Updates C++ consistency tests to uppercase references. |
example_python/test/test_params_consistency.py |
Updates Python consistency tests to uppercase references. |
example_cmake_python/test/test_params_consistency.py |
Updates CMake-based Python consistency tests to uppercase references. |
Review effort: Balanced
christophfroehlich
left a comment
There was a problem hiding this comment.
LGTM.
uppercase enums are enforced, and the user can decide how the parameters should be written by using enum_values: [VELOCITY] or enum_values: [velocity]
reads similar to the claude review in my session ;)
I agree that those could be typical values and should be rejected. |
|
Great! Not sure about the branching strategy here, will this be backported? |
As discussed here: #446
@jjohnnystwsss @christophfroehlich