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

Add XML comment attribute exclusion for MEN002 #9

Closed
gtbuchanan opened this issue Aug 18, 2022 · 1 comment
Closed

Add XML comment attribute exclusion for MEN002 #9

gtbuchanan opened this issue Aug 18, 2022 · 1 comment

Comments

@gtbuchanan
Copy link

We regularly use <seealso href="..."> in our XML comments to reference a URL that we may have sourced part of our code from. However, MEN002 triggers in some of these situations even though XML attributes cannot be broken across multiple lines. We are forced to use a pragma suppression for MEN002 around the whole XML comment in these cases. I was going to ask that this be added as an extension of AllowLongUriLines, but I imagine there could be other really long XML attribute values that aren't a URI. We've switched to using Roslynator RCS0056 for the time being since it also has a code fix provider, but it seems to skip analyzing XML comments altogether.

@menees
Copy link
Owner

menees commented Aug 19, 2022

Thanks for the suggestion and info! I've implemented this in v3.0.10. I made it part of the AllowLongUriLines logic since I only support long URLs in href attributes on see and seealso tags. If someone is using long attributes on other XML comment tags, then there's often a way to shorten them (e.g., a using directive for shorter cref attributes).

I previously didn't know that the see and seealso tags supported href, so that's great to learn! I've put a lot of http(s) URLs into remarks comment blocks over the years, and they'd have been better off in <see href="..."/> tags.

I also didn't know Roslynator had a similar rule. I'd hate to try to write a smart C# line wrapping code fixer! That sounds like a nightmare, so I'll leave the line wrapping up to humans. :-)

@menees menees closed this as completed Aug 19, 2022
menees added a commit to menees/RegExponent that referenced this issue Aug 19, 2022
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

No branches or pull requests

2 participants