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

Make documentation of AvoidUsingPositionalParameters match the implementation #867

Conversation

bergmeister
Copy link
Collaborator

@bergmeister bergmeister commented Feb 3, 2018

PR Summary

Closes #863

The above PR found some problems that were due to the documentation not being updated in PR 306 that changed the AvoidUsingPositionalParameters rule to only be triggered on 3 or more parameters

PR Checklist

Note: Tick the boxes below that apply to this pull request by putting an x between the square brackets. Please mark anything not applicable to this PR NA.

  • PR has a meaningful title
    • Use the present tense and imperative mood when describing your changes
  • Summarized changes
  • NA User facing documentation needed
  • Change is not breaking
  • NA Make sure you've added a new test if existing tests do not effectively test the code changed
  • This PR is ready to merge and is not work in progress
    • If the PR is work in progress, please add the prefix WIP: to the beginning of the title and remove the prefix when the PR is ready

@LaurentDardenne
Copy link

For simple CmdLets with only a few parameters, the risk is much smaller and in order for this rule to be not too noisy, this rule gets only triggered when there are 3 or more parameters supplied.

Specify positional parameters.

Can be added in a note something examples of cases considered acceptable:

Test-Path $Path
New-Object System.IO.FileInfo $Path
Where-Object {$_ -ne $Null}
Write-Host "Message"

And this in order to understand why we want to apply a rule but without being constrained by a strict application of the same rule.

@JamesWTruher JamesWTruher merged commit b5afd5d into PowerShell:development Feb 6, 2018
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.

AvoidUsingPositionalParameters does not seem to be triggered
3 participants