Commit Graph

11 Commits

Author SHA1 Message Date
Ted John eab255c4bf
Add Linux portable to GitHub CI (#10612) 2020-01-24 11:46:12 +00:00
Ted John a863c7ae50 Remove rest of FOR_ALL_RIDES instances 2019-08-04 16:44:17 +01:00
clang-format d787872cbe Indent preprocessor directives 2018-07-23 16:00:23 +02:00
clang-format b02dfdbc93 Binpack function arguments together
Previously when the arguments of a function wouldn't fit on a single line, clang-format would put each argument on its own line instead. By enabling the binpack parameter setting, it tried to fit as many on one line as possible instead.

Co-authored-by: Hielke Morsink <hielke.morsink@gmail.com>
2018-07-23 16:00:22 +02:00
clang-format 95ce592579 Enforce not breaking before assignments and function names
Co-authored-by: Hielke Morsink <hielke.morsink@gmail.com>
2018-07-23 16:00:19 +02:00
Hielke Morsink 5e0aa9039f Update clang-format rules
Indent namespaces
disallowing short case blocks on a single line
enable for Objective C files too
2018-07-23 15:58:00 +02:00
Michał Janiszewski 5d102fd40b Sync clang-format with OpenLoco
- The formatting properties for JavaScript and ObjectiveC have been removed, since "Language: Cpp" is set.
- Remove CommentPragmas - its value doen't apply to our coding style.
- ForEachMacros have been replaced with entries for our own foreach loops.
- Includes age grouped together (unless there's a comment inbetween), with the 'main' include at the top, then local includes "", and finally system includes <>, with an empty line inbetween each group.
- Disable bin-packing of function arguments
- NamespaceIndentation set to 'None'.
- KeepEmptyLinesAtTheStartOfBlocks set to 'false'.
- IndentWrappedFunctionNames set to 'true'.
- Never allow short functions to be on a single line, and remove unnecessary rule for tab width since we don't use tabs.

These changes will need to be synced with OpenLoco.
2018-05-05 14:46:35 +02:00
Michał Janiszewski d253588549 Break overlong function declarations
Before:
```diff
-static void large_scenery_paint_supports(paint_session * session, uint8 direction, uint16 height, rct_tile_element *tileElement, uint32 dword_F4387C, rct_large_scenery_tile *tile)
+static void large_scenery_paint_supports(paint_session * session, uint8 direction, uint16 height,
+                                         rct_tile_element * tileElement, uint32 dword_F4387C, rct_large_scenery_tile * tile)
-static rct_large_scenery_text_glyph *large_scenery_sign_get_glyph(rct_large_scenery_text *text, uint32 codepoint)
+static rct_large_scenery_text_glyph * large_scenery_sign_get_glyph(rct_large_scenery_text * text, uint32 codepoint)
```

After:
```diff
-static void large_scenery_paint_supports(paint_session * session, uint8 direction, uint16 height, rct_tile_element *tileElement, uint32 dword_F4387C, rct_large_scenery_tile *tile)
+static void large_scenery_paint_supports(
+    paint_session *          session,
+    uint8                    direction,
+    uint16                   height,
+    rct_tile_element *       tileElement,
+    uint32                   dword_F4387C,
+    rct_large_scenery_tile * tile)
-static rct_large_scenery_text_glyph *large_scenery_sign_get_glyph(rct_large_scenery_text *text, uint32 codepoint)
+static rct_large_scenery_text_glyph * large_scenery_sign_get_glyph(rct_large_scenery_text * text, uint32 codepoint)
```

[ci skip]
2018-01-18 00:13:55 +00:00
Hielke Morsink 307745dd86 clang-format: better pattern for common.h
[ci skip]
2017-01-14 18:48:11 +00:00
Hielke Morsink a36b200dda Add include categories to .clang-format
This adds 3 rules that clang-format uses when ordering include files:
 - common.h is assigned priority -1
 - Incudes using <> is given priority 1
 - Includes using "" is given priority 2

It also disables putting the "main" file first (the .h/.hpp with the
same name as the .c/.cpp"

#5074
[ci skip]
2017-01-14 18:30:48 +00:00
Michał Janiszewski 46fbac9564 Add .clang-format style file (#4836)
[ci skip]
2016-11-30 19:01:02 +01:00