Skip to content

Fix code style and xmldocs, add Roslynator analyzer - #1030

Merged
Devis Lucato (dluc) merged 1 commit into
microsoft:mainfrom
dluc:dluc156cs
May 17, 2023
Merged

Devis Lucato (dluc) merged 1 commit into
microsoft:mainfrom
dluc:dluc156cs

Conversation

@dluc

@dluc Devis Lucato (dluc) commented May 17, 2023 •

Copy link
Copy Markdown
Contributor

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
Devis Lucato (dluc) force-pushed the dluc156cs branch 2 times, most recently from 1abc3b6 to 55e4d2a Compare May 17, 2023 01:55
@dluc
Devis Lucato (dluc) force-pushed the dluc156cs branch 2 times, most recently from 9adbc4c to 2015019 Compare May 17, 2023 02:36
@dluc Devis Lucato (dluc) added the PR: ready for review All feedback addressed, ready for reviews label May 17, 2023
@dluc Devis Lucato (dluc) changed the title Fix code style and documentation Fix code style and xmldocs, add Roslynator May 17, 2023
@dluc Devis Lucato (dluc) changed the title Fix code style and xmldocs, add Roslynator Fix code style and xmldocs, add Roslynator analyzer May 17, 2023
@dluc
Devis Lucato (dluc) merged commit 32fbc90 into microsoft:main May 17, 2023
@dluc
Devis Lucato (dluc) deleted the dluc156cs branch May 17, 2023 19:16
Shawn Callegari (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
John (johnoliver) pushed a commit to johnoliver/semantic-kernel that referenced this pull request Jun 5, 2024
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
John (johnoliver) pushed a commit to johnoliver/semantic-kernel that referenced this pull request Jun 5, 2024
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.

5 participants