-
Notifications
You must be signed in to change notification settings - Fork 6
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
[Build Server] Automated Style Checking and Feedback #121
Comments
We can also set rules to pass warnings and errors, and coupled with "Pass warnings as errors" as in #124 we get CI coverage for style checking. |
I'm experimenting with DotNetAnalyzers/StyleCopAnalyzers in a local branch, I may have stuff to show off tonight or tomorrow. |
#159 demonstrates that we now receive feedback on style checks with CI builds. Is this satisfactory for the scope of this issue? |
Can we do a test that demonstrates the warning condition (where the pr is not rejected, but contains style changes we'd prefer contributions not have)? |
We absolutely cannot, how would that even work? The reason the current test works is because we're utilizing the "warnings as errors" attributes in our C# projects. If the StyleCop rule is set to be a warning, it will result in a failed error. |
It doesn't matter, I'm been trying it out now, and I've decided the "warning-as-errors" in combination with StyleCop is just way too annoying to be considered coder friendly so I need to remove it. |
@robertkety Do we really want the use case you described? Automated feedback on warnings, but not reject the Pull Request? I just don't understand what the purpose is, I can't think of a realistic situation where a warning will show on GitHub, and I won't ask the contributor to fix it. Every warning not fixed will carry over to the next PR, bothering other contributors who didn't even introduce the warning in the first place. In my mind the perfect scenario of what we want is: I'm not sure exactly how to achieve this, but I think it should be possible somehow to toggle Werror(Warning on Error) so that it is only active when on a build server, it's worth looking into. |
I'd like to determine a means to have the build server scan incoming file changes against a style policy. Furthermore, I'd like the policy to distinguish between style requirements for our repository and style guidance we'd prefer contributors to follow. The distinction between the two types of policies determines if the pull request is rejected automatically or accepted with warnings. A pull request with no style violations or warnings (and a valid build) would be considered a pass and simply await review, authorization, and merge.
The weighted style policy would allow us to control critical style behavior (e.g., class order of fields, properties, methods, indexers, etc.) while not pestering contributors with nice-to-have style behavior (e.g., white space after semi-colon).
The determination of what qualifies as style guidance versus style requirement may happen at a later time, but a good resource might be found by examining the capabilities of 'Format Document' in Visual Studio 2015 (Edit->Advanced->Format Document OR Ctrl-K, Ctrl-D).
The text was updated successfully, but these errors were encountered: