News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

Does anyone have a .clang-format file for Simutrans code?

Started by Matthew, February 23, 2020, 07:17:44 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Matthew

I am working through a C++ tutorial in the hope that one day in the (far!) future I might be able to contribute to Simutrans.

Visual Studio Code uses .clang-format files to automate code formatting. Is anyone already using such a file that fits Simutrans' coding style, please? It might help me get into good habits from the start. So far the closest I can find are the Google and Webkit styles, but both have spaces between function names and their parameters.
(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。

prissi

We discussed beatifying the code many times, but any automatic tends to fail a lot. But, more important, no patches would survive this (or is git clever enough to ignore all whitespace changes?)

During that discussion, I tried a lot of beatifier, but none could really do all the Simutrans formatting. I would be very much interested in a useful formatter. Unfortunately, at least my MSVC rather destroys my formatting, unless I switch it off.