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
IO::Buffer improvements and documentation. #9329
Conversation
0a50939
to
752adf4
Compare
Doesn't look documentation only? |
You are correct, I reorganised and made some minor improvements of the code too. |
bf9f23c
to
df02321
Compare
io_buffer_extract_flags(VALUE argument) | ||
{ | ||
if (rb_int_negative_p(argument)) { | ||
rb_raise(rb_eArgError, "Flags can't be negative!"); |
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.
We usually don’t end error messages with exclamation (or period).
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.
Have we documented this anywhere? I suggest we add documentation around conventions that we expect to be followed in CRuby (e.g. naming conventions, exception messages, code organisation, etc). We can change these messages, however I prefer to have clear exclamations when reporting errors. Currently, there are a number of places in the code that follow this convention.
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.
Maybe we can reference something like this: https://learn.microsoft.com/en-us/dotnet/standard/exceptions/best-practices-for-exceptions
Use grammatically correct error messages
Write clear sentences and include ending punctuation. Each sentence in the string assigned to the Exception.Message property should end in a period. For example, "The log table has overflowed." would be an appropriate message string.
93b13e9
to
f2c5497
Compare
075c798
to
7c1b46f
Compare
7c1b46f
to
de1a324
Compare
Tidy up the documentation of the C implementation.