Skip to content

refactor: apply snake_case to the function names#60

Merged
ktro2828 merged 1 commit intomainfrom
refactor/archetype/snake-case
Oct 2, 2025
Merged

refactor: apply snake_case to the function names#60
ktro2828 merged 1 commit intomainfrom
refactor/archetype/snake-case

Conversation

@ktro2828
Copy link
Copy Markdown
Owner

@ktro2828 ktro2828 commented Oct 2, 2025

Description

This pull request refactors the error handling and result construction code across the mmros project to use more consistent and descriptive function naming. The main changes involve renaming utility functions for constructing success and error results, updating method names for checking result status, and ensuring these changes are reflected throughout all relevant detector classes. This improves code readability and aligns with modern C++ naming conventions.

Core API refactoring:

  • Renamed result construction functions in mmros/include/mmros/archetype/result.hpp from Ok/Err to make_ok/make_err, and updated all usages accordingly. [1] [2] [3] [4]
  • Renamed the isOk() method in the Result class to is_ok() for consistency with the new naming convention.

Exception handling improvements:

  • Renamed the internal method appendMessagePrefix() to append_message_prefix() in MmRosException and updated its usage for consistency. [1] [2] [3]

Detector classes updates:

  • Updated all detector classes (Detector2D, InstanceSegmenter2D, PanopticSegmenter2D, SemanticSegmenter2D) to use the new make_ok and make_err functions for constructing results, replacing all previous usages of Ok and Err. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]

How was this PR tested?

Notes for reviewers

None.

Effects on system behavior

None.

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
Copilot AI review requested due to automatic review settings October 2, 2025 22:17
Copy link
Copy Markdown
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 refactors function names across the mmros project to follow snake_case naming conventions, improving code consistency and readability.

Key Changes:

  • Renamed result construction functions from Ok/Err to make_ok/make_err
  • Updated isOk() method to is_ok() in the Result class
  • Renamed appendMessagePrefix() to append_message_prefix() in MmRosException

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
mmros/include/mmros/archetype/result.hpp Updates Result class method and factory function names to snake_case
mmros/include/mmros/archetype/exception.hpp Renames MmRosException internal method to snake_case
mmros/src/detector/detector2d.cpp Updates all error/success result construction calls to use new function names
mmros/src/detector/instance_segmeter2d.cpp Updates all error/success result construction calls to use new function names
mmros/src/detector/panoptic_segmenter2d.cpp Updates all error/success result construction calls to use new function names
mmros/src/detector/semantic_segmenter2d.cpp Updates all error/success result construction calls to use new function names

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@ktro2828 ktro2828 merged commit 19c1ead into main Oct 2, 2025
1 check failed
@ktro2828 ktro2828 deleted the refactor/archetype/snake-case branch October 2, 2025 22:18
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.

2 participants