Skip to content

Commit

Permalink
Post-review formatting fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
kfrydel committed Feb 24, 2023
1 parent 0269e6d commit f73726b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions bandit/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,13 +374,13 @@ def check_ast_node(name):


def get_nosec(nosec_lines, context):
if isinstance(context['node'], Constant):
if isinstance(context["node"], Constant):
# use the last line in the case of multi-line strings:
# """some text
# with many lines""" # nosec ...
# Strings are parsed as ast.Constant since Python 3.8,
# for Python 3.7 context['lineno'] is returned for strings.
lineno = context['linerange'][-1]
lineno = context["linerange"][-1]
else:
lineno = context['lineno']
lineno = context["lineno"]
return nosec_lines.get(lineno, None)
4 changes: 2 additions & 2 deletions tests/functional/test_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,8 @@ def test_multiline_sql_statements(self):
},
}
expect_stats = {
'nosec': 3,
'skipped_tests': 4,
"nosec": 3,
"skipped_tests": 4,
}
self.check_example(example_file, expect)
self.check_metrics(example_file, expect_stats)
Expand Down

0 comments on commit f73726b

Please sign in to comment.