1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 07:44:59 +00:00

Documentation: Recommend CLion code style settings over manual steps

Changing the naming conventions one-by-one was tedious and error-prone.
A settings file is likely to be more forward compatible than a
screenshot. The settings file was made by repeating the manual steps
provided in the documentation, and exporting the file in CLion.
This commit is contained in:
Andreas Oppebøen 2022-11-25 00:03:57 +01:00 committed by Linus Groh
parent babfc13c84
commit eb44a90e62
3 changed files with 31 additions and 7 deletions

View file

@ -0,0 +1,29 @@
<code_scheme name="Project" version="173">
<Objective-C>
<option name="TYPE_QUALIFIERS_PLACEMENT" value="AFTER" />
</Objective-C>
<Objective-C-extensions>
<option name="TYPE_QUALIFIERS_PLACEMENT" value="AFTER" />
<rules>
<rule entity="NAMESPACE" visibility="ANY" specifier="ANY" prefix="" style="PASCAL_CASE" suffix="" />
<rule entity="MACRO" visibility="ANY" specifier="ANY" prefix="" style="SCREAMING_SNAKE_CASE" suffix="" />
<rule entity="CLASS" visibility="ANY" specifier="ANY" prefix="" style="PASCAL_CASE" suffix="" />
<rule entity="STRUCT" visibility="ANY" specifier="ANY" prefix="" style="PASCAL_CASE" suffix="" />
<rule entity="ENUM" visibility="ANY" specifier="ANY" prefix="" style="PASCAL_CASE" suffix="" />
<rule entity="ENUMERATOR" visibility="ANY" specifier="ANY" prefix="" style="PASCAL_CASE" suffix="" />
<rule entity="TYPEDEF" visibility="ANY" specifier="ANY" prefix="" style="SNAKE_CASE" suffix="" />
<rule entity="UNION" visibility="ANY" specifier="ANY" prefix="" style="SNAKE_CASE" suffix="" />
<rule entity="CLASS_MEMBER_FUNCTION" visibility="ANY" specifier="ANY" prefix="" style="SNAKE_CASE" suffix="" />
<rule entity="STRUCT_MEMBER_FUNCTION" visibility="ANY" specifier="ANY" prefix="" style="SNAKE_CASE" suffix="" />
<rule entity="CLASS_MEMBER_FIELD" visibility="ANY" specifier="ANY" prefix="" style="SNAKE_CASE" suffix="" />
<rule entity="STRUCT_MEMBER_FIELD" visibility="ANY" specifier="ANY" prefix="" style="SNAKE_CASE" suffix="" />
<rule entity="GLOBAL_FUNCTION" visibility="ANY" specifier="ANY" prefix="" style="SNAKE_CASE" suffix="" />
<rule entity="GLOBAL_VARIABLE" visibility="ANY" specifier="ANY" prefix="" style="SNAKE_CASE" suffix="" />
<rule entity="PARAMETER" visibility="ANY" specifier="ANY" prefix="" style="SNAKE_CASE" suffix="" />
<rule entity="LOCAL_VARIABLE" visibility="ANY" specifier="ANY" prefix="" style="SNAKE_CASE" suffix="" />
</rules>
</Objective-C-extensions>
<clangFormatSettings>
<option name="ENABLED" value="true" />
</clangFormatSettings>
</code_scheme>

View file

@ -48,13 +48,8 @@ A symptom of this not being configured correctly is CLion giving a warning for e
## Code Generation Settings ## Code Generation Settings
To make code generated by CLion (e.g. identifier names, const placement) match the SerenityOS coding style, change the To make code generated by CLion match the SerenityOS coding style, import the `CLionCodeSyleSettings.xml` from this directory as code style scheme via
following options under `Settings -> Editor -> Code Style -> C/C++`: `Settings -> Editor -> Code Style -> C/C++ -> Scheme -> Cog icon -> Import Scheme...`
- On the `Code Generation` tab set `const/volatile qualifier placement` to `int const x = 0`
- On the `Naming Convention` tab, select the following:
![Screenshot of Naming Convention settings](./CLion_Naming_Convention.png)
## Quick switching between Kernel and Userland targets ## Quick switching between Kernel and Userland targets

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB