-
Notifications
You must be signed in to change notification settings - Fork 49
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
Include local not automatically being enabled for default module baseline #1506
Comments
When we do not add Based on that statement, we would expect our custom rules to be included because we're not specifying a baseline in the command. We're letting the Module select the So, to get our custom rules included when using a module, we either need to tag all of our custom rules so that they match the default baseline in the module, or we need to include |
@tstooke Looking at this issue. Testing locally, trying to reproduce. Are you able to advise if you have any configuration set within |
@BernieWhite We do have a handful of Azure rules listed under # Require minimum versions of modules.
requires:
PSRule: '>=2.8.1'
PSRule.Rules.Azure: '>=1.26.1'
output:
culture:
- 'en-US'
binding:
targetType:
- 'resourceType'
- 'type'
rule:
exclude:
- Azure.Resource.UseTags
- Azure.Redis.MinSku
# others, as well When we execute $config = @{
AZURE_BICEP_FILE_EXPANSION = $True
AZURE_BICEP_CHECK_TOOL = $True
AZURE_BICEP_MINIMUM_VERSION = "0.16.2"
AZURE_BICEP_FILE_EXPANSION_TIMEOUT = 120
}
$options = New-PSRuleOption `
-NotProcessedWarning $False `
-InputPathIgnore @("*", "!**/*.tests.bicep") `
-RuleIncludeLocal $True `
-Configuration $config
Assert-PSRule -Module "PSRule.Rules.Azure" -Path "./.ps-rule/" -Format File -InputPath '.' -Option $options |
Description of the issue
When using a module, if the module specifies a default baseline local rules should automatically be included based on the principal of least surprise (Customers would expect local rules to be automatically processed).
However currently when using a module such as PSRule for Azure which specifies a default baseline, local rules are not automatically included.
Local rules are included when the
Rule.IncludeLocal
option is explicitly set totrue
.Additional context
Related to discussion here #1504.
The text was updated successfully, but these errors were encountered: