-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Fix GetLocationCommand output type parameter set and style issues #8324
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
Conversation
[OutputType(typeof(PathInfo), ParameterSetName = new string[] { "locationSet" })] | ||
[OutputType(typeof(PathInfoStack), ParameterSetName = new string[] { "Stack" })] | ||
[Cmdlet(VerbsCommon.Get, "Location", DefaultParameterSetName = locationSet, SupportsTransactions = true, HelpUri = "https://go.microsoft.com/fwlink/?LinkID=113321")] | ||
[OutputType(typeof(PathInfo), ParameterSetName = new string[] { locationSet })] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the output was set to a non existing ParameterSetName
CodeFactor fails because of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use our template for PR description.
src/Microsoft.PowerShell.Commands.Management/commands/management/Navigation.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Meir017 Please add more information in PR description about that you want fix. It is not clear wgy you remove GetResolvedPaths
and RenameItem
.
/// <summary> | ||
/// The string declaration for the Location parameter set in this command. | ||
/// </summary> | ||
private const string PathParameterSet = "Path"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove such obvious comments. I see they already was there but it is bad pattern.
Below too.
@@ -3739,7 +3755,7 @@ private void RenameItem(string path, bool literalPath = false) | |||
pathNotFound)); | |||
return; | |||
} | |||
} | |||
} // ProcessRecord |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the comment.
set | ||
{ | ||
base.SuppressWildcardExpansion = true; | ||
_names = value; | ||
} // set | ||
} // LiteralName | ||
} // |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove //
_force = value; | ||
} | ||
get => _force; | ||
set => _force = value; | ||
} // Force |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove '// Force'
@Meir017 Please look test failures - something was broken in first commits. |
@iSazonov btw to remove the |
@iSazonov Done |
@Meir017 Thanks for your contribution! Could you please look CodeFactor issues https://www.codefactor.io/repository/github/powershell/powershell/pull/8324 ? |
many of the changes are about the file |
Don't worry too much about anything that's in code files you haven't touched; just focus on the handful that are in or around the code you've modified. 😄 |
Restart CI-macos. |
@Meir017 Thanks for your contribution! |
PR Summary
Fixes the GetLocationCommand output type parameter-set from the non-existing
locationSet
to use the constant fieldLocationParameterSet
.Fix style issues in Navigation.cs.
PR Checklist
.h
,.cpp
,.cs
,.ps1
and.psm1
files have the correct copyright headerWIP:
to the beginning of the title and remove the prefix when the PR is ready.[feature]
if the change is significant or affects feature testsperhaps all of the parameter-set-names constants should be in a single place since many of then are used in multiple commands
maybe move them into the base class?