Add input linter when asking for password#54
Open
clavedeluna wants to merge 3 commits into
Open
Conversation
mschwager
reviewed
Sep 16, 2022
mschwager
left a comment
Contributor
There was a problem hiding this comment.
Nice work! Can you also add a line under an Added section in Unreleased in the CHANGELOG?
mschwager
reviewed
Sep 16, 2022
|
|
||
| def _get_arg_or_kwarg(self, node): | ||
| if node.args: | ||
| return node.args[0].value |
Contributor
There was a problem hiding this comment.
You should also check that node.args and node.keywords are not empty before checking [0]. This would produce a runtime error in the code because input takes 1 argument, but you never know what code you'll find in the wild. In other words, static analysis will often see code that hasn't been executed, or has all kinds of weird bugs, so it's best to be defensive :)
clavedeluna
force-pushed
the
add-password-linter
branch
from
June 16, 2026 11:51
418d575 to
bf602c3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #16
The goal is to detect when a user uses the built-in
inputfunction with an arg or kwarg of string containing "password". Unit tests demonstrate when this may be a false positive, such asinput("Please enter your name. Please do not enter your password")First pass attempt, would love feedback.