Skip to content

Proposal: Enforce lowercase keywords #1059

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

Merged
merged 2 commits into from
May 18, 2022
Merged

Proposal: Enforce lowercase keywords #1059

merged 2 commits into from
May 18, 2022

Conversation

bill-long
Copy link
Member

Issue:

We have no consistent formatting of keywords. In some scripts, keywords change cases every few lines.

PoshCode says keywords should be lowercase.

PSScriptAnalyzer is most likely headed for a keywords-must-be-lowercase rule. There are multiple issues open, but no one has done the work yet. You can start following the trail of issues at PowerShell/PSScriptAnalyzer#767.

Fix:

Until PSScriptAnalyzer adds this check, add our own check.

@bill-long
Copy link
Member Author

I am purposely letting the build fail until we discuss this. If we decide to move forward, this rule will update 249 scripts in the repo.

@dpaulson45
Copy link
Member

Issue has been open for a while, might need to do a PR ourselves to get that addressed in the PSScriptAnalyzer. But for now, let's just do this.

@bill-long bill-long merged commit da479b7 into main May 18, 2022
@bill-long bill-long deleted the bilong-keywordcasing branch May 18, 2022 16:17
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.

2 participants