-
-
Notifications
You must be signed in to change notification settings - Fork 615
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
Check for hardcoded passwords in class attributes #766
Check for hardcoded passwords in class attributes #766
Conversation
B105:hardcoded_password_string currently throws an error for string literal variables, dictionary keys, and comparisons which look like passwords, but does not create an error for class attributes which look like passwords. For example password = "mypassword" and password == "mypassword" would create an error, but my_object.password = "mypassword", and my_object.password == "mypassword" would not. This behavior is unintuitive. Resolves PyCQA#759
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.
There are no tests here that validate that this will not regress or that this works in the first place.
Shoot, sorry about that. d038529 Adds tests for the new functionality. |
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.
LGTM
@sigmavirus24 The included additional tests look good to me. Wanna take a look? |
B105:hardcoded_password_string currently throws an error for string
literal variables, dictionary keys, and comparisons which look like
passwords, but does not create an error for class attributes which look
like passwords.
For example password = "mypassword" and password == "mypassword"
would create an error, but my_object.password = "mypassword",
and my_object.password == "mypassword" would not.
This behavior is unintuitive.
Resolves #759