Skip to content

Commit

Permalink
Pleasing pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas-C committed Nov 18, 2021
1 parent 75d527b commit ffe205a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion bandit/core/node_visitor.py
Expand Up @@ -288,7 +288,8 @@ def process(self, data):
'''
f_ast = ast.parse(data)
self.generic_visit(f_ast)
# Run tests that do not require access to the AST but only to the whole file source:
# Run tests that do not require access to the AST,
# but only to the whole file source:
self.context = {
'filename': self.fname,
'lineno': 0,
Expand Down
7 changes: 5 additions & 2 deletions bandit/plugins/trojansource.py
Expand Up @@ -33,7 +33,8 @@
from bandit.core import test_properties as test


BIDI_CHARACTERS = ('\u202A', '\u202B', '\u202C', '\u202D', '\u202E', '\u2066', '\u2067', '\u2068', '\u2069')
BIDI_CHARACTERS = ('\u202A', '\u202B', '\u202C', '\u202D', '\u202E',
'\u2066', '\u2067', '\u2068', '\u2069')


@test.test_id('B113')
Expand All @@ -48,10 +49,12 @@ def trojansource(context):
col_offset = line.index(char) + 1
except ValueError:
continue
text = ("A Python source file contains bidirectional"
" control characters (%r)." % char)
return bandit.Issue(
severity=bandit.HIGH,
confidence=bandit.MEDIUM,
text="A Python source file contains bidirectional control characters (%r)." % char,
text=text,
lineno=lineno,
col_offset=col_offset,
)

0 comments on commit ffe205a

Please sign in to comment.