Quaketastic Style
qcstyle is a free, fast, and small automatic formatter for C and QuakeC. This is a fork of Artistic Style (astyle) 1.23, with a lot of code cut out.This was made because I couldn't find a single QuakeC code formatter, so I thought might as well make the very first one(?) after 30 years of the game existing
Usage
Bash:
# Preview changes without writing:
qcstyle < myfile.qc
# Format in place (creates a .orig backup):
qcstyle myfile.qc
# Format in place without backup:
qcstyle -n myfile.qc
You can run
qcstyle --help for all options.Formatting Styles
| Flag | Name | Description |
|---|---|---|
| -A1 | allman | Broken braces |
| -A2 | k&r | Linux braces |
| -A3 | stroustrup | Linux braces, broken closing headers |
| -A4 | whitesmith | Broken, indented braces |
| -A5 | banner | Attached, indented braces |
| -A6 | gnu | Broken braces, indented blocks (2 spaces) |
| -A7 | linux | Linux braces (8 spaces) |
| -A8 | quakec | QuakeC style (Allman, 4 spaces) |
Any bugs you find you can report on the project's GitHub repository:
https://github.com/tunalad/qcstyle