cmakefmt Puneet Matharu
winget install --id=cmakefmt.cmakefmt -e cmakefmt is a high-performance CMake formatter designed to ensure consistent code style and readability across CMake projects. Built in Rust, it serves as a modern alternative to cmake-format, offering faster execution, better support for contemporary CMake features, and seamless configuration migration from legacy setups.
Key Features:
- Speed & Efficiency: Processes files significantly faster than cmake-format, even when handling large projects with hundreds of files.
- Modern Command Support: Built-in specifications for over 150 commands, ensuring compatibility with the latest CMake versions and features.
- Legacy Config Conversion: Automatically translates existing cmake-format configurations to cmakefmt, minimizing disruption during migration.
- Zero Dependencies: Delivered as a single binary, eliminating the need for Python or virtual environments.
- Editor Integration: Includes an LSP server for real-time formatting in VS Code, Neovim, and other editors, plus schema-based configuration autocomplete.
- Workflow-Friendly CLI: Offers flags like
--check,--diff, and--stagedfor Git integration, as well as semantic verification and JSON reporting.
Audience & Benefit: Ideal for developers and teams working with CMake, cmakefmt streamlines the formatting process, ensuring consistent style across projects. By automating tedious tasks and supporting modern workflows, it helps maintain code quality, reduces manual effort, and integrates smoothly into CI/CD pipelines. Its performance gains and compatibility features make it a valuable tool for improving productivity in CMake-based development environments.
cmakefmt can be installed via winget as part of its distribution options.