FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add UseConsistentParametersKind rule by Haimasker · Pull Request #2149 · PowerShell/PSScriptAnalyzer · GitHub

Add UseConsistentParametersKind rule - #2149

Merged
Andy Jordan (andyleejordan) merged 3 commits into
PowerShell:mainfrom
Haimasker:use-correct-parameters-definition-type-rule
Mar 17, 2026
Merged

Add UseConsistentParametersKind rule#2149
Andy Jordan (andyleejordan) merged 3 commits into
PowerShell:mainfrom
Haimasker:use-correct-parameters-definition-type-rule

Conversation

Copy link
Copy Markdown
Contributor
  • Consistent function parameters definition

  • Rule is disabled by default

  • Possible types of preferred function parameters are: "Inline", "ParamBlock"

PR Summary

This PSScriptAnalyzer rule enforces uniform parameter definitions ("Inline" or "ParamBlock") across functions, improving code readability and maintainability.

Key Benefits:

  1. Consistency: Standardizes parameter style project-wide, making code easier to read and extend.
  2. Advanced Attributes: param block provides CmdletBinding(), OutputType(), and other advanced attributes. On the other hand, these attributes can be blocked by using inline parameters.

PR Checklist

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

Copy link
Copy Markdown
Contributor Author

Sean Wheeler (@sdwheeler) Mikey Lombardi (He/Him) (@michaeltlombardi) Christoph Bergmeister (@bergmeister)
Sorry for additional tagging, but when a merge request review can be expected?

Thank you in advance.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks for your contribution and sorry for late review. I added Andy as well as he is the main code owner.
The rule might be a bit controversial as for some folks there is no 'correct' kind, therefore I suggest to name rule UseConsistentParametersKind for consistency with other rule names

Comment thread docs/Rules/README.md Outdated
Comment thread docs/Rules/UseCorrectParametersKind.md Outdated
Comment thread docs/Rules/UseCorrectParametersKind.md Outdated
Denis Melnikov (Haimasker) force-pushed the use-correct-parameters-definition-type-rule branch from 0337dfe to eb46fe4 Compare February 14, 2026 10:18
Denis Melnikov (Haimasker) changed the title Add UseCorrectParametersKind rule Add UseConsistentParametersKind rule Feb 14, 2026
* Consistent function parameters definition

* Rule is disabled by default

* Possible types of preferred function parameters are: "Inline",
"ParamBlock"
Denis Melnikov (Haimasker) force-pushed the use-correct-parameters-definition-type-rule branch from eb46fe4 to ebd9efa Compare February 14, 2026 11:06

Copy link
Copy Markdown
Contributor Author

Sean Wheeler (@sdwheeler) Mikey Lombardi (He/Him) (@michaeltlombardi)
Since you are the code owners of the repository, could you please review the PR?

Copy link
Copy Markdown
Collaborator

Denis Melnikov (@Haimasker) Already pinged Andy Jordan (@andyleejordan) internally a couple weeks ago as he is main maintainer, it's on his list, please be patient.

Andy Jordan (andyleejordan) merged commit 520d2aa into PowerShell:main Mar 17, 2026
4 checks passed

Copy link
Copy Markdown
Member

Thanks!

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

4 participants


Back | FazBrowse Home | New Git URL