PowerShell / PowerShell/PSScriptAnalyzer

Enable enforcing consistent casing

未關閉
#1,332 2 則留言 5 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

Area - Formatter Issue - Enhancement Up-for-Grabs
主要語言
C#
星號
2.2k
分支
415
平均合併
13 小時 1 分鐘
30 天內合併 PR
2

描述

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

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

首先檢視 issue 中提出的大小寫慣例,以及 PSScriptAnalyzer 設定如何啟用規則。完成的內容應包括對所列大小寫類別的選擇性強制執行和 autofix 支援,並定義對保留原始大小寫的模組名稱以及已定義 .NET 型別的行為。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
powershell
領域
tooling
Issue 類型
功能
難度
5/5
預估耗時
一週以上
活躍度
停滯
描述清晰度
需要釐清
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。