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

Fix SA1629 "... should end with a period" in generated xml docs #331

Merged
merged 1 commit into from
Jul 17, 2021

Conversation

georg-jung
Copy link
Contributor

Probably not adding too much value, but easy to change too :)...

Also, <remarks><para>... is generated like:

/// <para><see href="https://docs.microsoft.com/windows/win32/api/iphlpapi/nf-iphlpapi-sendarp">Learn more about this API from docs.microsoft.com.</see></para>

while the end of <summary> is generated as:

/// <para><see href="https://docs.microsoft.com/windows/win32/api/iphlpapi/nf-iphlpapi-sendarp#parameters">Read more on docs.microsoft.com</see>.</para>

thus, beeing SA1629 compliant.

Also, <remarks><para>... is generated like:

/// <para><see href="https://docs.microsoft.com/windows/win32/api/iphlpapi/nf-iphlpapi-sendarp">Learn more about this API from docs.microsoft.com.</see></para>

while the end of <summary> is generated as:

/// <para><see href="https://docs.microsoft.com/windows/win32/api/iphlpapi/nf-iphlpapi-sendarp#parameters">Read more on docs.microsoft.com</see>.</para>

thus, beeing SA1629 compliant.
@georg-jung georg-jung force-pushed the fix-SA1629-in-generated-xml-doc branch from 7d6a511 to dbb057f Compare July 13, 2021 13:14
@ghost
Copy link

ghost commented Jul 13, 2021

CLA assistant check
All CLA requirements met.

@jnm2
Copy link
Contributor

jnm2 commented Jul 13, 2021

This reverses #295 and is visually irritating to me. I've been thinking about contributing a fix for SA1629. Either way, SA1629 doesn't run on generated source from what I remember.

@georg-jung
Copy link
Contributor Author

georg-jung commented Jul 13, 2021

I think you're right, I didn't notice it directly on generated source code, but when experimenting with an editable copy of the generated code directly in a project. Where the . should be is probably a question of taste - I don't have strong feelings about it. I just sent the PR because I randomly noticed that the code that is generated doesn't stick to the default StyleCop ruleset and it's easy to fix.

Either way, we currently have the point inside the <see> in one place and outside in the other (see above).

@jnm2
Copy link
Contributor

jnm2 commented Jul 13, 2021

Nice, I would have liked to have fix that if I had seen it.

@AArnott
Copy link
Member

AArnott commented Jul 17, 2021

Thanks for the submission. I typically strive for StyleCop compliance in the generated code. Even though those analyzers don't typically run on generated code, copying from generated code into the user's project is a supported scenario, and we don't want that to require a ton of fixups after in order to fix stylecop warnings.
That said, I know we're probably far from that sort-of goal (of being stylecop compliant).

I'd generally prioritize avoiding analyzer warnings over catering to what @jnm2 finds "visually irritating" though (no offense intended). So I think we should take this. If @jnm2 succeeds in getting a change made to SA1929 such that either way will not produce a warning, I guess we can switch back at that point.

@AArnott AArnott merged commit b6936c9 into microsoft:main Jul 17, 2021
@jnm2
Copy link
Contributor

jnm2 commented Jul 17, 2021

Hey, no worries. The fact that no one else seems to be bothered by the period being a different color is a sign that I should consider it's just a "me" thing and not switch things back even after SA1929 is updated.

@jnm2
Copy link
Contributor

jnm2 commented Jul 18, 2021

Hey, <a href instead of <see href would not have had this conflict with SA1629. It's also shorter. <a started working at the same time in the IDE that <see href started working.

PR to update SA1629 is at DotNetAnalyzers/StyleCopAnalyzers#3371.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants