-
Notifications
You must be signed in to change notification settings - Fork 8
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
chore: update docstrings to follow best practices #284
Conversation
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 the documentation in general, I recommend fully documenting the public elements of interface files. Then in the implementations, you only need to write
/// <inheritdoc />
above the methods/properties from the interface and it will resolve automatically, ie no need for a cref.
For example in IConfiguration.cs:
public interface IConfiguration
{
/// document this one
public ILoggerFactory LoggerFactor { get; }
Then in Configuration.cs:
public class Configuration : IConfiguration
{
/// <inheritdoc />
public ILoggerFactory LoggerFactory { get; }
As an example see the documention of ISimpleCacheClient.cs and SimpleCacheClient.cs
/// <inheritdoc cref="Momento.Sdk.Config.IConfiguration.LoggerFactory" /> | ||
public ILoggerFactory LoggerFactory { get; } |
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.
This looks like it's trying to inherit from itself. This should (I think) reference Microsoft.Extensions.Logging.ILoggerFactory
instead, but I'm wondering if these crefs are necessary at all? It looked like <inheritdoc />
was working fine without that attribute, and I think @malandis was suggesting that usage in his comment (please correct me if I'm wrong about that).
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.
Thank you for pointing it out!
I moved the summaries to the interfaces and forgot to remove cref
. I will remove them.
…ore/update-docstrings-feedback
public Configuration(IRetryStrategy retryStrategy, ITransportStrategy transportStrategy, ILoggerFactory? loggerFactory = null) | ||
: this(retryStrategy, new List<IMiddleware>(), transportStrategy, loggerFactory) | ||
{ | ||
|
||
} | ||
|
||
/// <summary> | ||
/// <inheritdoc cref="Momento.Sdk.Config.IConfiguration" /> | ||
/// Create a new instance of Configuration obejct with provided arguments: <see cref="Momento.Sdk.Config.IConfiguration.RetryStrategy">, <see cref="Momento.Sdk.Config.IConfiguration.Middlewares">, <see cref="Momento.Sdk.Config.IConfiguration.TransportStrategy"/>, and <see cref="Momento.Sdk.Config.IConfiguration.LoggerFactory"/> |
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.
These see
tags need to be closed: <see cref="foo" />
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.
Thank you for your diligence on this
@@ -0,0 +1,4167 @@ | |||
Targeting a max of 100000 requests per second (delay between requests: 10) |
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 this file be committed? Looks like the output of a local run
This pr addresses the feedback received from Chris in this pr: #282
I moved some of the docstrings to interfaces and reference those docstrings using
inheritdoc cref
in the classes inherits those interfaces.