You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+34-34Lines changed: 34 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,50 +6,50 @@ The OpenRGB project welcomes contributions from the community. The project woul
6
6
7
7
To create a merge request, log into GitLab and fork the OpenRGB project. Push your changes to your fork and then use the Create Merge Request option. Before opening a merge request, please review the following best practices to help your merge request get merged without excessive delay.
8
8
9
-
* Please keep the scope of each merge request limited to one functional area. If you wish to add a new device controller, for instance, don't also do code cleanup in another controller as part of the same merge request.
10
-
* Explain what your merge request is changing, why you feel the change is necessary, and add any additional information you feel is needed to best understand your change in the merge request description.
11
-
* Mark your merge request as a draft (start title with "Draft:") until it has been tested and verified working.
12
-
* Follow the Style Guidelines below when making your code changes.
13
-
* Avoid using `git merge` when updating your fork. The OpenRGB project uses a linear git history, meaning all changes are rebased onto the tip of master. By using `git rebase` to update your fork, you will make it easier to accept merge requests.
9
+
* Please keep the scope of each merge request limited to one functional area. If you wish to add a new device controller, for instance, don't also do code cleanup in another controller as part of the same merge request.
10
+
* Explain what your merge request is changing, why you feel the change is necessary, and add any additional information you feel is needed to best understand your change in the merge request description.
11
+
* Mark your merge request as a draft (start title with "Draft:") until it has been tested and verified working.
12
+
* Follow the Style Guidelines below when making your code changes.
13
+
* Avoid using `git merge` when updating your fork. The OpenRGB project uses a linear git history, meaning all changes are rebased onto the tip of master. By using `git rebase` to update your fork, you will make it easier to accept merge requests.
14
14
15
15
## Style Guidelines
16
16
17
17
OpenRGB is written in C++, uses the Qt framework for UI, and uses the QMake build system. While OpenRGB does use C++, I am primarily a C programmer and prefer doing things "C Style" vs. C++ style. C++'s object oriented programming features fit the needs of a program such as OpenRGB where there are many implementations of a single interface so I chose to write it in C++ over C. Still, however, I prefer using C-style code where possible. When making changes to existing code files, try to follow the existing style. Merge requests that go out of their way to restyle code will not be accepted and will be sent back for rework.
18
18
19
19
### Functional Style
20
20
21
-
* Limit use of C++ std library data types
22
-
* For fixed-length containers, use C arrays
23
-
* For list constants, use const C arrays
24
-
* For fixed-length strings, use C char buffers ("C strings"), though using std::string is acceptable if the value will be placed in a std::string
25
-
* For basic types, prefer using the non-typedef'd basic types (char, short, int, etc) over typedef'd (uint8_t, uint16_t, uint32_t, etc)
26
-
* Unless defined in an OpenRGB API or the file is implementing an existing API using these types (such as i2c_smbus)
27
-
* For hard-coded values, use `#define`s over const variables unless you need a pointer to the value
28
-
* For variable-length containers, use std::vector
29
-
* For variable-length strings, use std::string
30
-
* `struct` should not include any functions, only variables
31
-
* `class` should only be used for objects containing functions
32
-
* Other std types may be used sparingly if necessary
33
-
* Only use Qt libraries, types, and functionality in user interface files
34
-
* Anything under the qt/ folder basically
35
-
* Do not use QDebug, use our LogManager instead. If you use QDebug during development, please remove it before submitting your merge request
36
-
* Use C-style indexed for loops when iterating through an array or vector
37
-
* Use C-style casts unless necessary
38
-
* Avoid the `auto` type. It makes code more difficult to read
39
-
* Do not use `printf` or `cout` for debug messages, use LogManager instead
40
-
* Don't define namespaces unless necessary
21
+
* Limit use of C++ std library data types
22
+
* For fixed-length containers, use C arrays
23
+
* For list constants, use const C arrays
24
+
* For fixed-length strings, use C char buffers ("C strings"), though using std::string is acceptable if the value will be placed in a std::string
25
+
* For basic types, prefer using the non-typedef'd basic types (char, short, int, etc) over typedef'd (uint8_t, uint16_t, uint32_t, etc)
26
+
* Unless defined in an OpenRGB API or the file is implementing an existing API using these types (such as i2c_smbus)
27
+
* For hard-coded values, use `#define`s over const variables unless you need a pointer to the value
28
+
* For variable-length containers, use std::vector
29
+
* For variable-length strings, use std::string
30
+
*`struct` should not include any functions, only variables
31
+
*`class` should only be used for objects containing functions
32
+
* Other std types may be used sparingly if necessary
33
+
* Only use Qt libraries, types, and functionality in user interface files
34
+
* Anything under the qt/ folder basically
35
+
* Do not use QDebug, use our LogManager instead. If you use QDebug during development, please remove it before submitting your merge request
36
+
* Use C-style indexed for loops when iterating through an array or vector
37
+
* Use C-style casts unless necessary
38
+
* Avoid the `auto` type. It makes code more difficult to read
39
+
* Do not use `printf` or `cout` for debug messages, use LogManager instead
40
+
* Don't define namespaces unless necessary
41
41
42
42
### Non-functional Style
43
43
44
-
* Set your editor's tab settings to insert spaces, using 4 spaces per tab stop
45
-
* Always put opening and closing braces `{`, `}` on their own lines
46
-
* Indent code inside the braces, do not indent the braces themselves
47
-
* Capitalize hexadecimal literals (`0xFF` not `0xff`) except in the udev rules file (which must be lowercase to work)
48
-
* No space between keyword and open parenthesis (`if(TRUE)` not `if (TRUE)`). There are some instances of this that haven't been cleaned up in the code.
49
-
* Generally, `snake_case` is used for variable names and `CamelCase` is used for function and class names
50
-
* Add a header comment to new files with the filename, description, original author, and date (this is missing on most Detect files)
51
-
* Line up `=` when doing a lot of assignments together
52
-
* Use this comment box style when adding comments:
44
+
* Set your editor's tab settings to insert spaces, using 4 spaces per tab stop
45
+
* Always put opening and closing braces `{`, `}` on their own lines
46
+
* Indent code inside the braces, do not indent the braces themselves
47
+
* Capitalize hexadecimal literals (`0xFF` not `0xff`) except in the udev rules file (which must be lowercase to work)
48
+
* No space between keyword and open parenthesis (`if(TRUE)` not `if (TRUE)`). There are some instances of this that haven't been cleaned up in the code.
49
+
* Generally, `snake_case` is used for variable names and `CamelCase` is used for function and class names
50
+
* Add a header comment to new files with the filename, description, original author, and date (this is missing on most Detect files)
51
+
* Line up `=` when doing a lot of assignments together
52
+
* Use this comment box style when adding comments:
Copy file name to clipboardExpand all lines: README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -162,6 +162,7 @@ There have been two instances of hardware damage in OpenRGB's development and we
162
162
163
163
* Want to contribute support for a new device? Check out the [RGBController API](https://gitlab.com/CalcProgrammer1/OpenRGB/-/wikis/The-RGBController-API) page for documentation of how OpenRGB implements device control.
164
164
* Want to create a new OpenRGB SDK client implementation? Check out the [OpenRGB SDK Documentation](https://gitlab.com/CalcProgrammer1/OpenRGB/-/wikis/OpenRGB-SDK-Documentation) page for documentation of how the OpenRGB SDK network protocol functions.
165
+
* Please read the [Contributing Guidelines](https://gitlab.com/CalcProgrammer1/OpenRGB/-/blob/master/CONTRIBUTING.md) before starting work on your new changes.
0 commit comments