-
Notifications
You must be signed in to change notification settings - Fork 510
'Select PSScriptAnalyzer rules' command broke starting with preview extension 2019.11.0 #2422
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
I kinda removed it on purpose. Or rather, I didn't add it back in when doing the Omnisharp work. My reasoning was:
I really want this kind of integration but I want to do it better. Also, since PSScriptAnalyzer's 2.0 release is in planning and the settings structure could change as a result, I didn't want to jump into this feature before that. I'd be ok bringing back the experience we already had, but it's not going to be a priority for us right at the moment. |
Yes, the feature is very incomplete and it's probably going to take a long time until it will be implemented. It also has confused user's at time due to the setting not persisting after vs-code closes. I myself use it only to show the default set of PSSA rules at talks and how to enable all rules. |
Looking forward to having 'Select PSScriptAnalyzer Rules' removed from the command palette since it doesn't do anything. Thanks bergmeister for putting a in a pull request! |
As a brand new user to VS Code and using it for PowerShell (and took me hours of searching to find this item after I discovered it didn't work), what ARE the default rules then? Or where can I find the default config file for them? I found the information about creating my own PSScriptAnalyzerSettings.psd1 file and I did get that to work, but having a heck of a time getting the rule set I want. Mainly I want to disable the PSUseDeclaredVarsMoreThanAssignments rule from the default set. so I have this in my .psd1 file: That seems to work as far as disabling that rule, but then I apparently now have a ton of rules enabled that must not be part of the default set. (I see bunches of new warnings that I didn't see before putting this custom settings file in place.) I also see this in the example .psd1 file: but I commented it out because I thought it was only an example and I didn't explicitly want to limit to that rule set if the default is more than that. Or IS that the default rule set? |
@zaphod4254 The default rules enabled in the extension are defined here, which as you noticed are only a small subset of all rules and your approach using a settings file is correct. |
Thank you. The flip question is, how do I know what all of the available rules are, in case I might want to add any of them? |
You can run |
Using 2020.1.0 but I have seen it before the recent update. Going back to previous release, I found that 2019.9.0 was the last version where it still worked therefore it something in between 2019.9.0 and 2019.11.0 ,which is likely going to be the omnisharp refactoring @TylerLeonhardt
System Details Output
Issue Description
Open a PowerShell file to start the extension.
When selecting the 'Select PSScriptAnalyzer rules' nothing happens
Expected Behaviour
A dropdown menu of PSSA rules should come up.
Actual Behaviour
Nothing happens
The text was updated successfully, but these errors were encountered: