Skip to content
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 cleanup and improvement #2007

Merged
merged 13 commits into from
Mar 5, 2024

Conversation

gintsk
Copy link
Contributor

@gintsk gintsk commented Mar 3, 2024

Pull Request

The issue or feature being addressed

Contributes to #1290 by addressing some XML documentation quality issues

Details on the issue fix or feature implementation

Fixes various XML comments quality issues

  • Fixes SA1629 "Documentation text should end with a period"
  • Fixes CA1200 "Avoid using cref tags with a prefix"
  • Fixes SA1627 "The documentation text within the 'exception' tag should not be empty"
  • Fixes SA1629 "Documentation text should end with a period" in ArgumentOutOfRangeException (but these could be further improved)
  • Fixes SA1614 "Element parameter documentation should have text"
  • Unifies XML comments for ArgumentNullException as following
    /// <exception cref="ArgumentNullException">Thrown when <paramref name="parameter"/> is <see langword="null"/>.</exception>"
    as already used in other places. i.e.
    /// <exception cref="ArgumentNullException">Thrown when <paramref name="builder"/> or <paramref name="options"/> is <see langword="null"/>.</exception>

Confirm the following

  • I started this PR by branching from the head of the default branch
  • I have targeted the PR to merge into the default branch
  • I have included unit tests for the issue/feature
  • I have successfully run a local build

Copy link

codecov bot commented Mar 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.64%. Comparing base (1dba402) to head (e18de1a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2007   +/-   ##
=======================================
  Coverage   83.64%   83.64%           
=======================================
  Files         312      312           
  Lines        7105     7105           
  Branches     1054     1054           
=======================================
  Hits         5943     5943           
  Misses        789      789           
  Partials      373      373           
Flag Coverage Δ
linux 83.64% <ø> (ø)
macos 83.64% <ø> (ø)
windows 83.64% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@martincostello martincostello left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were there some warnings you meant to turn back on in this commit? Also I'd have expected there to be some compiler warnings here for some of the changes I've noted that are referencing the wrong/missing parameters.

src/Polly/ISyncPolicy.TResult.cs Outdated Show resolved Hide resolved
src/Polly/ISyncPolicy.cs Outdated Show resolved Hide resolved
src/Polly/ISyncPolicy.TResult.cs Outdated Show resolved Hide resolved
src/Polly/ISyncPolicy.cs Outdated Show resolved Hide resolved
src/Polly/ISyncPolicy.cs Outdated Show resolved Hide resolved
src/Polly/Policy.ExecuteOverloads.cs Outdated Show resolved Hide resolved
src/Polly/Policy.ExecuteOverloads.cs Outdated Show resolved Hide resolved
src/Polly/Policy.TResult.ExecuteOverloads.cs Outdated Show resolved Hide resolved
src/Polly/Policy.TResult.ExecuteOverloads.cs Outdated Show resolved Hide resolved
src/Polly/Policy.TResult.ExecuteOverloads.cs Outdated Show resolved Hide resolved
@gintsk
Copy link
Contributor Author

gintsk commented Mar 4, 2024

Were there some warnings you meant to turn back on in this commit?

If I understood you correctly - it would be nice to get compiler warnings about documentation issues. At the moment stylecop documentation warnings are visible only when editing files.

Also I'd have expected there to be some compiler warnings here for some of the changes I've noted that are referencing the wrong/missing parameters.

I guess there are no such code-analysis/stylecop documentation rules. Maybe in some other documentation analyzers.

@martincostello
Copy link
Member

Yes, I would have expected the compiler to warn about the references to parameters that didn't exist.

@martincostello
Copy link
Member

Yes, I would have expected the compiler to warn about the references to parameters that didn't exist.

So the reason this isn't happening is because we don't set <GenerateDocumentationFile>true</GenerateDocumentationFile>.

If I enable that locally for this branch and build the project, then I get 113 warnings:

image

@martincostello martincostello merged commit 8a1f276 into App-vNext:main Mar 5, 2024
17 checks passed
@martincostello
Copy link
Member

Thanks for all the changes so far - if you'd like to do another PR, I suggest one that enables generation of the documentation file as noted above, and then fixing all of the remaining issues together with that to get us down to zero.

@martincostello martincostello added this to the v8.3.1 milestone Mar 5, 2024
@gintsk gintsk deleted the xml_comments_cleanup branch March 5, 2024 09:37
@gintsk gintsk mentioned this pull request Mar 5, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants