-
Notifications
You must be signed in to change notification settings - Fork 509
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
Differences with classic StyleCop #1766
Comments
Thanks for taking the time to do this. 👍
The behavior is by-design, see #413. The documentation does not accurately reflect this, so a documentation bug should be created.
Suppressions are completely handled by Roslyn, not by our code. You can disable the warning throughout a file by using the following syntax: #pragma warning suppress SA1402 // File may only contain a single class
This is intentional (see #998).
This is a side effect of an intentional change (see #59, #997).
SA1130 is a new rule for StyleCop Analyzers. I think it's fine to report both and let the user decide what the best course of action is. If you disagree, feel free to open an issue for a proposed change.
There is no SA1591; I believe you are referring to CS1591. The difference here is StyleCop Analyzers runs with the compiler, so any compiler warnings are produced alongside the StyleCop results, as opposed to StyleCop Classic which ran separately and only reported StyleCop results. See the documentation of SA1652 for additional information about CS1591.
There is no SA1570; I believe you are referring to CS1570. This behavior is intentional; see #1291.
Each of these should be moved to a new bug (one per issue) for further investigation and potentially fixes. |
I'll reopen this with the action item of filing issue reports for the items mentioned at the end of my comment. |
Do you want me to created the related issues? |
You get "dibs" on them since you spotted them - I'll let you take credit for all those issues. If you don't want to let me know and I'll file them tonight. |
I'll take care of it later today. I'll try to strip them down a bit, too, as I just copied and pasted from my test suite. |
Sorry, had some internet connectivity issues with Comcast this weekend. Think they are all sorted out. Making the move to new issues now. |
I think all the issues needed have been created. Closing this issue. |
👍 |
I have a test suite for classic StyleCop (and Code Analysis) that I created for trying to trigger each of the warnings. I just ran it on StyleCop Analyzers. There are some differences. These should probably be triaged and bugs created in cases where it is warranted. In some cases, I think they should just be documented.
Issue D1: Related to SA1642.
If there is a class with a private empty constructor, the documentation text in classic StyleCop requires it to begin with "Prevents a default instance of the class from being constructed." The current rule requires "Initializes a new instance...".
Issue D2: Related to SA1402.
In classic StyleCop, a suppression of SA1402 only needs to occur on the first class within a file and all other classes in the file do not produce SA1402. The current analyzer requires that every class in the file has the suppression.
Issue D3: Related to SA1000 and SA1008
The following code would only trigger SA1000 in classic StyleCop. The current analyzer triggers both SA1000 and SA1008:
Issue D4: Related to SA1003 and SA1020
The following code would only trigger SA1020 in classic StyleCop. The current analyzer triggers both SA1020 and SA1003.
Issue D5: Related to SA1003 and SA1023
The following code would only trigger SA1023 in classic StyleCop. The current analyzer triggers both SA1023 and SA1003. (This is unsafe code.)
Issue D6: Related to SA1106 and SA1002
The following code would only trigger SA1106 in classic StyleCop. The current analyzer triggers both SA1106 and SA1002.
Issue D7: Related to SA1109 and SA1123
The following code would trigger SA1109 in classic StyleCop. The current analyzer triggers SA1123.
Issue D8: Related to SA1101 and SA1126
The following code would trigger SA1126 in classic StyleCop. The current analyzer triggers SA1101.
Issue D9: Related to SA1202 and SA1205
The following code would trigger only SA1205 in classic StyleCop. The current analyzer triggers both SA1202 and SA1205.
Issue D10: Related to SA1304 and SA1401
The following code would trigger SA1304 in classic StyleCop. The current analyzer triggers SA1401.
Issue D11: Related to SA1307 and SA1311
The following code would trigger SA1311 in classic StyleCop. In the current analyzer, it triggers both SA1307 and SA1311.
Issue D12: Related to SA1130 and SA1410
The following code would trigger only SA1410 in classic StyleCop. In the current analyzer, it triggers both SA1410 and SA1130.
Issue D14: Related to SA1517 and SA1633
A blank line before the file header would only trigger SA1517 in classic StyleCop. In the current analyzer, it triggers both SA1517 and SA1633.
Issue D15: Related to SA1591 and SA1601
The following code would trigger SA1601 in classic StyleCop. In the current analyzer, it triggers both SA1591 and SA1601.
Issue D16: Related to SA1591 and SA 1602
The following code would trigger SA1602 in classic StyleCop. In the current analyzer, it triggers both SA1591 and SA1602.
Issue D17: Related to SA1570 and SA1603
The following code would trigger SA1603 in classic StyleCop. In the current analyzer, it triggers SA1570 only.
Issue D18: Related to SA1611 and SA1612
The following code would trigger SA1612 in classic StyleCop. In the current analyzer, it triggers SA1611.
There are others, but probably if these get fixed, it will fix many of the others. I can provide my test suite if you want.
The text was updated successfully, but these errors were encountered: