-
Notifications
You must be signed in to change notification settings - Fork 510
Set the powerShell.scriptAnalysis.settingsFilePath setting to a default for auto-discoverability #2190
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
This also aligns with |
Good idea, never thought of it but totally makes sense. You already said that we'll have to check for existence of the file first, I don't anticipate any issues with the rest. What would be nice as well is to tell the user if there was an error because starting with PSSA 1.18.3 error messages due to invalid syntax in the setting files are actually useful/actionable. |
Implementing this will fix #2287. |
I've looked into trying to auto-discover the default PSSA settings file a few weeks ago but the straightforward implementation somehow did not work end to end as I expected so it seems to be more complex than I originally thought it would be, therefore I've parked it for the moment |
It might be worth waiting for PowerShell/PowerShellEditorServices#1078 as that's deleting a ton of code. |
I have an issue with relative path with version I can only use the full path. Relative won't work. I tried both From pses output:
Note file: in the middle When specifying the full path, it works correctly. |
@bgelens Your scenario should definitely work (at least I know that it does on Windows). I vaguely remember there was a temporary issue with it at the end of the year 2019 but that should've been fixed now. Is it working for you at least with the 'stable' extension or a previous version of the preview extension? Also, can you try to do this on a normal folder and not OneDrive, maybe that's the cullprit. |
Normal folder preview extension:
When switching to the stable extension, it works fine. So the issue is with preview only |
@bgelens your issue was fixed in PowerShell/PowerShellEditorServices#1161 - a fix I made a few days after the last release... so it's pending a release. Sorry about that. |
Summary of the new feature
Most linter tools automatically pick up the config file from the root of your workspace. We should do the same.
I'd like to set the default value for
powerShell.scriptAnalysis.settingsFilePath
toPSScriptAnalyzerSettings.psd1
which means that if there is aPSScriptAnalyzerSettings.psd1
in the root of the workspace, we will automatically use it.If a user doesn't want this, they can opt out via:
but PSSA integration is one of our flagship features so we should streamline the experience.
Also, the user can still set it to something else if they so choose.
Proposed technical implementation details (optional)
Setting the default value for
powerShell.scriptAnalysis.settingsFilePath
toPSScriptAnalyzerSettings.psd1
. Making sure our code is resilient if the file doesn't exist.I need to hear what @bergmeister has to say about this. Among anyone else :)
The text was updated successfully, but these errors were encountered: