diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2017-12-21 17:52:56 +0100 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2017-12-21 17:52:56 +0100 |
commit | cf06dcb0650f603ae3d634634d81f9ec78d21937 (patch) | |
tree | 07b6aff6426ba091cd5b1a90832527d651101ac6 /docs/manual/Contributing.md | |
parent | Added Search Box (diff) | |
download | smolbote-cf06dcb0650f603ae3d634634d81f9ec78d21937.tar.xz |
Edited documentation
- Search highlighting is removed when you close the search box
- Fixed PKGBUILD not working
- PKGBUILD can now pick compiler and optimization
Diffstat (limited to 'docs/manual/Contributing.md')
-rw-r--r-- | docs/manual/Contributing.md | 80 |
1 files changed, 79 insertions, 1 deletions
diff --git a/docs/manual/Contributing.md b/docs/manual/Contributing.md index 854139a..ff8e2b2 100644 --- a/docs/manual/Contributing.md +++ b/docs/manual/Contributing.md @@ -1 +1,79 @@ -# Contributing +# Code style + +## Guidelines +* Use generic formats + +## Versioning +- major version: Changed infrequently and almost entirely out of foppery and whim. +- minor version: Milestone of multiple features. +- revision: Major bugfixes and each new feature should get a revision. + +## Qt +* Check pointers with ´´´Q_CHECK_PTR´´´ before using or returning them. +* Avoid using connect SIGNAL and SLOT. Instead use &Class::method. This way, connects are checked during the compile, not at runtime. +* Where possible, use QVector over QList: http://lists.qt-project.org/pipermail/development/2017-March/029040.html + +## clazy +You can use [clazy](https://github.com/KDE/clazy) to check Qt semantics. +Requires clang. + +To set check levels, set the CLAZY_CHECKS environment variable to 'level0,level1', etc. + +### Setting up in QtCreator +The simplest way to set it up is to use _clazy_ instead of _clang_. + +1. Go to Tools » Options » Build & Run » Compilers +2. Clone the clang compiler of your choice +3. Set _Compiler path_ to _/usr/bin/clazy_ + +This will update the qbs profile that QtCreator uses. + +### Reducing clazy noise +If you want to suppress warnings from headers of Qt or 3rd party code, include +them with -isystem instead of -I. To do this, you have to +[modify your Qt profile](clazy-sysincludes) like this: + +Find the profile's search path: +```sh +$ qbs config --list profiles.qt562.preferences +profiles.qt562.preferences.qbsSearchPaths: "/home/someone/.config/QtProject/qbs/1.9.0/profiles/qt562" +``` + +Replace cpp.includePaths with cpp.systemIncludePaths in the Qt modules of that profile: + +```sh +$ find /home/someone/.config/QtProject/qbs/1.9.0/profiles/qt562/modules/Qt/ -name '*.qbs' | xargs -n1 sed -i s/cpp\.includePaths/cpp.systemIncludePaths/ +``` + +[clazy-sysincludes]: http://lists.qt-project.org/pipermail/qbs/2017-April/001709.html + +# Before you submit + +## Licensing +Smolbote is licensed under GPLv3 _only_. Your code needs to be compatible with +it, and have a license header in the style used by the project. + +### SPDX-License-Identifier +A full list of license identifiers can be found on [the SPDX website](https://spdx.org/licenses/). + +## Style +Please use the [One True Brace style](https://en.wikipedia.org/wiki/Indent_style#Variant:_1TBS_.28OTBS.29). +Tabs are 4 spaces. + +For ease of use, you can set the following astyle configuration: +``` +--style=otbs +--attach-namespaces +--attach-inlines +--indent=spaces=4 +``` + +## Format patch for email +```sh +git format-patch hash +``` +where _hash_ is the commit immediately prior to the commit or series of commits +you want to submit. + +Attach the patch file and email it to _aqua at iserlohn-fortress.net_. If +possible, GPG sign the email. |