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

User/ryanbod/shell plugin fxcop #6043

Conversation

ryanbodrug-microsoft
Copy link
Contributor

Summary of the Pull Request

Turns on FX cop and fixes all errors for the shell plugin.

PR Checklist

  • Applies to [Chore] Enable Static analysis (FxCopAnalyzers) on C# Projects #5129
  • CLA signed. If not, go over here and sign the CLA
  • Tests added/passed
  • Requires documentation to be updated
  • I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx

Info on Pull Request

What does this include?

Validation Steps Performed

Ran shell plugin manually.

… part with the namespace name 'Microsoft.PowerToys.Settings'. Change either name to eliminate the conflict. Microsoft.Plugin.Shell C:\repos\powertoys\src\modules\launcher\Plugins\Microsoft.Plugin.Shell\Settings.cs 9 Active
Error CA1724 The type name Settings conflicts in whole or in part with the namespace name 'Microsoft.PowerToys.Settings'. Change either name to eliminate the conflict. Microsoft.Plugin.Shell C:\repos\powertoys\src\modules\launcher\Plugins\Microsoft.Plugin.Shell\Settings.cs 9 Active
@ryanbodrug-microsoft ryanbodrug-microsoft requested a review from a team August 19, 2020 15:05

// not overriding Win+R
// crutkas we need to earn the right for Win+R override
public bool ReplaceWinR { get; set; } = false;
public bool ReplaceWinR { get; set; }
Copy link
Contributor

Choose a reason for hiding this comment

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

Was the false initialisation removed because we are planning to override Win+R?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alekhyareddy28 . Nope this was to fix CA1805. It is redundant to initialize a field to its default value.

Rule description
The .NET runtime initializes all fields of reference types to their default values before running the constructor. In most cases, explicitly initializing a field to its default value in a constructor is redundant, adding maintenance costs and potentially degrading performance (such as with increased assembly size), and the explicit initialization can be removed.

Copy link
Contributor

@alekhyareddy28 alekhyareddy28 left a comment

Choose a reason for hiding this comment

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

LGTM

@ryanbodrug-microsoft ryanbodrug-microsoft merged commit 79bb68d into microsoft:master Aug 21, 2020
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.

2 participants