Skip to content

Commit eb44a90

Browse files
andreaolinusg
authored andcommitted
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.
1 parent babfc13 commit eb44a90

File tree

3 files changed

+31
-7
lines changed

3 files changed

+31
-7
lines changed
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<code_scheme name="Project" version="173">
2+
<Objective-C>
3+
<option name="TYPE_QUALIFIERS_PLACEMENT" value="AFTER" />
4+
</Objective-C>
5+
<Objective-C-extensions>
6+
<option name="TYPE_QUALIFIERS_PLACEMENT" value="AFTER" />
7+
<rules>
8+
<rule entity="NAMESPACE" visibility="ANY" specifier="ANY" prefix="" style="PASCAL_CASE" suffix="" />
9+
<rule entity="MACRO" visibility="ANY" specifier="ANY" prefix="" style="SCREAMING_SNAKE_CASE" suffix="" />
10+
<rule entity="CLASS" visibility="ANY" specifier="ANY" prefix="" style="PASCAL_CASE" suffix="" />
11+
<rule entity="STRUCT" visibility="ANY" specifier="ANY" prefix="" style="PASCAL_CASE" suffix="" />
12+
<rule entity="ENUM" visibility="ANY" specifier="ANY" prefix="" style="PASCAL_CASE" suffix="" />
13+
<rule entity="ENUMERATOR" visibility="ANY" specifier="ANY" prefix="" style="PASCAL_CASE" suffix="" />
14+
<rule entity="TYPEDEF" visibility="ANY" specifier="ANY" prefix="" style="SNAKE_CASE" suffix="" />
15+
<rule entity="UNION" visibility="ANY" specifier="ANY" prefix="" style="SNAKE_CASE" suffix="" />
16+
<rule entity="CLASS_MEMBER_FUNCTION" visibility="ANY" specifier="ANY" prefix="" style="SNAKE_CASE" suffix="" />
17+
<rule entity="STRUCT_MEMBER_FUNCTION" visibility="ANY" specifier="ANY" prefix="" style="SNAKE_CASE" suffix="" />
18+
<rule entity="CLASS_MEMBER_FIELD" visibility="ANY" specifier="ANY" prefix="" style="SNAKE_CASE" suffix="" />
19+
<rule entity="STRUCT_MEMBER_FIELD" visibility="ANY" specifier="ANY" prefix="" style="SNAKE_CASE" suffix="" />
20+
<rule entity="GLOBAL_FUNCTION" visibility="ANY" specifier="ANY" prefix="" style="SNAKE_CASE" suffix="" />
21+
<rule entity="GLOBAL_VARIABLE" visibility="ANY" specifier="ANY" prefix="" style="SNAKE_CASE" suffix="" />
22+
<rule entity="PARAMETER" visibility="ANY" specifier="ANY" prefix="" style="SNAKE_CASE" suffix="" />
23+
<rule entity="LOCAL_VARIABLE" visibility="ANY" specifier="ANY" prefix="" style="SNAKE_CASE" suffix="" />
24+
</rules>
25+
</Objective-C-extensions>
26+
<clangFormatSettings>
27+
<option name="ENABLED" value="true" />
28+
</clangFormatSettings>
29+
</code_scheme>

Documentation/CLionConfiguration.md

+2-7
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,8 @@ A symptom of this not being configured correctly is CLion giving a warning for e
4848
4949
## Code Generation Settings
5050

51-
To make code generated by CLion (e.g. identifier names, const placement) match the SerenityOS coding style, change the
52-
following options under `Settings -> Editor -> Code Style -> C/C++`:
53-
54-
- On the `Code Generation` tab set `const/volatile qualifier placement` to `int const x = 0`
55-
- On the `Naming Convention` tab, select the following:
56-
57-
![Screenshot of Naming Convention settings](./CLion_Naming_Convention.png)
51+
To make code generated by CLion match the SerenityOS coding style, import the `CLionCodeSyleSettings.xml` from this directory as code style scheme via
52+
`Settings -> Editor -> Code Style -> C/C++ -> Scheme -> Cog icon -> Import Scheme...`
5853

5954
## Quick switching between Kernel and Userland targets
6055

-41.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)