Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upFix logic errors in AvoidAlias rule #1251
Merged
Conversation
The first fix is that after the yield return, we should move on to the next command The second fix is that if we find _any_ command, we should not move on to the 'Get-<command>' variant These changes mean that we do not run a pipeline (twice!) to find something that was a cache miss. In the pathological case of a script mmade up of only unique aliases, we would run 2 pipelines for each found alias.
|
One minor suggestion but looks great otherwise. I will modify PR #1178 to not parallelize the AvoidAlias rule any more since with this improvement the rule is no longer the weakest link in the chain |
Co-Authored-By: Christoph Bergmeister [MVP] <c.bergmeister@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
JamesWTruher commentedJun 5, 2019
PR Summary
The first fix is that after the yield return, we should move on to the next command
The second fix is that if we find any command, we should not move on to the 'Get-' variant.
These changes mean that we do not run a pipeline (twice!) to find something that was a cache miss. Previously in the pathological case of a script made up of only unique aliases, we would run 2 pipelines for each found alias. This fix avoids both of those pipeline invocations.
PR Checklist
.cs,.ps1and.psm1files have the correct copyright headerWIP:to the beginning of the title and remove the prefix when the PR is ready.