-
Notifications
You must be signed in to change notification settings - Fork 510
Provide a way to save rule list selected with "Select PSScriptAnalyzer Rules" menu #823
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
And optionally create that file if it doesn't exist and wire it up through .vscode\settings.json. Yeah, that'd be nice too. |
Yep, definitely. However, I'd prefer if we could just be smart and detect a PSScriptAnalyzerSettings.psd1 file in the workspace root without the user having to configure it. I think PSScriptAnalyzer does this already but I'm not sure. |
Thanks @daviwil! Weighing out whether I think it would be more valuable as a workspace setting or a user setting, if that's even feasible. Generally I would like the same rules turned on regardless of the project, but I can see how that may not be the right approach. |
Agreed as long as folks are OK that "by convention" we automatically find a file by that name. BTW is it PSScriptAnalyzerSettings.psd1 or ScriptAnalyzerSettings.psd1? And if the user chooses to use a different name (or location - perhaps in a subdir like src or source), then they'll have to tell us the path to the file. I also like the idea that the UI mechanism is merely a UI over the corresponding settings file and not another way to manage rules.
@mattmcnabb |
@rkeithhill I see your point. I think the workspace file would be just fine, and it makes sense to include these settings with a project, to help encourage coding standards for all project contributors. I'm used to flying solo on projects so bad habits prevail ;) Since I can use a settings file already, the UI itself is not that important to me. For my part, you can keep the menu in place or scrap it altogether. Mainly it just seemed counter-intuitive that the menu changed the settings but did not keep them. Seemed like a breach of contract. |
Seemed like a breach of contract. +1 |
Just to offer my two cents, while supporting the full config file is good, shouldn't it also be directly exposed through vscode's json settings? The vast majority of users are just going to want to turn one or two checks off (probably PsAvoidUsingCmdletAliases). |
When the user uses the "Select PSScriptAnalyzer Rules" menu we currently don't persist those selections past the current session. We should provide an option in that menu which allows the user to save the current rule selection to a PSScriptAnalyzerSettings.psd1 file in their workspace path.
/cc @mattmcnabb
The text was updated successfully, but these errors were encountered: