Back to all reviewers

Document public API elements

octokit/octokit.net
Based on 8 comments
C#

Every public API element (classes, methods, properties, constructors) must have XML documentation comments that clearly describe its purpose and usage. This improves developer experience through IntelliSense and ensures the API is well-documented.

Documentation C#

Reviewer Prompt

Every public API element (classes, methods, properties, constructors) must have XML documentation comments that clearly describe its purpose and usage. This improves developer experience through IntelliSense and ensures the API is well-documented.

For implementation classes that implement interfaces:

  • Use <inheritdoc /> at the class level to inherit documentation from interfaces
  • Don’t duplicate documentation in both places to avoid maintenance issues

For method parameters and properties:

  • Place important contextual information in <param> descriptions rather than <remarks> for better IntelliSense visibility
  • Use the format: <param name="paramName">Description (additional context)</param>

Example:

/// <summary>
/// Creates a new repository transfer description.
/// </summary>
/// <param name="newOwner">The new owner of the repository after the transfer.</param>
/// <param name="teamId">A list of team Ids to add to the repository (only applies to Organization owned repositories).</param>
public RepositoryTransfer(string newOwner, IReadOnlyList<int> teamId)
{
    Ensure.ArgumentNotNullOrEmptyString(newOwner, nameof(newOwner));
    Ensure.ArgumentNotNullOrEmptyEnumerable(teamId, nameof(teamId));
    
    NewOwner = newOwner;
    TeamId = teamId;
}

Maintain consistency across similar members - if one method overload has documentation, all overloads should be documented with the same level of detail.

8
Comments Analyzed
C#
Primary Language
Documentation
Category

Source Discussions