-
Notifications
You must be signed in to change notification settings - Fork 988
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
XML comments style guidelines #1489
Comments
I'm guessing |
Heheh :) Fixing |
In a full accord with these 💯 |
The indentation I've done is actually two spaces, the same as VS was doing for nested tags (IIRC). If comments exist I think the guidelines here are reasonable. But I, personally, have a love/hate relationship with API comments in code... they get written in code, then they get ported to the docs site (if the member was new), then the docs site is the authority. So, personally, I'm sort of an advocate for the comments to be stripped out once they move to the docs site. |
What about the intellisense? |
I clarified |
From inside the assembly, or outside? From outside it's provided by bundles that are built from the information in dotnet-api-docs (the same thing that feeds docs.microsoft.com). From inside it might/might-not matter. Most projects I've worked on don't bother xmldocs non-public members, so "internal public calls" and "internal internal calls" equally having no docs is a potentially sane state to be in. |
I’m not sure about #2 - two spaces after doc comment isn’t something I’ve really ever seen |
I've reformatted xml-docs to have 2 spaces in #1591 |
Is there some editor config in place? Last I checked this is not the default of VS. Without editor support you'll have a hard time keeping this consistent. |
This is not directly supported by the IDE formatter and will not be sustainable in a repository. I recommend removing this guideline, as it only serves to further discourage the inclusion of documentation which is already an uphill battle before this. |
💡 If you want assistance in XML documentation syntax, consider adding DotNetAnalyzers.DocumentationAnalyzers to the project. It has a bunch of rules to help get things like paragraphs and lists correct, and even has a refactoring that allows a comment to initially be written as Markdown and then converted to XML syntax. More information about the specific rules can be found on its documentation page. If you have questions about any of the incomplete documentation pages please feel free to ask. |
📝 This would be aided by DotNetAnalyzers/DocumentationAnalyzers#27 and DotNetAnalyzers/DocumentationAnalyzers#29. It already detects |
I completely understand it. We can do a cleanup/reformat pass every so often, no real issue here.
Thank you, will look into this. |
We've settled on the above as the current working set. |
In CoreFX we didn't call out a standard for XML comments. Since we have so much active cleanup and code generation I think we should develop some consistency guidelines, with the following goals:
Goals (in priority order)
Here are some starting guidelines for discussion:
Guideline 1: Use XML style comments for methods and classes.
Guideline 2: Indent tag content by one extra space (two total) when on separate lines for readability.
Guideline 3: Avoid adding comments that simply repeat the name of the element.
Guideline 4: Use
<see cref="" />
and<paramref name="" />
blocks when refering to other code elements or URLs. This helps with code navigation and will keep comments up to date when refactoring.cc: @bartonjs
The text was updated successfully, but these errors were encountered: