https://github.com/justinchuby/clang-format-black
A clang-format config that mimics Python’s black formatter style
https://github.com/justinchuby/clang-format-black
Last synced: about 1 month ago
JSON representation
A clang-format config that mimics Python’s black formatter style
- Host: GitHub
- URL: https://github.com/justinchuby/clang-format-black
- Owner: justinchuby
- License: mit
- Created: 2023-07-12T14:20:07.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-07-25T17:26:38.000Z (almost 2 years ago)
- Last Synced: 2023-07-25T17:41:27.501Z (almost 2 years ago)
- Language: Python
- Size: 19.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# clang-format-black
A clang-format config / generator that mimics Python’s [black](https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html) formatter style.## Usage
Just use the `.clang-format` file in your own project.
## Config generator
You can use
```sh
python clang_format_black.py > .clang-format
```to generate a customized config. Available options:
```
$ python clang_format_black.py -husage: clang_format_black.py [-h] [--line-length LINE_LENGTH]
[--indent-width INDENT_WIDTH] [--align-array-of-structures]
[--access-modifier-offset ACCESS_MODIFIER_OFFSET]
[--align-trailing-comments] [--reflow-comments]
[--sort-includes]Create clang-format config that mimics Python's black formatter style.
options:
-h, --help show this help message and exit
--line-length LINE_LENGTH, --column-limit LINE_LENGTH
How many characters per line to allow. [default: 88]
--indent-width INDENT_WIDTH
Indent width. [default: 4]
--align-array-of-structures
Align array of structures.
--access-modifier-offset ACCESS_MODIFIER_OFFSET
Indent width for access modifiers. [default: -2]
--align-trailing-comments
Align trailing comments.
--reflow-comments Reflow comments.
--sort-includes Sort includes.
```