Open heaths opened 1 year ago
Looks like our codeanalysis.ruleset is in a need of a refresh so that would be goodness for sure. However, what would be the benefit of moving all into .editorconfig? I have always seen both rulesets being used side by side.
Why maintain both copies? We also have style rules in .editorconfig that have "duplicates" in the ruleset. You don't want those getting out of sync or it's very confusing, so we have to maintain a sort of duplication there e.g. regarding use of var
, using
s, etc. Seems better to put them all in a single place.
I did not realize both can be coded in .editorconfig. No concerns from my side. As we update the editorconfig, should we use the .NET repo one as the baseline/starting point.
After some basic testing, the only reason I can see for keeping stylecop/code analysis rules in a .ruleset is that VS can automatically modify the file when people change settings in VS. Then again, do we even want to make that easy? I'd argue, "no."
After some basic testing, the only reason I can see for keeping stylecop/code analysis rules in a .ruleset is that VS can automatically modify the file when people change settings in VS
Do we get a prompt for yes or no? If so that does bring back some value.
Could you clarify what you mean?
In VS, you can expect Properties -> Analyzers and change specific analyzer codes to different severities. That impacts the entire repo, hence why I don't think supporting that is desirable.
Right now we have a mix of style preferences / analysis rules in .editorconfig and _eng/CodeAnslysis.rulset. We should consider,
dotnet_diagnostic.CA2000.severity = error
.IDisposable
to free up any unmanaged resources immediate, especially when it comes toMemoryStream
or the like which we use heavily.See https://github.com/Azure/azure-sdk-for-net/pull/35852#discussion_r1179555190 for context.