-
Notifications
You must be signed in to change notification settings - Fork 752
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial draft of contributing guide #1787
base: unstable
Are you sure you want to change the base?
Conversation
Signed-off-by: Madelyn Olson <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## unstable #1787 +/- ##
============================================
+ Coverage 71.09% 71.18% +0.09%
============================================
Files 123 123
Lines 65552 65641 +89
============================================
+ Hits 46604 46728 +124
+ Misses 18948 18913 -35 |
Signed-off-by: Madelyn Olson <[email protected]>
Use a consistent set of licenses for Valkey files. I took a look and applied sort of a "did we make a material change in this file?" and tried to be conservative in adding the trademark. We could also be liberal as well. Resolves: #1692. Included documentation about the licensing here: #1787. Licenses are now also always explicitly first, even about documentation files. Signed-off-by: Madelyn Olson <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall.
Most of the style guidelines are enforced by clang format, but some additional comments are included here. | ||
|
||
1. C style comments `/* comment */` can be used for both single and multi-line comments. C++ comments `//` can only be used for single line comments. | ||
1. Generally keep line lengths below 90 characters, however there is no explicit line length enforcement. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we landed on 120'ish previously but I am personally more in favor of 90 .
|
||
1. C style comments `/* comment */` can be used for both single and multi-line comments. C++ comments `//` can only be used for single line comments. | ||
1. Generally keep line lengths below 90 characters, however there is no explicit line length enforcement. | ||
1. Use static functions when a function is only intended to be accessed from the same file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we also outlaw the "_" prefix explicitly now? We can fix the existing ones gradually.
## Naming conventions | ||
Valkey has a long history of inconsistent naming conventions. Generally follow the style of the surrounding code, but you can also always use the following conventions for variable and structure names: | ||
|
||
- Variable names: `snake_case` or all lower case (e.g. `valkeyobject` or `valkey_object`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we converge on snake_case
exclusively, for the new code?
All contributions should include a test of some form. | ||
|
||
Unit tests are present in the `src/unit` directory, and are intended to test individual structures or files. | ||
For example, most changes to datastructures should include corresponding unit tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example, most changes to datastructures should include corresponding unit tests. | |
For example, most changes to data structures should include corresponding unit tests. |
Integration tests are located in the `tests/` directory, and are intended to test end-to-end functionality. | ||
Adding new commands should come with corresponding integration tests. | ||
When writing cluster mode tests, do not use the legacy `tests/cluster` framework, which has been deprecated. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add a documentation section as well? new commands, configs, non-trivial features should come with documentation? blogs are also encouraged for major features, such as the 1M QPS, the hash table rewrite
Use a consistent set of licenses for Valkey files. I took a look and applied sort of a "did we make a material change in this file?" and tried to be conservative in adding the trademark. We could also be liberal as well. Resolves: #1692. Included documentation about the licensing here: #1787. Licenses are now also always explicitly first, even about documentation files. Signed-off-by: Madelyn Olson <[email protected]>
Took the suggestions from the development guide issue and tried to write them up. The one thing still missing is the backporting, since it seems we aligned on creating a bot, but we don't have the bot yet.
Fixes: #1558