Skip to content

Enable enforcing consistent casing #1332

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

Open
chriskuech opened this issue Sep 10, 2019 · 2 comments
Open

Enable enforcing consistent casing #1332

chriskuech opened this issue Sep 10, 2019 · 2 comments

Comments

@chriskuech
Copy link

Summary of the new feature

PowerShell code used in official examples and VS Code code generation seems to follow some basic casing conventions:

  • PascalCase for
    • cmdlets
    • parameters
    • constants
  • lowercase for
    • operators
    • statements (if, foreach, etc)
  • camelCase for
    • local variables
  • casing of module names and .NET types, enum values, etc consistent with their original case-sensitive casing

I would like to optionally enforce these casing conventions with PSScriptAnalyzer.

Proposed technical implementation details (optional)

I would like to enable rules in my PSScriptAnalyzerSettings.psd1 that enforce the casing rules above and autofix casing issues.

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

@bergmeister
Copy link
Collaborator

I added a new rule usecorrectCasing that does it for cmdlet names as a starter. This rule can be enhanced for some of your cases.

@xtqqczze
Copy link

Opened #1401 for casing of automatic variables.

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

3 participants