Skip to content

Commit 05ba0b5

Browse files
committed
Fix: Remove errors and warning raised by pylint 2.17.0
1 parent 605fda5 commit 05ba0b5

File tree

6 files changed

+8
-22
lines changed

6 files changed

+8
-22
lines changed

.pylintrc

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -364,13 +364,6 @@ max-line-length=80
364364
# Maximum number of lines in a module
365365
max-module-lines=1000
366366

367-
# List of optional constructs for which whitespace checking is disabled. `dict-
368-
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
369-
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
370-
# `empty-line` allows space-only lines.
371-
no-space-check=trailing-comma,
372-
dict-separator
373-
374367
# Allow the body of a class to be on the same line as the declaration if body
375368
# contains single statement.
376369
single-line-class-stmt=no
@@ -472,4 +465,4 @@ valid-metaclass-classmethod-first-arg=mcs
472465

473466
# Exceptions that will emit a warning when being caught. Defaults to
474467
# "Exception"
475-
overgeneral-exceptions=Exception
468+
overgeneral-exceptions=builtins.Exception

scripts/.pylintrc

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -362,13 +362,6 @@ max-line-length=80
362362
# Maximum number of lines in a module
363363
max-module-lines=1000
364364

365-
# List of optional constructs for which whitespace checking is disabled. `dict-
366-
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
367-
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
368-
# `empty-line` allows space-only lines.
369-
no-space-check=trailing-comma,
370-
dict-separator
371-
372365
# Allow the body of a class to be on the same line as the declaration if body
373366
# contains single statement.
374367
single-line-class-stmt=no
@@ -470,4 +463,4 @@ valid-metaclass-classmethod-first-arg=mcs
470463

471464
# Exceptions that will emit a warning when being caught. Defaults to
472465
# "Exception"
473-
overgeneral-exceptions=Exception
466+
overgeneral-exceptions=builtins.Exception

scripts/check-gmp.gmp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def is_old_report(self, last_scan_end, params_used):
185185

186186
# Retrieve the scan_end value
187187
self.cursor.execute(
188-
"SELECT scan_end, params_used FROM Report WHERE" " host=?",
188+
"SELECT scan_end, params_used FROM Report WHERE host=?",
189189
(self.host,),
190190
)
191191
db_entry = self.cursor.fetchone()
@@ -202,7 +202,7 @@ def is_old_report(self, last_scan_end, params_used):
202202
new = parse_date(last_scan_end)
203203

204204
logger.debug(
205-
"Old time (from db): %s\n" "New time (from rp): %s", old, new
205+
"Old time (from db): %s\nNew time (from rp): %s", old, new
206206
)
207207

208208
if new <= old and params_used == db_entry[1]:

scripts/monthly-report.gmp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def check_args(args: Namespace) -> None:
3131
message = """
3232
This script will display all vulnerabilities from the hosts of the
3333
reports in a given month!
34-
34+
3535
1. <month> -- month of the monthly report
3636
2. <year> -- year of the monthly report
3737
@@ -97,7 +97,7 @@ def print_result_tables(gmp: Gmp, reports_xml: Element) -> None:
9797

9898
for host in res.xpath("report/report/host"):
9999
hostname = host.xpath(
100-
'detail/name[text()="hostname"]/../' "value/text()"
100+
'detail/name[text()="hostname"]/../value/text()'
101101
)
102102
if len(hostname) > 0:
103103
hostname = str(hostname[0])

scripts/send-delta-emails.gmp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def execute_send_delta_emails(sc: sched.scheduler, **kwargs: dict) -> None:
9191
continue
9292

9393
if reports[0].xpath(
94-
"report/user_tags/tag/" 'name[text()="delta_alert_sent"]'
94+
'report/user_tags/tag/name[text()="delta_alert_sent"]'
9595
):
9696
print(" Delta report for latest finished report already sent")
9797
continue

tests/test_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def resolve_raises_error():
112112
@patch("gvmtools.parser.Config")
113113
def test_config_load_raises_error(self, config_mock, path_mock):
114114
def config_load_error():
115-
raise Exception
115+
raise Exception # pylint: disable=broad-exception-raised
116116

117117
config = unittest.mock.MagicMock()
118118
config.load = unittest.mock.MagicMock(side_effect=config_load_error)

0 commit comments

Comments
 (0)