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

Allow configuration of SA0001:XmlCommentAnalysisDisabled #2192

Closed
adamralph opened this issue Aug 22, 2016 · 4 comments
Closed

Allow configuration of SA0001:XmlCommentAnalysisDisabled #2192

adamralph opened this issue Aug 22, 2016 · 4 comments

Comments

@adamralph
Copy link

For some projects, I don't want to enable XML documentation and I don't want this warning either. I should be able to disable this rule in StyleCop.json.

@sharwell
Copy link
Member

sharwell commented Aug 22, 2016

This issue is a duplicate of #2191, with one big caveat. The compiler will not behave the way you expect when you have XML documentation disabled, and a large number of other rules will misbehave in subtle ways. I recommend reading over the documentation for SA0001, and using a ruleset file to disable the other rules which tend to be the original reason people turn off XML output (e.g. CS1573, CS1591).

@adamralph
Copy link
Author

Thanks. Does that mean that I have to enable XML output no matter what, unless I want all sorts of strange effects?

It's not really ideal. There's only a subset of projects I work on where switching on XML output makes sense, but I still want to use StyleCop in those projects for everything else.

@sharwell
Copy link
Member

@adamralph Everything seems to work better if XML output is always enabled. We would have otherwise needed to make a bunch of exceptions in the analyzers and provide separate behavior for the case where XML output is disabled. I'm not sure why, but the setting affects the internal parsing behavior of the compiler in addition to the output.

Also note that when XML output is disabled you'll face other bugs too, like dotnet/roslyn#2773.

@adamralph
Copy link
Author

@sharwell OK, so it seems the problem is more deep rooted than this analyzer package, and is in Roslyn itself. Fair enough, I guess enabling docs when I don't need them isn't too costly. Shame that this paper cut has to exist though.

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

No branches or pull requests

2 participants