Python script to enforce formatting rules of C++ and CMake.
Uses clang-format for C++ files and Gersemi for CMake files.
Optionally allows to find project files that require prettifying using GitPython.
This script is mostly intended for personal usage for my projects. But feel free to use it too and give a feedback.
Just download script using link above and use it. There are no plans to use proper python solutions like pip module etc.
usage: pretty.py [-h] [-c] [--exclude EXCLUDE] [--clang-format CLANG_FORMAT]
[--gersemi GERSEMI]
[src [src ...]]
A formatter to make your C++ and CMake code the real treasure.
positional arguments:
src Files to format. Special value "-" to automatically
detect project files
optional arguments:
-h, --help show this help message and exit
-c, --check Check if files require reformatting. Return 0 when
there's nothing to reformat, return 1 when some files
would be reformatted
--exclude EXCLUDE Files and directories to exclude from formatting
--clang-format CLANG_FORMAT
Clang format to use for C++ files
--gersemi GERSEMI Gersemi to use for CMake files