PowerShell / PowerShell/PSScriptAnalyzer
Rule to enforce strongly typed variables
還沒有人認領這個 Issue。
- 主要語言
- C#
- 星號
- 2.2k
- 分支
- 415
- 平均合併
- 13 小時 1 分鐘
- 30 天內合併 PR
- 2
描述
Summary of the new feature
Would be nice is PSSA could add a rule that makes sure variables are strongly typed.
Should be an optional rule, disabled by default, to not break with PowerShell default behavior. But for projects where you want high code quality, readability, and the added safety that explicit types can add, it'd be nice with a lint rule to enforce it.
I'm looking into learning Python, and got inspired by tools like:
- mypy: https://mypy-lang.org/, https://github.com/python/mypy
- pylyzer: https://github.com/mtshiba/pylyzer
- ty by Astral: https://docs.astral.sh/ty/, https://github.com/astral-sh/ty, https://github.com/astral-sh/ty-vscode
Proposed technical implementation details (optional)
- Error or warn when no type is used, or generic types like
[object],[array]and[int]. - Require explicit data types.
What is the latest version of PSScriptAnalyzer at the point of writing
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
未指定檔案、測試或進入點。首先檢視 PSScriptAnalyzer 現有的規則架構和連結的型別檢查工具,然後定義選用規則所需的支援型別案例、診斷資訊、組態和測試,該規則預設為停用。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- powershell
- 領域
- tooling
- Issue 類型
- 功能
- 難度
- 5/5
- 預估耗時
- 一週以上
- 活躍度
- 冷清
- 描述清晰度
- 需要釐清
- 新手友好度
- 35/100