-
Notifications
You must be signed in to change notification settings - Fork 153
Add StyleCop.Analyzers #1663
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 StyleCop.Analyzers #1663
Conversation
Settings are taken from nunit framework project. With the following exceptions: 1. Braces are optional. 2. The this. prefix is not defined
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.
Well, not much to argue about here except for the two items I noted. But rather than dispute the principles, let's see if anyone gets annoyed by them.
That's my main guideline for enforced rules on a team: they should not annoy anyone. :-)
@@ -36,7 +37,8 @@ public static ProcessResult Run(ProcessStartInfo startInfo) | |||
}; | |||
process.ErrorDataReceived += (sender, e) => | |||
{ | |||
if (e.Data == null) return; | |||
if (e.Data == null) | |||
return; |
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.
Another kind of thing where I find the rule overly pedantic, but at least it doesn't force adding parens.
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.
If it starts to annoy you we can disable rule SA1501, but until them leave it.
public TestSelectionParserException(string message, Exception innerException) : base(message, innerException) { } | ||
public TestSelectionParserException(string message, Exception innerException) : base(message, innerException) | ||
{ | ||
} |
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.
I see a number of these. Depending on what happens when I try to put the empty braces on the same line, I may get annoyed at StyleCop for not being smart enough to see that there is nothing in the braces so don't worry. :-)
But let's give it a go anyway.
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.
If it starts to annoys you we can switch off rule SA1502.
Partly addresses #1590
Settings are taken from nunit framework project.
With the following exceptions:
We can either leave it, or enforce the use of 'this.' or deny the the use of 'this.'.
The latter has my preference.