-
Notifications
You must be signed in to change notification settings - Fork 395
Include CustomRulePath in Settings file #675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Yes please! |
What about this demand for evolution ? |
We will try to get this thing in in the next couple of releases. |
@kapilmb Do you have any idea what happened? |
I am having the same problem ECNU3D is having. CustomRulePath seems to override IncludeRules and ExcludeRules. |
@ECNU3D @Ryan2065
I agree that the current design does not seem to very intuitive but the current design seems to allow all possible situations.
|
Thanks for the time spent reading the code again. |
It works with VSCode and the command line. |
I'm able to populate the powershell.scriptAnalysis.settingsPath to add my own custom rules and use them alongside default rules but if I try to use 'IncludeRule' or 'ExcludeRule' to be selective about default rules then it breaks all Script Analysis in Visual Studio Code. I've tweaked this over the course of a couple weeks and worked backward from examples like the one given by bergmeister (including all properties) but it simply does not seem to work as advertised. I've tried with both PSScriptAnalyzer version 1.16.1 and 1.17.1, and I've been keeping Visual Studio Code for Windows up-to-date (currently at Version 1.24.0). Can anyone else add custom rules and still pick and choose default rules? |
@GFoxHub Yes, I have used setting files that use custom rules but still use either IncludeRule or ExcludeRule but I think the 2 are mutually exclusive because includerules means that PSSA should use only the specified rules but excluderules means that certain rules should be excluded from the total list of default or custom rules. |
Thanks!! Turns out that I needed to use ExcludeRules instead of ExcludeRule. I figured it would be the latter since that corresponds to the name of the parameter that Invoke-ScriptAnalyzer uses. I even thought that I had tried pluralizing it before, but I probably only tried pluralizing CustomRulePath when I was tinkering with it before. After you referred me to your repo, I realized that I wasn't following your example code as well as I thought I was. |
@GFoxHub Thanks for pointing this out. I did not notice this inconsistency yet and would possibly see this even as a bug although the setting file keys are documented. |
Currently, the settings file can include on the following keys:
IncludeRules
We would like to add
CustomRulePath
andIncludeDefaultRules
to the settings file so that VSCode users can point to such a settings file and run a custom set of rules while authoring PS scripts.The text was updated successfully, but these errors were encountered: