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
Add path based rules and pester tests #3182
base: main
Are you sure you want to change the base?
Conversation
foreach ($rule in $pathBasedRules.Keys) { | ||
foreach ($rulePath in $pathBasedRules[$rule]) { | ||
if ($runAll -or $root.PathExists($rulePath)) { | ||
$variables += $rule |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens if you have 2 paths for the same variable? Would we set that variable twice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The break;
below pops us out of the "path" forEach back into the "rule" forEach. So we should only add a rule name once after we find the first matching path for the rule
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rule name is the variable name, so we wouldn't have 2 rules with the same variable name
fixes #3181