Skip to content

style: fix clang-format violations and re-enable clang-format check#26

Merged
kkkapu merged 4 commits intomainfrom
clang-format-fix
Feb 4, 2026
Merged

style: fix clang-format violations and re-enable clang-format check#26
kkkapu merged 4 commits intomainfrom
clang-format-fix

Conversation

@kkkapu
Copy link
Collaborator

@kkkapu kkkapu commented Feb 2, 2026

Fix clang-format in build #2

Change-Id: I8e650dfc8e9922b8e48d970ff206539ab6250dd0
Change-Id: I53b36719394c9c1c3dacdcc9678e9742aa879cce
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @kkkapu, 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 primarily focuses on improving code style consistency by resolving existing clang-format violations. The changes are purely cosmetic, ensuring that the codebase aligns with the project's formatting standards. This work is a prerequisite for re-enabling the clang-format check in the build system, which will help maintain a uniform code style across all future contributions.

Highlights

  • Code Formatting: Addressed clang-format violations by reformatting code blocks to adhere to the defined style guidelines.
  • Build Process: Prepared the codebase for re-enabling the clang-format check in the build process, ensuring future code style consistency.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/build_and_test.yml
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 fixes clang-format violations. The changes are stylistic and correct. I've added a couple of suggestions to improve test readability by encapsulating the RAII-based file creation logic into helper functions. This would make the test setup more explicit and easier to understand.

{
BufferObject writer(test_path_ + "_new", 512);
}
{ BufferObject writer(test_path_ + "_new", 512); }
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

While this single-line scope is functionally correct, its purpose of leveraging RAII to create and immediately close a file can be made more explicit. Encapsulating this setup logic in a helper function within the BufferObjectTest fixture would improve test readability.

For example, you could add a helper like this to BufferObjectTest:

static void CreateTestFile(const std::string& path, size_t size) {
  BufferObject writer(path, size);
}

And then use it in the test:

CreateTestFile(test_path_ + "_new", 512);
BufferObject reader(test_path_ + "_new");

This makes the test's 'Arrange' step more self-documenting.

Copy link
Collaborator

Choose a reason for hiding this comment

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

the suggestion here makes it more readable - its hard to understand why we're doing this one line throwaway without knowing internal details, so wrapping in a function makes it more obvious. Can add a comment to the code in the function saying the BufferObject constructor will create the file, and its destructor will close (without deleting)

{
BufferObject writable_buffer(test_path_, initial_size);
}
{ BufferObject writable_buffer(test_path_, initial_size); }
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Similar to my other comment, this RAII pattern for file creation could be made more explicit by using a helper function. This would improve the readability of the test setup.

Using the same helper function idea:

static void CreateTestFile(const std::string& path, size_t size) {
  BufferObject writer(path, size);
}

The test setup would then become:

CreateTestFile(test_path_, initial_size);
ASSERT_EQ(std::filesystem::file_size(test_path_), initial_size);

This makes the intent of the setup clearer.

Change-Id: I4f9bef76fa5658a2399009cc0f1c1dc6650369ce
@kkkapu kkkapu requested review from Leahlijuan and g-husam February 3, 2026 21:27
Change-Id: I9c7a4861acbe82a7df5d1d196618536e26420859
@kkkapu kkkapu requested a review from g-husam February 3, 2026 22:26
@kkkapu kkkapu merged commit 4c806b3 into main Feb 4, 2026
5 checks passed
@kkkapu kkkapu deleted the clang-format-fix branch February 4, 2026 18:59
Leahlijuan pushed a commit that referenced this pull request Feb 4, 2026
ruff format --check .

- name: Lint with clang-format
if: false # TODO(#2): fix this then re-enable
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is the clang-format check, only the coverage check was re-enabled

--gcov-ignore-parse-errors negative_hits.warn \
--gcov-ignore-parse-errors suspicious_hits.warn
--gcov-ignore-parse-errors suspicious_hits.warn \
--gcov-ignore-errors=no_working_dir_found
Copy link
Collaborator

@g-husam g-husam Feb 9, 2026

Choose a reason for hiding this comment

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

is it actually working with these settings?

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