Fix GetLocationCommand output type parameter set and style issues#8324
Fix GetLocationCommand output type parameter set and style issues#8324iSazonov merged 12 commits intoPowerShell:masterfrom Meir017:patch-1
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.
the output was set to a non existing ParameterSetName
|
CodeFactor fails because of |
iSazonov
left a comment
There was a problem hiding this comment.
Please use our template for PR description.
src/Microsoft.PowerShell.Commands.Management/commands/management/Navigation.cs
Outdated
Show resolved
Hide resolved
| /// <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.
Please remove such obvious comments. I see they already was there but it is bad pattern.
Below too.
| return; | ||
| } | ||
| } | ||
| } // ProcessRecord |
There was a problem hiding this comment.
Please remove the comment.
| _names = value; | ||
| } // set | ||
| } // LiteralName | ||
| } // |
| } | ||
| get => _force; | ||
| set => _force = value; | ||
| } // Force |
There was a problem hiding this comment.
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
locationSetto use the constant fieldLocationParameterSet.Fix style issues in Navigation.cs.
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files 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?