| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Awesome Liam Peters (@liamjpeters) . I will try to take some time soon to review this and all your other good work that I've glanced over. Thanks for your patience in the meantime, definitely excited to get your changes in. |
Sorry, something went wrong.
There was a problem hiding this comment.
This looks great, thanks!
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Summary
When CheckParameter is $true for the rule PSUseConsistentWhitespace, it checks whitespace between parameters by inspecting the AST. It gets all direct children of each CommandAst and checks, in order, that each's extent is separated by exactly 1 character.
This relies on the implicit assumption that the AST returns the children in something resembling token order.
In the case of redirect operators, this is not always the case (they anecdotally appear to be returned in the order of the stream they're redirecting). See the issue here for more detailed breakdown.
This PR adds sorting of the children before subsequently performing the same checks on the tokens extents.
Running the below across PS5.1 and PS7.4 with and without the PR change applied shows the performance impact of the change to be minimal.
Fixes #2000
PR Checklist