-
Notifications
You must be signed in to change notification settings - Fork 587
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
golang package import not binding metavariable #2031
Comments
Possibly related to #1771 |
Also see #2029 |
Looks like we have the same thing in Python: https://semgrep.dev/s/5W70/ However, our Python equivalences mitigate this concern, so we can't really compare the two: https://semgrep.dev/s/GRqq/ I'll have to defer to @aryx on this one. Is it possible to do a similar equivalence as Python and have users specify the fully qualified name, e.g. |
which is ... good? ... but not especially expected. |
log.WithFields(nil).WithError(nil).Info("something") is parsed as |
Note that fully qualifying with logrus.WithError(...).Info(...) currently works for Go too. |
…ame code We used to force to fully qualify entities but this is confusing, especially when you use metavar for imported module/entity which prevent you to reuse the same metavar later. Related to #2029 but this time for expression identifiers (Id), not attributes. Fixes #2031 Note that semgrep-rules will fail because of some code that now correctly match but was not tagged as. I'll fix that later (mutual recursivity issue between CI of semgrep and semgrep-rules). test plan: many test files included make test x
…ame code (#2076) We used to force to fully qualify entities but this is confusing, especially when you use metavar for imported module/entity which prevent you to reuse the same metavar later. Related to #2029 but this time for expression identifiers (Id), not attributes. Fixes #2031 Note that semgrep-rules will fail because of some code that now correctly match but was not tagged as. I'll fix that later (mutual recursivity issue between CI of semgrep and semgrep-rules). test plan: many test files included make test x
The snippet below works if you use a generic metavariable (eg $X) for the line inside $F, but not if you try to re-reference the $P metavar from the import.
https://semgrep.dev/s/3e7K
The text was updated successfully, but these errors were encountered: