Skip to content
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

Where is PSScriptAnalyzerSettings.psd1 supposed to be stored? #489

Open
DennisL68 opened this issue Aug 15, 2024 · 1 comment
Open

Where is PSScriptAnalyzerSettings.psd1 supposed to be stored? #489

DennisL68 opened this issue Aug 15, 2024 · 1 comment
Labels
enhancement The issue is an enhancement request. good first issue The issue should be easier to fix and can be taken up by a beginner to learn to contribute on GitHub help wanted The issue is up for grabs for anyone in the community.

Comments

@DennisL68
Copy link

DennisL68 commented Aug 15, 2024

In the default module.tests.ps1, the ScriptAnalyzer rules are fetched using $scriptAnalyzerRules = Get-ScriptAnalyzerRule.

But where should I store the PSScriptAnalyzerSettings.psd1 file, if I'd like to use different settings for different modules?

@johlju
Copy link
Collaborator

johlju commented Aug 15, 2024

In the default module.tests.ps1, the ScriptAnalyzer rules are fetched using $scriptAnalyzerRules = Get-ScriptAnalyzerRule.

That is only used to determine if the tests should be run or skipped.

But where should I store the PSScriptAnalyzerSettings.psd1 file, if I'd like to use different settings for different modules?

Current module.tests.ps1 does not support that as that is something that need to be passed to Invoke-ScriptAnalyzer. The QA tests could be improved to use a script analyzer settings file. Preferably is should use the same one that is located in the .vscode folder that is also used by the PowerShell extension in VS Code.

@johlju johlju added enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community. good first issue The issue should be easier to fix and can be taken up by a beginner to learn to contribute on GitHub labels Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue is an enhancement request. good first issue The issue should be easier to fix and can be taken up by a beginner to learn to contribute on GitHub help wanted The issue is up for grabs for anyone in the community.
Projects
None yet
Development

No branches or pull requests

2 participants