Skip to content

Commit cf12b07

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent d02b4a6 commit cf12b07

56 files changed

Lines changed: 76 additions & 47 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

bandit/__main__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
1313
https://bandit.readthedocs.io/
1414
"""
15+
1516
from bandit.cli import main
1617

1718
main.main()

bandit/blacklists/calls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@
339339
+------+---------------------+------------------------------------+-----------+
340340
341341
"""
342+
342343
from bandit.blacklists import utils
343344
from bandit.core import issue
344345

bandit/blacklists/imports.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@
227227
+------+---------------------+------------------------------------+-----------+
228228
229229
"""
230+
230231
from bandit.blacklists import utils
231232
from bandit.core import issue
232233

bandit/cli/baseline.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# reports on any new findings.
1111
# #############################################################################
1212
"""Bandit is a tool designed to find common security issues in Python code."""
13+
1314
import argparse
1415
import contextlib
1516
import logging

bandit/cli/config_generator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44
"""Bandit is a tool designed to find common security issues in Python code."""
5+
56
import argparse
67
import importlib
78
import logging

bandit/cli/main.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#
44
# SPDX-License-Identifier: Apache-2.0
55
"""Bandit is a tool designed to find common security issues in Python code."""
6+
67
import argparse
78
import fnmatch
89
import logging
@@ -393,8 +394,7 @@ def main():
393394
blacklist_info.append(f"{b['id']}\t{b['name']}")
394395

395396
plugin_list = "\n\t".join(sorted(set(plugin_info + blacklist_info)))
396-
dedent_text = textwrap.dedent(
397-
"""
397+
dedent_text = textwrap.dedent("""
398398
CUSTOM FORMATTING
399399
-----------------
400400
@@ -421,8 +421,7 @@ def main():
421421
422422
The following tests were discovered and loaded:
423423
-----------------------------------------------
424-
"""
425-
)
424+
""")
426425
parser.epilog = dedent_text + f"\t{plugin_list}"
427426

428427
# setup work - parse arguments, and initialize BanditManager

bandit/core/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def get_module_qualname_from_path(path):
136136
:return: fully qualified module name
137137
"""
138138

139-
(head, tail) = os.path.split(path)
139+
head, tail = os.path.split(path)
140140
if head == "" or tail == "":
141141
raise InvalidModulePath(
142142
f'Invalid python file path: "{path}" Missing path or file name'
@@ -145,7 +145,7 @@ def get_module_qualname_from_path(path):
145145
qname = [os.path.splitext(tail)[0]]
146146
while head not in ["/", ".", ""]:
147147
if os.path.isfile(os.path.join(head, "__init__.py")):
148-
(head, tail) = os.path.split(head)
148+
head, tail = os.path.split(head)
149149
qname.insert(0, tail)
150150
else:
151151
break

bandit/formatters/csv.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
New field `CWE` added to output
2828
2929
"""
30+
3031
# Necessary for this formatter to work when imported on Python 2. Importing
3132
# the standard library's csv module conflicts with the name of this module.
3233
import csv

bandit/formatters/custom.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
New field `CWE` added to output
2626
2727
"""
28+
2829
import logging
2930
import os
3031
import re

bandit/formatters/html.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@
146146
New field `CWE` added to output
147147
148148
"""
149+
149150
import logging
150151
import sys
151152
from html import escape as html_escape

0 commit comments

Comments
 (0)