semantic-kernel icon indicating copy to clipboard operation
semantic-kernel copied to clipboard

Fix code style and xmldocs, add Roslynator analyzer

Open dluc opened this issue 1 year ago • 0 comments

Add Roslynator and fix some code style issues found.

dotnet_analyzer_diagnostic.severity is set to none to stop dotnet format from editing a lot of files, even unrelated issues, probably detected by other analyzers, and a lot of issues are disabled. Currently only these are enabled:

dotnet_diagnostic.RCS1036.severity = warning # Remove unnecessary blank line.
dotnet_diagnostic.RCS1037.severity = warning # Remove trailing white-space.
dotnet_diagnostic.RCS1097.severity = warning # Remove redundant 'ToString' call.
dotnet_diagnostic.RCS1138.severity = warning # Add summary to documentation comment.
dotnet_diagnostic.RCS1168.severity = warning # Parameter name 'foo' differs from base name 'bar'.
dotnet_diagnostic.RCS1175.severity = warning # Unused 'this' parameter 'operation'.
dotnet_diagnostic.RCS1192.severity = warning # Unnecessary usage of verbatim string literal.
dotnet_diagnostic.RCS1139.severity = warning # Add summary element to documentation comment.
dotnet_diagnostic.RCS1211.severity = warning # Remove unnecessary else clause.
dotnet_diagnostic.RCS1214.severity = warning # Unnecessary interpolated string.
dotnet_diagnostic.RCS1225.severity = warning # Make class sealed.
dotnet_diagnostic.RCS1232.severity = warning # Order elements in documentation comment.

Note:

  • There are a lot more issues to fix, for now I disabled a lot of checks and fixed only a bunch.
  • Future: enable more of dotnet_diagnostic.RCS currently disabled, e.g. XMLDoc checks, to get better code docs

Other fixes:

  • fix incorrect namespaces in copilot chat
  • use static property for regex
  • typos, missing copyright

dluc avatar May 17 '23 01:05 dluc