Rule to enforce strongly typed variables

未关闭
#2,137 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
冷清
技术栈
powershell
领域
tooling

调研方向

未指定文件、测试或入口点。首先审查 PSScriptAnalyzer 现有的规则架构和链接的类型检查工具,然后定义可选规则所需的受支持类型情况、诊断信息、配置和测试,该规则默认禁用。

由索引模型根据 Issue 内容生成。

描述

Issue - New Rule Up-for-Grabs

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:

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

主要语言
C#
星标
2.2k
派生
415
平均合并
13 小时 1 分钟
30 天内合并 PR
2

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

PowerShell/PSScriptAnalyzer 的其他 Issue

查看 PowerShell/PSScriptAnalyzer 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。