-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
#1660 Huge logs because of StyleCop.Analyzers warnings #1663
Conversation
… is missing a trailing comma.
…tion, whenever the parameter span across multiple lines
…umentation header.
This will prevent derived types that introduce a finalizer from needing to re-implement 'IDisposable' to call it.
…nce data and can be marked as static
Convert to property.
…Finalize(object).
… case characters: AcceptanceTests\WebSocketTests
@RaynaldM Hey Ray! |
/// </summary> | ||
private readonly string[] _unsupportedRequestHeaders = | ||
{ | ||
"Transfer-Encoding" | ||
"Transfer-Encoding", |
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.
comma is useless
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.
This is SA1413 StyleCop rule. See more below!
@@ -82,7 +82,7 @@ private static async Task MapAggregateContent(HttpContext originalContext, List< | |||
|
|||
var stringContent = new StringContent(contentBuilder.ToString()) | |||
{ | |||
Headers = { ContentType = new MediaTypeHeaderValue("application/json") } | |||
Headers = { ContentType = new MediaTypeHeaderValue("application/json") }, |
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.
comma is useless
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.
In the previous version (target):
This is SA1413 StyleCop rule.
Cause
The last statement in a multi-line C# initializer or list is missing a trailing comma.
Rationale
This rule is specifically designed to work well with the most widely used source control systems as an aid to long-term
code review. By placing a comma on the last line of a multi-line sequence, developers who append an item to the list or reorder the list at some point in the future will not need to modify any more lines than absolutely necessary for the
change. As a result, the size of the subsequent code review is minimized and focused, and tools like git blame
continue to show the original author and commit for the item that was previously last in the list.
I believe the most importand part of the Rationale is:
and focused, and tools like git blame
continue to show the original author and commit for the item that was previously last in the list.
So, the restriction of git compare/diff tool is tracking changes per line. That's why this rule was introduced in StyleCop Analyzer. The history of the line should not be overridden by absent comma if the next line will be changed in future.
Yeah, now I have overridden the author of this line. But that's how to fix it.
That's why I fixed the violation of SA1413 rule.
Finally,
I believe this is not a major issue to fix, but thank you for your comment!
@RaynaldM Ray, @TomPallister Tom, |
* push code coverage for main and develop branches * #1660 Huge logs because of StyleCop.Analyzers warnings (#1663) * Add StyleCop.Analyzers package * Fix SA0001: XML comment analysis is disabled due to project configuration * Fix SA1609: Property documentation should have value * Fix CS1591: Missing XML comment for publicly visible type or member {xyz} * Fix SA1101: Prefix local calls with this * Fix SA1413: The last statement in a multi-line C# initializer or list is missing a trailing comma. * Fix SA1135: A using directive is not qualified. * Fix compiler errors * Fix SA1651: Do not use placeholder elements * Fix compiling error * Fix SA1113: Comma should be on the same line as previous parameter * Fix SA1116: The parameters should begin on the line after the declaration, whenever the parameter span across multiple lines * Fix SA1137: Elements should have the same indentation * Fix SA1200: Using directive should appear within a namespace declaration * Fix SA1316: Tuple element names should use correct casing * Fix SA1503: Braces should not be omitted * Fix SA1505: An opening brace should not be followed by a blank line * Fix SA1507: Code should not contain multiple blank lines in a row * Fix SA1508: A closing brace should not be preceded by a blank line * Fix SA1512, SA1515 * Fix SA1513: Closing brace should be followed by blank line * Fix SA1400: Element 'OpenTracingTracer' should declare an access modifier * Fix SA1515: Single-line comment should be preceded by blank line * Fix SA1518: File is required to end with a single newline character * Add StyleCop * Fix SA1633: A C# code file is missing a standard file header. * Disable SA1602: An item within a C# enumeration is missing an Xml documentation header. * Fix SA1600: Elements should be documented * Fix SA1604: Element documentation should have summary * Fix SA1618: The documentation for type parameter 'T' is missing * Fix SA1629: Documentation text should end with a period. * Fix SA1649: File name should match first type name * Fix SA1600: Elements should be documented * Upgrade K8s sample to ASP.NET 7. Rename project to Ocelot.Samples.OcelotKube.DownstreamService * Upgrade K8s sample to ASP.NET 7. Rename project to Ocelot.Samples.OcelotKube.ApiGateway * Fix CS0169: The field 'xxx' is never used * Fix CS0219: The variable 'baseUrl' is assigned but its value is never used * Fix CS0414: The field 'xxx' is assigned but its value is never used * Fix CS1570: XML comment has badly formed XML * Fix CS0649: Field 'xxx' is never assigned to, and will always have its default value null * Fix CS0618: 'member' is obsolete: 'text' * Fix NU1504: Duplicate 'PackageReference' items found: Microsoft.Data.SQLite 7.0.4, Microsoft.Data.SQLite 7.0.5 * Upgrade sample to ASP.NET 7 * Fix NU5048: The 'PackageIconUrl'/'iconUrl' element is deprecated. Consider using the 'PackageIcon'/'icon' element instead. Learn more at https://aka.ms/deprecateIconUrl * Rewrite a RequestDelegate object definition * Fix CS0618: 'member' is obsolete: 'text' * Fix CA1816: Change Dispose() to call GC.SuppressFinalize(object). This will prevent derived types that introduce a finalizer from needing to re-implement 'IDisposable' to call it. * Fix CA1822: Member 'GivenThereIsAConfiguration' does not access instance data and can be marked as static * Fix CA1837: Use 'Environment.ProcessId' instead of 'Process.GetCurrentProcess().Id' * Fix CA2211: Non-constant fields should not be visible. Convert to property. * Fix IDE0060: Remove unused parameter 'path' if it is not part of a shipped public API * Fix CA1816: Change ConsulWebSocketTests.Dispose() to call GC.SuppressFinalize(object). * Fix IDE1006: Naming rule violation: These words must begin with upper case characters * Fix IDE1006: Naming rule violation: These words must begin with upper case characters: AcceptanceTests\WebSocketTests * Fix last issues * Upgrade basic sample to ASP.NET 7 * fixed up required spacing in README (#1499) Co-authored-by: Justin Middler <[email protected]> * Update README.md --------- Co-authored-by: TomPallister <[email protected]> Co-authored-by: Justin Middler <[email protected]> Co-authored-by: Justin Middler <[email protected]> Co-authored-by: Tom Pallister <[email protected]>
Fixes #1660
A long list of StyleCop.Analyzers warnings in build logs: CircleCI, VS Output Build, VS Error List Warnings.
Proposed Changes