Bug Tracker – Bug 875

Cleanup source with Artistic Style

Last modified: 2020-04-12 17:44:17 UTC
Bug 875 - Cleanup source with Artistic Style
Summary: Cleanup source with Artistic Style
Status: NEW
Alias: None
Product: Odamex
Classification: Unclassified
Component: Server & Client (show other bugs)
Version: (old) 0.6-dev
Hardware: All All
: P1 enhancement
Assignee: Odamex Bug Reporter
Depends on:
Reported: 2012-07-15 17:09 UTC by Alexander Mayfield
Modified: 2020-04-12 17:44 UTC (History)
2 users (show)

See Also:


Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Mayfield 2012-07-15 17:09:49 UTC
Quoth the website: "Artistic Style is a source code indenter, formatter, and beautifier for the C, C++, C# and Java programming languages."  Right now, our source tree contains many different source formatting styles.  This program can be used to clean things up.

Here is a config file that I came up with that mirrors our own code formatting guidelines:


We can keep these settings in a file called astylerc in the root of our source tree.

However, this cleanup is not something we should do lightly.  If anyone has any outstanding patches, they will be much more difficult to apply after the cleanup.  There is also the small possibility that this cleanup might break functioning code for some obscure reason, so we ought to heavily test the result.
Comment 1 Russell Rice 2012-07-16 04:01:26 UTC
Just as a note, there is an AStyle plugin that comes with codeblocks too
Comment 2 Alexander Mayfield 2020-04-12 17:41:43 UTC
I would still very much be interested in pursuing this.

The only thing about the suggestion I would change is that I think that using clang-format would be a better idea.  It piggybacks off of an existing compiler, so it has the least chance of breaking everybody's code.
Comment 3 Alexander Mayfield 2020-04-12 17:44:17 UTC
Also, I think that this style should be applied to the entire source tree on a certain "flag day" to ensure consistency.  We should probably wait until there are not many big outstanding branches, and once they're all merged in, we format the entire source tree.