Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yamadapc/cmakefmt
CMake auto formatter
https://github.com/yamadapc/cmakefmt
Last synced: 3 months ago
JSON representation
CMake auto formatter
- Host: GitHub
- URL: https://github.com/yamadapc/cmakefmt
- Owner: yamadapc
- License: mit
- Created: 2023-12-10T08:05:00.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-01-21T23:43:50.000Z (12 months ago)
- Last Synced: 2024-09-10T17:47:07.781Z (4 months ago)
- Language: Rust
- Homepage:
- Size: 1.53 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# cmakefmt
[![Crates.io Version](https://img.shields.io/crates/v/cmakefmt)](https://crates.io/crates/cmakefmt)
- - -
Good enough CMake auto formatter. No settings, prints to STDOUT.[Blog post / Demo](https://beijaflor.io/blog/01-2024/cmakefmt-01/)
## Install
```
cargo install cmakefmt
```## Usage
```
cmakefmt
```## State
* Basic syntax is handled and prints
* Error handling prints nice error messages, but it's very verbose and sometimes
the true parsing error is deeper into the file
* Ignores commas after quoted string literals since that just breaks string commands and isn't valid syntax
* Fails to parse conditional expressions if comments are put before a binary conditional operator (AND/OR etc.)## Rules
* Statements and commands are printed in one line or break into multiple lines
if there isn't space
* Command arguments are broken into one line each, unless they are an upper-case
word. In case an argument is an upper-case word, it creates a group with all
the following non-uppercase arguments. This helps format key-value style
bringings.
* Group-like statements (foreach, if, block, macro) indent their children## License
MIT