Commit graph

3 commits

Author SHA1 Message Date
Robin Eklind
e18a70f82b Use .clang-format config instead of -style command line settings.
The Source/.clang-format config is used for *.cpp files.

The root .clang-format config is used for *.h files.
2018-10-06 22:52:58 +02:00
Robin Eklind
892e84136e Add Devilution specific config values for clang-format.
* AlignTrailingComments: true
* AllowShortBlocksOnASingleLine: true
* AllowShortFunctionsOnASingleLine: None
* PointerAlignment: Right

Note, currently, the format.sh script uses the config file
for .cpp files. The `AlignConsecutiveAssignments: true` setting
is specifically added for .h files.

I could not find a way to specify what config file to use
for clang-format. So, for now, the config file is used for
.cpp.
2018-10-06 22:52:58 +02:00
Robin Eklind
e9f16669ab Add clang-format script.
Base default style on WebKit and set a few options
specific to Devilution.

* `AlignTrailingComments: true`
* `AllowShortBlocksOnASingleLine: true`
* `AllowShortFunctionsOnASingleLine: None`
* `PointerAlignment: Right`

For header files, we also want to add

* `AlignConsecutiveAssignments: true`
2018-10-06 22:52:58 +02:00