Skip to content

Add clang-format version 18 to requirements.in#1039

Open
mhucka wants to merge 3 commits intotensorflow:masterfrom
mhucka:add-clang-format-req
Open

Add clang-format version 18 to requirements.in#1039
mhucka wants to merge 3 commits intotensorflow:masterfrom
mhucka:add-clang-format-req

Conversation

@mhucka
Copy link
Copy Markdown
Member

@mhucka mhucka commented Apr 10, 2026

Higher versions of clang-format produce different outputs than the version used to format what's currently in the repository. On a system where the developer installs a system package for clang-format (using, e.g., apt install clang-format), they may unknowingly get a different version than what was used to format the code in the repository. If they run ./scripts/format_all.sh they may see many changes and not realize that it's due to a different in clang-format versions.

Adding clang-format to requirements.in and regenerating requirements.txt is an easy way to get a known version of clang-format. Thankfully, requiring clang-format does not bring in other dependencies, so this ends up being a fairly surgical intervention.

mhucka added 2 commits April 10, 2026 03:59
Higher versions of `clang-format` produce different formatting results.
This is the output of running `./scripts/generate_requirements.sh`.
Copy link
Copy Markdown

@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 adds clang-format to the project's dependency list. The review feedback suggests pinning clang-format to a specific version in requirements.in, rather than using a version range, to ensure consistent code formatting across different environments and prevent potential CI failures caused by minor version updates.

Gemini Code Assist suggestions it's better to avoid a broad range of versions.
@mhucka mhucka marked this pull request as ready for review April 10, 2026 04:35
@mhucka mhucka requested a review from MichaelBroughton April 10, 2026 04:55
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.

1 participant