Make the code follow the new code guidelines. #2192
Comments
@pmzqla, I think you said you used |
Here it is. It's not complete, I have added options whenever I noticed something wasn't following the guidelines, but it's a good start. |
+1 |
I added some new rules and I deleted one. Anyone using it, should use a commit message of |
Here is Qt Creator config file posted by @Gelmir in this comment <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorCodeStyle>
<!-- Written by QtCreator 3.2.82, 2014-11-26T02:08:28. -->
<qtcreator>
<data>
<variable>CodeStyleData</variable>
<valuemap type="QVariantMap">
<value type="bool" key="AlignAssignments">true</value>
<value type="bool" key="AutoSpacesForTabs">false</value>
<value type="bool" key="BindStarToIdentifier">false</value>
<value type="bool" key="BindStarToLeftSpecifier">true</value>
<value type="bool" key="BindStarToRightSpecifier">false</value>
<value type="bool" key="BindStarToTypeName">true</value>
<value type="bool" key="ExtraPaddingForConditionsIfConfusingAlign">false</value>
<value type="bool" key="IndentAccessSpecifiers">false</value>
<value type="bool" key="IndentBlockBody">true</value>
<value type="bool" key="IndentBlockBraces">false</value>
<value type="bool" key="IndentBlocksRelativeToSwitchLabels">false</value>
<value type="bool" key="IndentClassBraces">false</value>
<value type="bool" key="IndentControlFlowRelativeToSwitchLabels">true</value>
<value type="bool" key="IndentDeclarationsRelativeToAccessSpecifiers">true</value>
<value type="bool" key="IndentEnumBraces">false</value>
<value type="bool" key="IndentFunctionBody">true</value>
<value type="bool" key="IndentFunctionBraces">false</value>
<value type="bool" key="IndentNamespaceBody">true</value>
<value type="bool" key="IndentNamespaceBraces">false</value>
<value type="int" key="IndentSize">4</value>
<value type="bool" key="IndentStatementsRelativeToSwitchLabels">true</value>
<value type="bool" key="IndentSwitchLabels">false</value>
<value type="int" key="PaddingMode">1</value>
<value type="bool" key="SpacesForTabs">true</value>
<value type="int" key="TabSize">4</value>
</valuemap>
</data>
<data>
<variable>DisplayName</variable>
<value type="QString">qBittorrent</value>
</data>
</qtcreator> |
Updated uncrustify file: https://gist.github.com/sledgehammer999/1cb1d9224d7fec8fa632 |
Update uncrustify config file: https://gist.github.com/sledgehammer999/1cb1d9224d7fec8fa632 |
--HG-- branch : magao-dev
--HG-- branch : magao-dev
--HG-- branch : magao-dev
--HG-- branch : magao-dev
--HG-- branch : magao-dev
--HG-- branch : magao-dev
--HG-- branch : magao-dev
--HG-- branch : magao-dev
--HG-- branch : magao-dev
--HG-- branch : magao-dev
--HG-- branch : magao-dev
I think this can be closed now. |
See #2091
And https://github.com/qbittorrent/qBittorrent/blob/master/CODING_GUIDELINES.md
This is tracking bug.
One suggestion is: Let's say you want to make a bug fix to main.cpp. You should first convert that file to use 4 spaces as indentation. Make a commit with the message
Follow project coding style. Issue #2192.
. Then do the bug fixing and make a new commit.Hint: If you set in Qt Creator as indentation 4 spaces. Then all you have to do is to select all the code in a particular file->right click->auto-indent.
Hint2: You can also use a tool called
uncrustify
. Here is the last working config(not complete): https://github.com/qbittorrent/qBittorrent/blob/master/uncrustify.cfgThe text was updated successfully, but these errors were encountered: