forked from LuxCoreRender/BlendLuxCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a document explaining mandatory coding guidelines
- Loading branch information
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
The stuff in the code_style.md document should be followed, but it is ultimately just about | ||
the readability of the source code. | ||
The following is really important though. If these guidelines are not followed, it can cause | ||
massive problems - and not just now, but also years in the future. | ||
|
||
### Enums | ||
|
||
**Always** add an index for each element. | ||
If the index is missing, we can not reorder elements later and we can not rename identifiers | ||
without breaking old .blend files. | ||
|
||
Wrong: | ||
```python | ||
items = [ | ||
("first_item", "First Item", "This is the first item"), | ||
("second_item", "Second Item", "This is the second item"), | ||
] | ||
``` | ||
|
||
Correct: | ||
```python | ||
items = [ | ||
("first_item", "First Item", "This is the first item", 0), | ||
("second_item", "Second Item", "This is the second item", 1), | ||
] | ||
``` | ||
(note the 0 and 1 after the descriptions) |