Skip to content
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

Fix code style and xmldocs, add Roslynator analyzer #1030

Merged
merged 1 commit into from
May 17, 2023

Conversation

dluc
Copy link
Collaborator

@dluc dluc commented May 17, 2023

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
  • switch from CA1032 to RCS1194 to cover more exception ctors

@github-actions github-actions bot added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel kernel.core labels May 17, 2023
@dluc dluc force-pushed the dluc156cs branch 2 times, most recently from 1abc3b6 to 55e4d2a Compare May 17, 2023 01:55
hathind-ms
hathind-ms previously approved these changes May 17, 2023
@dluc dluc requested a review from shawncal May 17, 2023 02:01
@dluc dluc force-pushed the dluc156cs branch 2 times, most recently from 9adbc4c to 2015019 Compare May 17, 2023 02:36
@dluc dluc added the PR: ready for review All feedback addressed, ready for reviews label May 17, 2023
@dluc dluc changed the title Fix code style and documentation Fix code style and xmldocs, add Roslynator May 17, 2023
@dluc dluc changed the title Fix code style and xmldocs, add Roslynator Fix code style and xmldocs, add Roslynator analyzer May 17, 2023
shawncal
shawncal previously approved these changes May 17, 2023
stephentoub
stephentoub previously approved these changes May 17, 2023
@dluc dluc dismissed stale reviews from stephentoub and shawncal via c9005b5 May 17, 2023 17:34
@dluc dluc force-pushed the dluc156cs branch 4 times, most recently from d3c3aac to 6c1a398 Compare May 17, 2023 18:11
@dluc dluc merged commit 32fbc90 into microsoft:main May 17, 2023
19 checks passed
@dluc dluc deleted the dluc156cs branch May 17, 2023 19:16
shawncal pushed a commit to johnoliver/semantic-kernel that referenced this pull request May 19, 2023
Add [Roslynator](https://github.com/JosefPihrt/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
* switch from CA1032 to RCS1194 to cover more exception ctors
golden-aries pushed a commit to golden-aries/semantic-kernel that referenced this pull request Oct 10, 2023
Add [Roslynator](https://github.com/JosefPihrt/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
* switch from CA1032 to RCS1194 to cover more exception ctors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code PR: ready for review All feedback addressed, ready for reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants