PowerShell / PowerShell/PSScriptAnalyzer

PSSA 2.0 Roadmap

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

还没有人认领这个 Issue。

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

描述

Note: this is meant to be a living artifact for discussing, and tracking the 2.0 milestone

PSSA 2.0 Roadmap

PSScriptAnalyzer 2.0 is a major architecture of the PSScriptAnalyzer (PSSA) module, a static code checker for PowerShell modules and scripts which provides linting and formatting for PowerShell Editor Services.

Motivation

The goals and uses of PSSA have evolved since the module was first developed as a prototype in 2015. The heavy use of the module in PowerShell Editor Services mean that embeddability and interuptability are new priorities. This integration scenario also amplifies the benefit of gains made to the performance and stability of the module.

As we continue to ship new versions of PowerShell across many platforms, the number of possible version and platform targets multiplies.
Therefore it is a growing priority to supplement these PowerShell releases with tooling that allows for script migration, as well as targeted authoring to specific PowerShell versions ands platforms.
This compatibility framework allows module authors to contribute the PowerShell ecosystem while still being able to target users who may be on other versions of PowerShell or develop on other platforms.

The role of PSSA in CI/CD pipelines presents a priority for better custom rule customization and configuration.
The integration point of PSSA in Visual Studio Code provides opportunities for reliable, customizable rule configuration (and authoring) in a familiar interface.

Because of constraints in the current design of this module, the most efficient way to maximize these improvements to the module are through a re-architecture of the module.
This approach allows us to optimize the way PSSA works (rule metadata, how PowerShell engine is called etc.) as a core components of improving the end user experience.

Goals

  1. Improved performance and stability, especially for the VSCode extension
  • Top priority is formatting rules
  • Next target is for current 5 slowest rules which generate the bottleneck
  • Goal is to reduce the number of passes through the PowerShell parser, and the need to generate instances of PowerShell
  1. PSSA can be easily integrated into other applications (embeddability)
  • PSSA can be read in a thread safe way with or without PowerShell
  • Top embeddability scenario is editor services
  • Next target scenario is CI/CD systems
  1. Compatibility rules are easy to create, configure, and run.
  • Simplified process for installing profiles and naming conventions
  • Improving this experience is partially reliant on easier generation of profiles
  1. Rule customization (users writing their own rules) and configuration (for built in and custom rules) should be straightforward, reliable, and consistent
  • Rules are written in C# and PS Script and configured with JSON
  • Easier targeting for rule suppression (within code—comment based, within workspaces, and globally)
  • Rules can be packaged and shared as nuget packages or modules
Stretch goal

As a PowerShell user I only need the latest version of PowerShell on my dev box regardless of platform or PowerShell version I will eventually deploy my script on.

Scenarios and Issues

High Level Scenario Sub Scenario Implementation notes Issues Status
Improved performance and stability, especially for the VSCode extension Performance of Formatting Rules Formatter should be run in parallel #1480 Not Started
Not Started
Target speed of Five Slowest Rules Reduce/Cache calls to Get-Command: Slow rules are because of Get-Command calls Not Started
Optimize cache with consideration to speed and memory (consider a two-level cache) Not Started
Improve how the cache is queried Not Started
Reduce the number of passes through the PowerShell parser Not Started
Reduce the need to generate instances of PowerShell Better rule meta-data (clear rule types: formatting, diagnostic; needs PowerShell vs doesn’t) Not Started
PSSA can be easily integrated into other applications (embeddability) PSSA can be read in a thread safe way with or without PowerShell Not Started
PSSA as a standalone executable Analysis as a service Not Started
PSSA can be well integrated with editor services Async analysis (interuptability is key) #1482 Not Started
Better Rule APIs Not Started
Support running in constrained language mode #1502 Not Started
Intellisense support for rule configuration Not Started
PSSA can be well integrated within CI/CD Not Started
Compatibility rules are easy to create, configure, and run Simplified process for installing profiles and naming conventions Easier language version targets/parser integration #1484 Not Started
Easy generation of compatibility profiles Not Started
Rule customization (users writing their own rules) and configuration (for built in and custom rules) should be straightforward, reliable, and consistent Rules are written in C# and PS Script Not Started
JSON for configuration #1479, #1279 Not Started
Easier targeting for rule suppression (within code—comment based, within workspaces, and globally) #1483, #1347 Not Started
Rules can be packaged and shared as nuget packages or modules Not Started
Proper global settings #1484, #1224 Not Started
General User Experience Clear documentation #1487 Not Started
Robust testing #1488 Not Started
Performance testing? Not Started
Stress testing? Not Started

贡献指南

打开贡献指南

从这里开始

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

调研方向

从 PSSA 2.0 Roadmap 开始,审阅其中引用的问题,包括 #1480、#1482、#1502、#1484、#1479、#1279、#1483、#1347 和 #1224。只有在一个具体的 roadmap 项目具有明确的范围和实现路径时,贡献才算完成;仅凭此 issue 无法确定文件、测试或入口点。

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

评估

技术栈
csharp, json
领域
developer-experience, tooling
Issue 类型
重构
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
18/100

把新 issue 发到你的邮箱

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