-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
enhancementThe issue is an enhancement request.The issue is an enhancement request.help wantedThe issue is up for grabs for anyone in the community.The issue is up for grabs for anyone in the community.
Description
The PSSA test source/Tests/QA/PSSAResource.common.Tests.ps1 currently ignores a repository's Script Analyzer file. I Script Analyzer file can be used to add additional custom rules that should only be run for the repository.
Script Analyzer is run with a settings file like this.
Invoke-ScriptAnalyzer -Path .\output\SqlServerDsc\15.0.1\DSCResources\**\*.psm1 -Recurse -Settings .\.vscode\analyzersettings.psd1
But a better option would be to allow custom rule paths to be specified in the build configuration file build.yml under the key DscTest: together with an option to include additional rules (if the rules are not prefixed with Measue-*).
The custom rule paths that is set must point to one or more module or module files. Since Script Analyzer must be called like this:
Invoke-ScriptAnalyzer `
-Path .\output\SqlServerDsc\15.0.1\DSCResources\DSC_SqlTraceFlag\*.psm1 `
-CustomRulePath @(
'.\output\RequiredModules\DscResource.AnalyzerRules'
'.\tests\QA\AnalyzerRules\SqlServerDsc.AnalyzerRules.psm1'
) `
-IncludeRule @('Measure-*')
Metadata
Metadata
Assignees
Labels
enhancementThe issue is an enhancement request.The issue is an enhancement request.help wantedThe issue is up for grabs for anyone in the community.The issue is up for grabs for anyone in the community.