Replies: 1 comment 2 replies
-
|
Stdlib functions usually contain some levels of abstraction/optimisation that a manual impl would not e.g. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Would it be possible search user code using AST-style pattern rather than implementing lint search logic by hand (where it makes sense)?
This is similar to what ast-grep does, except that the actual search patterns would come from the existing stdlib functions, plus ideally it should be after the type resolution.
This way #16166 and similar lints would not even be needed. I do suspect there will be a significant number of false-positives which may need some way to be excluded.
Example
User code looks identical to what
Slice::getdoes, so it would be found automatically without creating a specific lint:Beta Was this translation helpful? Give feedback.
All reactions