Scan nested expressions#1504
Merged
anderseknert merged 1 commit intomainfrom Apr 28, 2025
Merged
Conversation
7253f37 to
56b10fe
Compare
A few of the first Regal rules only ever checked the top level of a body, and would not traverse into e.g. comprehensions or every bodies. This has been annoying for long, and while doing this properly is certainly more expensive (+2 million allocs) I think we can afford that at this point in order to prioritize correctness. May very well be that many will have Regal find "new" issues in the next version due to this. Also: - We now also separate ast.found.references and ast.found.calls. This too comes at a cost, but makes it much more obvious what our code is doing, and we can now afforc prioritizing that too. - Improve `narrow-argument` rule to also take array indices into account for narrowing (i.e. only `arr[1].value[0]` referenced) - Fix new golangci-lint rule that says public functions should be above private ones. Fixes #82 Signed-off-by: Anders Eknert <anders@styra.com>
56b10fe to
35eafec
Compare
srenatus
approved these changes
Apr 28, 2025
Contributor
srenatus
left a comment
There was a problem hiding this comment.
The internal/lsp code moves seem unrelated, but OK.
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A few of the first Regal rules only ever checked the top level of a body, and would not traverse into e.g. comprehensions or every bodies. This has been annoying for long, and while doing this properly is certainly more expensive (+2 million allocs) I think we can afford that at this point in order to prioritize correctness. May very well be that many will have Regal find "new" issues in the next version due to this.
We now also separate
ast.found.referencesandast.found.callsinstead of collecting both underast.found.references. This too comes at a cost, but makes it much more obvious what our code is doing, and we can now afford prioritizing that too.Fixes #82