Skip to content

[Base] move macro for unique name generation in standalone header#1286

Merged
tdavidcl merged 4 commits intoShamrock-code:mainfrom
tdavidcl:patch-2025-09-25-13-01
Sep 25, 2025
Merged

[Base] move macro for unique name generation in standalone header#1286
tdavidcl merged 4 commits intoShamrock-code:mainfrom
tdavidcl:patch-2025-09-25-13-01

Conversation

@tdavidcl
Copy link
Member

No description provided.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @tdavidcl, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on improving code modularity and reusability by extracting the unique name generation macro logic into its own dedicated header file. This refactoring cleans up existing code in stacktrace.hpp and provides a centralized, tested utility for creating unique identifiers, enhancing maintainability and reducing redundancy across the codebase.

Highlights

  • New Header for Unique Name Generation: A new header file, unique_name_macro.hpp, has been introduced to centralize the logic for generating unique names using preprocessor macros.
  • Refactoring of stacktrace.hpp: The stacktrace.hpp file has been updated to remove its internal unique name generation macros and now utilizes the newly created __shamrock_unique_name macro from the dedicated header.
  • New Test for Unique Name Macro: A new test file, unique_name_macro_test.cpp, has been added to ensure the __shamrock_unique_name macro correctly generates unique identifiers, preventing potential naming conflicts.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the unique name generation macro into a standalone header, which is a great improvement for modularity and reusability. The changes are well-structured. My review includes a few suggestions to improve the documentation in the new header and update the comments in the consuming file to reflect the refactoring. These changes will enhance clarity and help prevent potential misuse.

tdavidcl and others added 3 commits September 25, 2025 13:13
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@tdavidcl tdavidcl linked an issue Sep 25, 2025 that may be closed by this pull request
@github-actions
Copy link
Contributor

Workflow report

workflow report corresponding to commit 1be8cb7
Commiter email is timothee.davidcleris@proton.me
GitHub page artifact URL GitHub page artifact link (can expire)

Pre-commit check report

Pre-commit check: ✅

trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check for merge conflicts................................................Passed
check that executables have shebangs.....................................Passed
check that scripts with shebangs are executable..........................Passed
check for added large files..............................................Passed
check for case conflicts.................................................Passed
check for broken symlinks................................................Passed
check yaml...............................................................Passed
detect private key.......................................................Passed
No-tabs checker..........................................................Passed
Tabs remover.............................................................Passed
Validate GitHub Workflows................................................Passed
clang-format.............................................................Passed
black....................................................................Passed
ruff check...............................................................Passed
Check doxygen headers....................................................Passed
Check license headers....................................................Passed
Check #pragma once.......................................................Passed
Check SYCL #include......................................................Passed
No ssh in git submodules remote..........................................Passed

Test pipeline can run.

Clang-tidy diff report

No relevant changes found.
Well done!

You should now go back to your normal life and enjoy a hopefully sunny day while waiting for the review.

Doxygen diff with main

Removed warnings : 2
New warnings : 3
Warnings count : 8129 → 8130 (0.0%)

Detailed changes :
- src/shambase/include/shambase/stacktrace.hpp:131: warning: Compound shambase::details::NamedBasicStackEntry is not documented.
+ src/shambase/include/shambase/stacktrace.hpp:132: warning: Compound shambase::details::NamedBasicStackEntry is not documented.
- src/shambase/include/shambase/stacktrace.hpp:85: warning: Compound shambase::details::BasicStackEntry is not documented.
+ src/shambase/include/shambase/stacktrace.hpp:86: warning: Compound shambase::details::BasicStackEntry is not documented.
+ src/shambase/include/shambase/unique_name_macro.hpp:35: warning: Member __shamrock_unique_name(base_name) (macro definition) of file unique_name_macro.hpp is not documented.

@tdavidcl tdavidcl merged commit bee2f1a into Shamrock-code:main Sep 25, 2025
94 of 95 checks passed
@tdavidcl tdavidcl deleted the patch-2025-09-25-13-01 branch September 25, 2025 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Base] generalize unique name generation macro

1 participant