Skip to content
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

import not matching what's expected #1771

Closed
DrewDennison opened this issue Oct 1, 2020 · 6 comments · Fixed by #2094
Closed

import not matching what's expected #1771

DrewDennison opened this issue Oct 1, 2020 · 6 comments · Fixed by #2094
Assignees
Labels
bug Something isn't working lang:python priority:medium user:external requested by someone outside of r2c

Comments

@DrewDennison
Copy link
Member

Describe the bug
A clear and concise description of what the bug is.

https://semgrep.dev/s/KdNY/ fails to match the expected lines

To Reproduce
Steps to reproduce the behavior, ideally a link to https://semgrep.dev: https://semgrep.dev/s/KdNY/

Expected behavior
A clear and concise description of what you expected to happen.

$X should include the full path or there should be a way to match the fully qualified import path

$X is just matching a in import a.auth

@DrewDennison DrewDennison added bug Something isn't working user:external requested by someone outside of r2c labels Oct 1, 2020
@mschwager
Copy link
Contributor

See also: #975 (comment)

@aryx
Copy link
Collaborator

aryx commented Oct 2, 2020

I knew you would comment matt :)

@mschwager
Copy link
Contributor

I knew you would comment matt :)

Hah, that's what I'm here for!

@DrewDennison
Copy link
Member Author

@aryx
Copy link
Collaborator

aryx commented Nov 18, 2020

Ok I think I've figured it out! Should be able to fix that soon as well as many related import and aliasing issues.

aryx added a commit that referenced this issue Nov 19, 2020
Fixes #1771

This should also help
#975

Test plan:

$ semgrep -f /tmp/test2.yml tests/python/import_metavar_fullpath.py
running 1 rules...
tests/python/import_metavar_fullpath.py
severity:error rule:tmp.import-auth: spooky import

12:import a.auth
14:import b.auth
16:import a.b.auth
ran 1 rules on 1 files: 3 findings
aryx added a commit that referenced this issue Nov 19, 2020
#2094)

Fixes #1771

This should also help
#975

Test plan:

$ semgrep -f /tmp/test2.yml tests/python/import_metavar_fullpath.py
running 1 rules...
tests/python/import_metavar_fullpath.py
severity:error rule:tmp.import-auth: spooky import

12:import a.auth
14:import b.auth
16:import a.b.auth
ran 1 rules on 1 files: 3 findings
@aryx
Copy link
Collaborator

aryx commented Nov 19, 2020

This works now on develop: https://semgrep.dev/s/KdNY/?version=develop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lang:python priority:medium user:external requested by someone outside of r2c
Development

Successfully merging a pull request may close this issue.

5 participants