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

Enable Roslynator Analyzers via Nuget Package #2206

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JustinGrote
Copy link
Collaborator

@JustinGrote JustinGrote commented Dec 4, 2024

This requires the following packages to be added to the Build Feed

Roslynator.Analyzers
Roslynator.CodeAnalysis.Analyzers
Roslynator.Formatting.Analyzers

Rosylnator used to be used via vscode extension but since the switch to C# Dev Kit, Support for that has been non-functional (dotnet/vscode-csharp#6790)

The analysis packages are now made available as Nuget packages, and this PR integrates them into the non-test repositories. This is the first step to later revise EditorConfig to enforce consistent code style among repositories.

Style-related recommendations based on current editorconfig (these are info recommendations and not enforced)

Analyzed solution 'D:\PowerShellEditorServices\PowerShellEditorServices.sln' (in 22.4 s)

  4 CA1510    Use ArgumentNullException throw helper
  2 CA1826    Do not use Enumerable methods on indexable collections
  2 CA1837    Use 'Environment.ProcessId'
  6 CA1859    Use concrete types when possible for improved performance
 10 CA1861    Avoid constant arrays as arguments
  1 CA2208    Instantiate argument exceptions correctly
  1 CA2249    Consider using 'string.Contains' instead of 'string.IndexOf'
  3 CS1998    Async method lacks 'await' operators and will run synchronously
  4 CS4014    Because this call is not awaited, execution of the current method continues before the call is completed
 74 IDE0028   Simplify collection initialization
 12 IDE0090   Use 'new(...)'
  2 RCS1015   Use nameof operator
  8 RCS1036   Remove unnecessary blank line
  1 RCS1075   Avoid empty catch clause that catches System.Exception
  4 RCS1097   Remove redundant 'ToString' call
  9 RCS1163   Unused parameter
  2 RCS1214   Unnecessary interpolated string
  1 RCS1218   Simplify code branching
 14 RCS1251   Remove unnecessary braces from record declaration
  2 RCS1267   Use string interpolation instead of 'string.Concat'
  1 VSTHRD104 Offer async methods
  3 xUnit1004 Test methods should not be skipped
  4 xUnit1042 The member referenced by the MemberData attribute returns untyped data rows
 26 xUnit2023 Do not use collection methods for single-item collections

@JustinGrote JustinGrote requested a review from Copilot December 4, 2024 00:03
@JustinGrote JustinGrote requested a review from a team as a code owner December 4, 2024 00:03
@JustinGrote JustinGrote self-assigned this Dec 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 1 out of 4 changed files in this pull request and generated no suggestions.

Files not reviewed (3)
  • Directory.Packages.props: Language not supported
  • src/PowerShellEditorServices.Hosting/PowerShellEditorServices.Hosting.csproj: Language not supported
  • src/PowerShellEditorServices/PowerShellEditorServices.csproj: Language not supported
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant