Skip to content

[format] upgrade clang-format to 19 #2990

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Irving-cl
Copy link
Contributor

This PR updates the clang-format version from 16 to 19.

We just updated the version from 14 to 16. But very unfortunately clang-format-16 was just deprecated recently. So this time we update the version to the latest available one. There are newer releases than 19 (like 20) but as I tested, sudo apt-get install -y clang-format-19 can work while 20 doesn't work.

Copy link

@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.

Summary of Changes

Hello @Irving-cl, 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!

I've updated the project's code formatting tool, clang-format, from version 16 to version 19. This change was necessary because clang-format 16 was recently deprecated. The goal is to ensure we are using a current and supported version for maintaining consistent code style across the codebase. This update primarily involves adjusting version references in documentation and scripts, and applying the resulting formatting changes to various C++ source files.

Highlights

  • Documentation Updates: Updated the required clang-format version from 16.0.0 to 19.1.7 in both CONTRIBUTING.md and STYLE_GUIDE.md, along with their respective links.
  • Script Configuration: Modified the script/clang-format to reflect the new major version 19 and full version 19.1.7, ensuring the correct version is enforced.
  • Build and Test Environment: Updated the tests/scripts/bootstrap.sh to install clang-format-19, aligning the testing environment with the new formatting standard.
  • Code Formatting Adjustments: Applied automatic code reformatting across several C++ source files (src/agent/application.cpp, src/common/code_utils.hpp, src/dbus/server/dbus_agent.cpp, src/dbus/server/dbus_thread_object_rcp.cpp, src/host/posix/udp_proxy.cpp) due to the clang-format version change.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 or fill out our survey to provide feedback.

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

@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 successfully upgrades the clang-format version from 16 to 19. The changes include updating documentation and scripts to reflect this new version, and re-formatting the C++ source code accordingly. The changes are consistent and well-executed. I have one minor suggestion to improve the maintainability of a shell script.

Copy link
Contributor

@superwhd superwhd left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@Irving-cl Irving-cl force-pushed the update_clang_format_19 branch from 996a028 to 7a52087 Compare August 4, 2025 09:04
Copy link

codecov bot commented Aug 4, 2025

Codecov Report

❌ Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 12.11%. Comparing base (2b41187) to head (7a52087).
⚠️ Report is 1171 commits behind head on main.

Files with missing lines Patch % Lines
src/dbus/server/dbus_thread_object_rcp.cpp 0.00% 1 Missing ⚠️
src/host/posix/udp_proxy.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2990       +/-   ##
===========================================
- Coverage   55.77%   12.11%   -43.67%     
===========================================
  Files          87      113       +26     
  Lines        6890    13297     +6407     
  Branches        0      905      +905     
===========================================
- Hits         3843     1611     -2232     
- Misses       3047    11596     +8549     
- Partials        0       90       +90     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Irving-cl Irving-cl requested a review from abtink August 5, 2025 02:12
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.

3 participants