Status update December 2020

During the slowest month of the year, I worked little on Cute Chess.

Over the years there has been a manual effort to have a consistent coding style in the Cute Chess project. The coding style is based on the Qt public API with some minor differences. To make following the coding style easier, I decided to create a configuration file for clang-format.

There are some 100 different configuration options available that change how source code is styled. A configuration generator, like clang-format generator, is a must. After a while you start to question your sanity and wonder how much humanity would have progressed if time wouldn’t be wasted on arguing about the correct position of the pointer asterisk.

Curiously, it was not possible to create a clang-format configuration that would match Cute Chess' current coding style. As an example, the current code base indents each access modifier (such as public) and then indents each method and variable under that access modifier. This type of configuration is not supported by clang-format.

In the end I took Qt’s clang-format configuration and tweaked it to create a set of rules that resembles our conventions more. I don’t plan formatting the current code base since it would result only in unnecessary diffs instead the plan is to use it for new code and rewritten modules.

That’s all I have for this month. See you next year!