-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
contrib : add naming guidelines #11177
Conversation
784d267
to
ece4d6d
Compare
ece4d6d
to
610a03a
Compare
Following this, I believe that the sampler init functions are incorrectly named, e.g. |
I think these are OK since the subject is It should also cover cases such as |
I think it would be useful to put it in terms more familiar to programmers. For example, if we assume an object model, then the naming convention could be defined as |
Other things to document:
|
Great suggestions - will update those tomorrow. |
6edcfb7
to
e7bc61b
Compare
I've added a guideline. Needs to be extended with the |
My recommendation would be to use |
1429c30
to
7637216
Compare
e015794
to
10ef6c1
Compare
For blocks starting with |
dab577a
to
1ee6230
Compare
1ee6230
to
b6f9640
Compare
"Documentation is a community effort. When you need to look into the source code |
Might be good to also add a link to the C++ Core Guidelines, generally it's very good advice: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines |
9d438a4
to
95d87cb
Compare
It would be good to also document file naming. For example, most headers use |
- Clean-up any trailing whitespaces, use 4 spaces for indentation, brackets on the same line, `void * ptr`, `int & a` | ||
- Naming usually optimizes for common prefix (see https://github.com/ggerganov/ggml/pull/302#discussion_r1243240963) | ||
- Use sized integer types in the public API |
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.
- Use sized integer types in the public API | |
- Use sized integer types such as `int32_t` in the public API, e.g. `size_t` may also be appropriate for allocation sizes or byte offsets |
# Documentation | ||
|
||
- Documentation is a community effort | ||
- When you need to look into the source code to figure out implementation details to figure out how to use an API consider adding a short summary to the header file for future reference |
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 edited my original post and crossed out "to figure out implementation details" and replaced it with "to figure out how to use an API" since I think implementation details don't actually belong in the header. It seems both got copy-pasted; I guess this formulation also makes sense though it sounds awkward.
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.
Updated: ca001f6
ref #11167 (comment)