PowerShell / PowerShell/PSScriptAnalyzer
Rule to enforce strongly typed variables
还没有人认领这个 Issue。
- 主要语言
- C#
- 星标
- 2.2k
- 派生
- 414
- 平均合并
- 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