intellij-powershell icon indicating copy to clipboard operation
intellij-powershell copied to clipboard

Support suppressing individual PSScriptAnalyzer rules

Open baltiyskiy opened this issue 4 years ago • 3 comments

For example, I find AvoidAlias rule to be particularly annoying, since I like my code to be concise. I don't want to use Diagnostics.CodeAnalysis.SuppressMessageAttribute in all my scripts just for that.

I think it will be great to do these things:

  1. Add an option to inspection settings to suppress the list of specified rules.
  2. Ideally, PowerShell plugin wouldn't just add one inspection, but add as many inspections as there are rules, and allow to disable them selectively using IDEA's "Disable inspection" quickfix action.
  3. If 2 isn't possible, at least indicate the name of the rule in the message in order to enable using 1.

Depends on

  • [ ] #140

baltiyskiy avatar Apr 15 '20 14:04 baltiyskiy

Thanks for the suggestion! It looks useful.

ant-druha avatar Apr 15 '20 16:04 ant-druha

Maintainer of PSScriptanalyzer here 👋🏻 The intellij extension seems to use PowerShellEditorServices, which has a default set of hard-coded rules here. You can use a PSScriptAnalyzer settings file for what you want, which PowerShellEditorServices supports as well, not sure if the intellij extension provides a way to exposes this API to the user.

bergmeister avatar May 01 '20 20:05 bergmeister

Marking this as blocked on #140 for now.

ForNeVeR avatar Sep 18 '23 22:09 ForNeVeR