PowerShell / PowerShell/PSScriptAnalyzer
Rule severity vs diagnostic severity
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2.2k
- Forks
- 414
- Avg merge
- 13h 1m
- Merged PRs (30d)
- 2
Description
From https://github.com/PowerShell/PSScriptAnalyzer/issues/1610.
One consideration that comes up when authoring rules is:
- Rules can have a "severity"
- The individual diagnostics can also have a "severity"
When we configure things, this creates the issue of:
- Does a configured severity refer to a filter on rules or diagnostics?
- If it's rules, how do rules perform broad analysis on a topic area and possibly output diagnostics of different severity?
- Should rules designate their severity as the highest severity they may emit? If so, how do we enforce that statically?
- If it's diagnostics, how do we ensure rules are run efficiently? If we can't statically determine ahead of time which rules will emit diagnostics of the right severity, are we forced to always run all the rules?
We could potentially offer both configurations, but I personally think this is an unhelpful level of granularity to offer to users, since we should work to make the concept of Severity a simple and monolithic one.
My current view on this is:
- Configured severity refers to rules to run
- Rules should be marked with the highest severity they can emit
- We should run all such rules and then filter out any diagnostics of unwanted severities
But that's just while I'm thinking on it now, and I'd like to open this question up for discussion
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the linked PSScriptAnalyzer issue #1610 and the severity discussion here. Determine whether the project has an existing rule or diagnostic severity configuration to anchor the decision; done would require an agreed severity model and an implementation scope, neither of which this issue specifies.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, powershell
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100