PowerShell / PowerShell/PSScriptAnalyzer
Make custom rule name consistent
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2.2k
- Forks
- 414
- Avg merge
- 13h 1m
- Merged PRs (30d)
- 2
Description
Apologies if I am repeating something or if this has been discussed already. This is mostly an re-iteration of https://github.com/PowerShell/PSScriptAnalyzer/issues/1140#issuecomment-488251888
As of now, custom rule names are inconsistent across various places.
- At first, there are no indication about function name in the ScriptRuleDocumention.md . But PSSA is completely depends on
$MyInvocation.InvocationNamefor rule/violation name - I can not really have a customized rule name, it should be the name of the PS function. That gives me a weird naming of rules like
Measure-Something. On the other I can ship the violation with whatever name I like which has no value and can break things. - While suppressing a custom rule, I will have to provide
<ModuleName>\<RuleName>. That would end up something like,FooBar\Measure-Something- I really do not like this convention as I do not want the developer to be aware of the module name or the function name.
- It gets worst further, While filtering a rule, I can not follow the same convention, it has to be the name whatever the function name.
Invoke-ScriptAnalyzer -IncludeRule Measure-Something -ExcludeRule Measure-SomethingElse
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 with ScriptRuleDocumentation.md and the Invoke-ScriptAnalyzer IncludeRule/ExcludeRule and suppression behavior described here; review the linked issue discussion for prior context. Done means the naming convention for custom rules is decided and applied consistently across documentation, violation names, suppression, and filtering.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100