:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:
The following is a set of guidelines for contributing to KeePassXC on GitHub. These are just guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
What should I know before I get started?
Source: Version 0.3, 2015–11–18
We will accept contributions of good code that we can use from anyone.
If we reject your contribution, it means only that we do not consider it suitable for our project in the form it was submitted. It is not personal. If you ask civilly, we will be happy to discuss it with you and help you understand why it was rejected, and if possible improve it so we can accept it.
We're always looking for suggestions to improve our application. If you have a suggestion to improve an existing feature, or would like to suggest a completely new feature for KeePassXC, please use the issue tracker on GitHub.
Our software isn't always perfect, but we strive to always improve our work. You may file bug reports in the issue tracker.
Before submitting a bug report, check if the problem has already been reported. Please refrain from opening a duplicate issue. If you want to add further information to an existing issue, simply add a comment on that issue.
As with feature requests, you can talk to the KeePassXC team about bugs, new features, other issues and pull requests on the dedicated issue tracker, on the Matrix development channel, or in the IRC channel on Libera.Chat (#keepassxc-dev
on irc.libera.chat
, or use a webchat link).
Unsure where to begin contributing to KeePassXC? You can start by looking through these beginner
and help-wanted
issues:
beginner
issues.Both issue lists are sorted by total number of comments. While not perfect, looking at the number of comments on an issue can give a general idea of how much an impact a given change will have.
Along with our desire to hear your feedback and suggestions, we're also interested in accepting direct assistance in the form of code.
All pull requests must comply with the above requirements and with the styleguides.
Translations are managed on Transifex which offers a web interface. Please join an existing language team or request a new one if there is none.
If you open a Pull Request with new strings that require translations, you will need to run the following:
./release-tool i18n lupdate
This will make the new strings available for translation in Transifex.
The Branch Strategy is based on git-flow-lite.
Note: The latest tag is used to point to the most recent stable release.
The coding style of the project is enforced using llvm's clang-format
formatting tool. A thorough description
of the coding style can be found in the .clang-format
file, but the main conventions are presented here.
Formatting can be performed automatically by calling make format
from the build/
directory.
Note that formatting can be disabled on a piece of code if manual formatting is deemed more readable.
lowerCamelCase
For names made of only one word, the first letter should be lowercase. For names made of multiple concatenated words, the first letter of the whole is lowercase, and the first letter of each subsequent word is capitalized.
For C++ files (.cpp .h): 4 spaces For Qt-UI files (.ui): 2 spaces
// Class includes
#include "MyWidget.h"
#include "ui_MyWidget.h"
// Application includes
#include "core/Config.h"
#include "core/Resources.h"
// Global includes
#include <QWidget>
#include <stdin>
// Note: order is important, stay organized!
class MyWidget : public QWidget
{
Q_OBJECT
public:
explicit MyWidget(QWidget* parent);
~MyWidget() override;
signals:
void alert();
public slots:
void processEvent(Event* event);
private slots:
void myEvent(Event* event);
private:
const QScopedPointer<Ui::MyWidget> m_ui;
int m_counter;
};
// Note: alignment of variable initialization
MyWidget::MyWidget(QWidget* parent)
: QWidget(parent)
, m_ui(new Ui::MyWidget())
{
}
int* count;
const QString& string;
if (condition) {
doSomething();
} else {
doSomethingElse();
}
void ExampleClass::exampleFunction()
{
doSomething();
}
// Note: avoid declaring variables in a switch statement
switch (a) {
case 1:
doSomething();
break;
// Note: use braces if necessary
default: {
doSomethingElse();
break;
}
}
Use prefix: m_*
Example: m_variable
Widget names must be related to the desired program behavior, and preferably end with the widget's classname.
Example: <widget class="QCheckBox" name="rememberCheckBox">