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

Add rules for Named/Positional Parameter use on object creation #2006

Open
kilasuit opened this issue Jun 2, 2024 · 1 comment
Open

Add rules for Named/Positional Parameter use on object creation #2006

kilasuit opened this issue Jun 2, 2024 · 1 comment

Comments

@kilasuit
Copy link
Contributor

kilasuit commented Jun 2, 2024

*Summary of the new feature
This PR in PowerShell - Add support for named argument with .NET Methods will add additional functionality which would be useful to add some rules around it's use to aid in coding styles, not only to aid in coding style but to reduce errors in use

Examples & levels that I think would be useful include

  • Avoid mixing named & positional parameters on object creation (Information)
  • Use only named parameters for object creation (Information)
  • Use only positional parameters for object creation (Warning) (for backcompat checks

What is the latest version of PSScriptAnalyzer at the point of writing
1.22.0

@SydneyhSmith
Copy link
Collaborator

Thanks @kilasuit would love to see more discussion around, thanks for flagging this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants