Skip to content

Conversation

minggangw
Copy link
Member

@minggangw minggangw commented Jul 21, 2025

This PR fixes a test failure in the rolling build by improving the IDL converter's preprocessing logic. The changes focus on enhancing the robustness of @verbatim block removal and refining module extraction to handle nested structures more accurately.

  • Enhanced @verbatim block parsing with proper string handling and escape sequence support
  • Improved module extraction logic to only include parent modules that contain direct definitions
  • Added better handling of nested module structures with brace-level tracking

Fix: #1200

@coveralls
Copy link

Coverage Status

coverage: 84.526%. first build
when pulling ccbbff0 on minggangw:fix-1200
into a53c1d0 on RobotWebTools:develop.

@minggangw minggangw requested a review from Copilot July 21, 2025 09:49
Copy link

@Copilot 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 fixes a test failure in the rolling build by improving the IDL converter's preprocessing logic. The changes focus on enhancing the robustness of @verbatim block removal and refining module extraction to handle nested structures more accurately.

  • Enhanced @verbatim block parsing with proper string handling and escape sequence support
  • Improved module extraction logic to only include parent modules that contain direct definitions
  • Added better handling of nested module structures with brace-level tracking
Comments suppressed due to low confidence (3)

rosidl_convertor/idl_convertor.py:197

  • [nitpick] The variable name 'i' is ambiguous and doesn't clearly indicate its purpose as a line index. Consider renaming it to 'line_index' or 'current_line_idx' for better readability.
        i = 0

rosidl_convertor/idl_convertor.py:216

  • [nitpick] The variable name 'j' is ambiguous and doesn't clearly indicate its purpose as a character position index. Consider renaming it to 'char_pos' or 'char_index' for better readability.
                j = paren_pos

rosidl_convertor/idl_convertor.py:242

  • [nitpick] The variable name 'j' is ambiguous and doesn't clearly indicate its purpose as a character position index. Consider renaming it to 'char_pos' or 'char_index' for better readability.
                        j = 0

else:
# Verbatim block continues to next lines
i += 1
while i < len(lines) and paren_count > 0:
Copy link

Copilot AI Jul 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This nested parsing logic with multiple while loops and similar character processing code is duplicated between lines 217-236 and lines 243-262. Consider extracting the character-by-character parsing logic into a separate helper method to reduce code duplication and improve maintainability.

Copilot uses AI. Check for mistakes.

@minggangw minggangw merged commit 0a33ec0 into RobotWebTools:develop Jul 21, 2025
21 of 22 checks passed
minggangw added a commit that referenced this pull request Jul 22, 2025
This PR fixes a test failure in the rolling build by improving the IDL converter's preprocessing logic. The changes focus on enhancing the robustness of @verbatim block removal and refining module extraction to handle nested structures more accurately.

- Enhanced @verbatim block parsing with proper string handling and escape sequence support
- Improved module extraction logic to only include parent modules that contain direct definitions
- Added better handling of nested module structures with brace-level tracking

Fix: #1200
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.

Fix test failure on rolling

2 participants