mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-01 22:30:42 -07:00
Update CONTRIBUTING.md
This commit is contained in:
+42
-1
@@ -29,6 +29,47 @@ Lastly, watch out for legacy OS compatibility. Currently, the minimum support fl
|
|||||||
* Make sure you compile with the included Docker script and ensure you do not introduce **any** new compiler warnings or build breaks. The Docker script is the standard build environment, your custom Linux build environment or MSVC can be used during development, but you must validate the final build using Docker.
|
* Make sure you compile with the included Docker script and ensure you do not introduce **any** new compiler warnings or build breaks. The Docker script is the standard build environment, your custom Linux build environment or MSVC can be used during development, but you must validate the final build using Docker.
|
||||||
* Do not submit snippets of code as a "patch". Exceptions can be made for trivial changes (correct a typo, fix a single line of code...), but otherwise, a successfully compiled & fully tested patch file is required when submitting for review.
|
* Do not submit snippets of code as a "patch". Exceptions can be made for trivial changes (correct a typo, fix a single line of code...), but otherwise, a successfully compiled & fully tested patch file is required when submitting for review.
|
||||||
* Do not make code changes in unrelated areas; i.e., do not run code linters and auto-formatters for parts of the code that you didn't modify.
|
* Do not make code changes in unrelated areas; i.e., do not run code linters and auto-formatters for parts of the code that you didn't modify.
|
||||||
* Note: there are no strict rules for code formatting, but please attempt to emulate the style around the code you are modifying.
|
|
||||||
* Try to submit smaller chunks of code, instead one gigantic patch. For example, don't submit a patch for "Improve feature XYZ"; instead, submit "Change how A works to prepare for feature XYZ" "Refactor B for feature XYZ" "Add feature B to enable feature XYZ".
|
* Try to submit smaller chunks of code, instead one gigantic patch. For example, don't submit a patch for "Improve feature XYZ"; instead, submit "Change how A works to prepare for feature XYZ" "Refactor B for feature XYZ" "Add feature B to enable feature XYZ".
|
||||||
* Write to the log for anything useful - it helps immensely with debugging post-mortem. At the same time though, avoid spamming the log for something trivial.
|
* Write to the log for anything useful - it helps immensely with debugging post-mortem. At the same time though, avoid spamming the log for something trivial.
|
||||||
|
|
||||||
|
### Code style requirements
|
||||||
|
* Indents are four spaces.
|
||||||
|
* Always use \{ curly braces \} when appropriate; do not omit them even when it's optional; such as `for` `if` `else`, etc.
|
||||||
|
|
||||||
|
OK:
|
||||||
|
```c
|
||||||
|
if (conditional) {
|
||||||
|
DoSomething();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Not OK:
|
||||||
|
```c
|
||||||
|
if (conditional)
|
||||||
|
DoSomething();
|
||||||
|
```
|
||||||
|
|
||||||
|
Not OK:
|
||||||
|
```c
|
||||||
|
if (conditional) DoSomething();
|
||||||
|
```
|
||||||
|
|
||||||
|
* Opening curly braces should appear at the end, not in a line on its own.
|
||||||
|
|
||||||
|
OK:
|
||||||
|
```c
|
||||||
|
if (conditional) {
|
||||||
|
DoSomething();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Not OK:
|
||||||
|
```c
|
||||||
|
if (conditional)
|
||||||
|
{
|
||||||
|
DoSomething();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
* Other than that, there are no strict rules for code formatting, but please attempt to emulate the style around the code you are modifying.
|
||||||
|
|||||||
Reference in New Issue
Block a user