New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the code follow the new code guidelines. #2192

Closed
sledgehammer999 opened this Issue Nov 22, 2014 · 10 comments

Comments

Projects
None yet
4 participants
@sledgehammer999
Contributor

sledgehammer999 commented Nov 22, 2014

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.cfg

@sledgehammer999

This comment has been minimized.

Contributor

sledgehammer999 commented Nov 23, 2014

@pmzqla, I think you said you used uncrustify. Can you share your working configuration here for others to have easy access to?

@pmzqla

This comment has been minimized.

Contributor

pmzqla commented Nov 23, 2014

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.

@sledgehammer999

This comment has been minimized.

Contributor

sledgehammer999 commented Nov 23, 2014

+1

@sledgehammer999

This comment has been minimized.

Contributor

sledgehammer999 commented Nov 25, 2014

I added some new rules and I deleted one.
Here is an updated config file: https://gist.github.com/sledgehammer999/1cb1d9224d7fec8fa632
uncrustify configuration docs: https://github.com/bengardner/uncrustify/blob/master/documentation/htdocs/config.txt

Anyone using it, should use a commit message of Follow project coding style. Issue #2192. instead.

@sledgehammer999

This comment has been minimized.

Contributor

sledgehammer999 commented Nov 25, 2014

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>

Gelmir added a commit to Gelmir/qBittorrent that referenced this issue Nov 29, 2014

@sledgehammer999

This comment has been minimized.

Contributor

sledgehammer999 commented Nov 29, 2014

sledgehammer999 added a commit that referenced this issue Dec 7, 2014

@sledgehammer999

This comment has been minimized.

Contributor

sledgehammer999 commented Dec 7, 2014

pmzqla added a commit to pmzqla/qBittorrent that referenced this issue Dec 7, 2014

buinsky added a commit to buinsky/qBittorrent that referenced this issue Dec 7, 2014

buinsky added a commit to buinsky/qBittorrent that referenced this issue Dec 7, 2014

zeule added a commit to zeule/qBittorrent that referenced this issue May 22, 2017

zeule added a commit to zeule/qBittorrent that referenced this issue May 26, 2017

zeule added a commit to zeule/qBittorrent that referenced this issue May 27, 2017

zeule added a commit to zeule/qBittorrent that referenced this issue May 29, 2017

zeule added a commit to zeule/qBittorrent that referenced this issue May 30, 2017

sledgehammer999 added a commit to sledgehammer999/qBittorrent that referenced this issue May 30, 2017

sledgehammer999 added a commit to sledgehammer999/qBittorrent that referenced this issue May 30, 2017

sledgehammer999 added a commit to sledgehammer999/qBittorrent that referenced this issue May 30, 2017

sledgehammer999 added a commit to sledgehammer999/qBittorrent that referenced this issue May 30, 2017

sledgehammer999 added a commit to sledgehammer999/qBittorrent that referenced this issue May 30, 2017

sledgehammer999 added a commit to sledgehammer999/qBittorrent that referenced this issue May 30, 2017

sledgehammer999 added a commit that referenced this issue May 30, 2017

zeule added a commit to zeule/qBittorrent that referenced this issue Jul 3, 2017

zeule added a commit to zeule/qBittorrent that referenced this issue Jul 3, 2017

zeule added a commit to zeule/qBittorrent that referenced this issue Jul 4, 2017

zeule added a commit to zeule/qBittorrent that referenced this issue Jul 15, 2017

zeule added a commit to zeule/qBittorrent that referenced this issue Jul 17, 2017

silverqx added a commit to silverqx/qBittorrent that referenced this issue Sep 11, 2017

silverqx added a commit to silverqx/qBittorrent that referenced this issue Sep 24, 2017

zeule added a commit to zeule/qBittorrent that referenced this issue Sep 25, 2017

zeule added a commit to zeule/qBittorrent that referenced this issue Sep 25, 2017

zeule added a commit to zeule/qBittorrent that referenced this issue Oct 8, 2017

zeule added a commit to zeule/qBittorrent that referenced this issue Oct 10, 2017

zeule added a commit to zeule/qBittorrent that referenced this issue Oct 10, 2017

zeule added a commit to zeule/qBittorrent that referenced this issue Oct 10, 2017

zeule added a commit to zeule/qBittorrent that referenced this issue Oct 10, 2017

sledgehammer999 added a commit that referenced this issue Oct 23, 2017

sledgehammer999 added a commit that referenced this issue Oct 23, 2017

Follow project coding style. Issue #2192.
--HG--
branch : magao-dev
@thalieht

This comment has been minimized.

Contributor

thalieht commented Sep 17, 2018

I think this can be closed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment