bneradt opened a new pull request, #14033: URL: https://github.com/apache/trafficserver/pull/14033
10.2.x: This backports #13917 to 10.2.x. The #13883 Python pin was never backported to 10.2.x, so its revert commit is not needed here. The tooling commit keeps 10.2.x's vendored library list (10.2.x has no `lib/highway`). Please merge (not squash) to preserve the two commits. cmake-format (cmakelang) has had no release since 2021 and breaks on Python 3.15. This replaces it with [cmakefmt](https://github.com/cmakefmt/cmakefmt), an actively maintained Rust reimplementation that installs through `uv tool run` like our other formatters. The PR has two commits: 1. Swap the tooling: `.cmake-format.yaml` becomes `.cmakefmt.yaml`, `tools/cmake-format.sh` becomes `tools/cmakefmt.sh`, and the `cmake-format` target and pre-commit hook use cmakefmt 2.3.1. 2. Reformat every non-vendored CMake file with cmakefmt (66 files). ### Configuration Following the [cmakefmt migration guide](https://cmakefmt.dev/migration/), `.cmakefmt.yaml` is our old `.cmake-format.yaml` converted with `cmakefmt config convert`: 120 columns, 2 space indent, dangling closing parentheses, comment reflow off, and the same wrapping thresholds. The values are laid out on the full `cmakefmt config dump` template so every setting is visible and easy to tweak; settings the conversion did not cover keep cmakefmt's defaults. The converter drops cmake-format's lint and encoding sections, which cmakefmt does not have, and the placeholder `foo` command spec from cmake-format's template. One addition beyond the conversion: cmakefmt puts every argument on its own line once a keyword section has more than six, which splits long `COMMAND` lines one word per line. A `per_command_overrides` entry raises that limit for `add_custom_command`, `add_custom_target` and `execute_process`, so their commands stay packed as they were under cmake-format while source lists stay one per line. cmakefmt's output is not identical to cmake-format's even with the same settings, which is why the reformat commit is still needed. The most visible difference is that keyword arguments get a hanging indent under their keyword. Anyone using `tools/git/pre-commit` as their hook should copy it again after this merges; the CMake configure step does this automatically. ### Speed cmakefmt is also much faster. Wall time to rewrite (`-i`) all 195 non-vendored CMake files from a pristine master checkout, best of three runs on a 12 core Linux container, including `uv tool run` startup: | Formatter | Time | |------------------------------------|--------| | cmake-format 0.6.13 | 2.08 s | | cmakefmt 2.3.1, single threaded | 0.21 s | | cmakefmt 2.3.1, parallel (default) | 0.12 s | That is roughly 10x faster single threaded and 17x faster with cmakefmt's default parallelism. cmakefmt's own time, excluding uv startup, is about 0.03 s. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
