-
Notifications
You must be signed in to change notification settings - Fork 395
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
Add new rule for flask-route-decorator #3244
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
I signed the CLA but that message doesn't get resolved for some reason. |
It looks like Semgrep does not take the order of decorators into account currently: https://semgrep.dev/playground/s/pKLAZ While your regex is a nice workaround, I am reporting this as a bug/feature request so that we can avoid complex regexes for this. There are other route decorators in Flask besides the I've annotated a few more things you should change for the CI checks to pass. |
def f(): | ||
pass | ||
|
||
# ok: Correct order |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
def f(): | ||
pass | ||
|
||
# ok: "func" not "route" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
def f(): | ||
pass | ||
|
||
# ok: Correct order with app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
def f(): | ||
pass | ||
|
||
# ok: 2 routes are independent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
Co-authored-by: Pieter De Cremer (Semgrep) <pieter@r2c.dev>
Wahoo! New published rules with khanhldt.pnbj from @khanhldt.
See semgrep.dev/s/2ZJ3Y for more details.
Thanks for your contribution! ❤️