-
Notifications
You must be signed in to change notification settings - Fork 6
Semgrep Showcase #10
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
Semgrep Showcase #10
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import os, sys # F401: sys imported but unused | ||
|
||
|
||
def my_function( x, y ): | ||
print( "Result:",x+y ) # E201, E202, E231, E221 | ||
|
||
|
||
class myclass: # N801: class name should use CapWords convention | ||
|
||
def __init__(self): | ||
self.value =42 # E225: missing whitespace around operator | ||
|
||
|
||
def doSomething(self): # N802: function name should be snake_case | ||
if( self.value>0 ): | ||
print("Positive") | ||
else: | ||
print( "Not positive" ) | ||
|
||
|
||
my_function(1,2) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
rules: | ||
- id: hardcoded-password | ||
pattern: password = "$SECRET" | ||
message: "Avoid hardcoded passwords" | ||
severity: ERROR | ||
languages: [python] | ||
metadata: | ||
category: security |