-
Notifications
You must be signed in to change notification settings - Fork 510
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
Code fix for SA1203 #1129
Code fix for SA1203 #1129
Conversation
Integrate DiagnosticsTestUtilities.csproj into the build. This involves: 1. Adding semantic and pre-release versionf for this project. 2. Adding the project to the solution. 3. Adding a number of files to the project. 4. Commenting out a bunch of code that was needed in the dotnet/roslyn repo, but is probably not needed in dotnet/roslyn-analyzers.
1. Update the project to use the Roslyn NuGet packages. 2. Update the proejct to use the correct version numbers. 3. Add the project to the solution.
Message correct
Added a comment that is specific to this tutorial about what the AnalyzeIfStatement method does
Diagnostics for: - missing/incorrect accessibility - missing/incorrect return type - missing/incorrect parameters
Incorporate ReadMe feedback
Code Fixes for: - setting accessibility to private - returning void - taking correct parameter
Change wording, fix typos, respond to comments on the pr
…mentComment AnalyzeIfStatement comment
Comments in blank template
Analyze if statement
… with the upgrade. This also involved converting a couple of code fixes from SyntaxFactory to SyntaxGenerator.
…rPack Move AnalyzerPowerPack over
…alyzers Move FxCop\System.Runtime.Analyzers project over
Have the id default not be a string, because that is misleading, but instead add a comment explaining what should be done
Clarify what to do after finishing tutorial
Clarify analyze if
Unblocked now that #1128 is merged. 😄 |
The only thing still open is the ordering with the access modifiers, question is if this is not the concern of SA1202 and SA1204 and if this codefix should fix all of these? |
|
I figured. I'll create a new pull request on a clean branch.
|
|
||
var fixedTestCode = @"public class Foo | ||
{ | ||
private const string Before1 = ""test""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The expected order should be.
private const string Before1 = ""test"";
public const string Before2 = ""test"";
private const string After1 = ""test"";
private int field1;
private int between;
public const string After2 = ""test"";
Fix for #1104
This only checks constants. Which given the discussion seems the proper implementation for this rule. It doesn't touch statics/instance fields (although they might move as a result of inserting a node before that was previously after).