Skip to content

Commit 51d6fd0

Browse files
committed
Fix pylint and pep8 issues
Signed-off-by: Cole Robinson <crobinso@redhat.com>
1 parent 5e8b2c8 commit 51d6fd0

File tree

9 files changed

+11
-9
lines changed

9 files changed

+11
-9
lines changed

.pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ persistent=no
77
# can either give multiple identifier separated by comma (,) or put this option
88
# multiple time (only on the command line, not in the configuration file where
99
# it should appear only once).
10-
disable=Design,Format,Similarities,invalid-name,missing-docstring,locally-disabled,unnecessary-lambda,star-args,fixme,global-statement,broad-except,no-self-use,bare-except,locally-enabled,wrong-import-position,consider-using-ternary,len-as-condition,no-else-return,useless-object-inheritance,inconsistent-return-statements,consider-using-dict-comprehension,import-outside-toplevel,use-a-generator,consider-using-with,consider-using-f-string,unspecified-encoding
10+
disable=Design,Format,Similarities,invalid-name,missing-docstring,locally-disabled,unnecessary-lambda,fixme,global-statement,broad-except,bare-except,wrong-import-position,consider-using-ternary,len-as-condition,no-else-return,useless-object-inheritance,inconsistent-return-statements,consider-using-dict-comprehension,import-outside-toplevel,use-a-generator,consider-using-with,consider-using-f-string,unspecified-encoding
1111
enable=fixme
1212

1313

bugzilla/_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,7 @@ def _do_modify(bz, parser, opt):
10471047

10481048
for k, v in wbmap.copy().items():
10491049
if not v[0] and not v[1]:
1050-
del(wbmap[k])
1050+
del wbmap[k]
10511051

10521052
if opt.fields:
10531053
_merge_field_opts(update, opt.fields, parser)

bugzilla/_session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def __init__(self, url, user_agent,
3131
self._use_auth_bearer = False
3232

3333
if self._scheme not in ["http", "https"]:
34-
raise Exception("Invalid URL scheme: %s (%s)" % (
34+
raise ValueError("Invalid URL scheme: %s (%s)" % (
3535
self._scheme, url))
3636

3737
self._session = requests_session

bugzilla/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,7 +1302,7 @@ def add_email(key, value, count):
13021302
# Strip out None elements in the dict
13031303
for k, v in query.copy().items():
13041304
if v is None:
1305-
del(query[k])
1305+
del query[k]
13061306

13071307
self.pre_translation(query)
13081308
return query
@@ -1799,7 +1799,7 @@ def _validate_createbug(self, *args, **kwargs):
17991799

18001800
# Back compat handling for check_args
18011801
if "check_args" in data:
1802-
del(data["check_args"])
1802+
del data["check_args"]
18031803

18041804
return data
18051805

bugzilla/bug.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def _translate_dict(self, newdict):
136136
"d[%s]=%s and d[%s]=%s , dropping the value "
137137
"d[%s]", newname, newdict[newname], oldname,
138138
newdict[oldname], oldname)
139-
del(newdict[oldname])
139+
del newdict[oldname]
140140

141141

142142
def _update_dict(self, newdict):

tests/test_api_authfiles.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def test_tokenfile(monkeypatch):
2626
token = dirname + "/data/homedir/.cache/python-bugzilla/bugzillatoken"
2727

2828
assert token == bz.tokenfile
29-
del(bz.tokenfile)
29+
del bz.tokenfile
3030
assert bz.tokenfile is None
3131
assert bz.cookiefile is None
3232

@@ -96,7 +96,7 @@ def _write(c):
9696

9797
# Test confipath overwrite
9898
assert [temp.name] == bzapi.configpath
99-
del(bzapi.configpath)
99+
del bzapi.configpath
100100
assert [] == bzapi.configpath
101101
bzapi.readconfig()
102102
_check(None, None, None, None)

tests/test_api_bug.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def test_bug_getattr():
106106

107107
bug.autorefresh = True
108108
summary = bug.summary
109-
del(bug.__dict__["summary"])
109+
del bug.__dict__["summary"]
110110
# Trigger autorefresh
111111
assert bug.summary == summary
112112

tests/test_api_misc.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ def testStandardQuery():
164164
}
165165
assert bz4.url_to_query(url) == query
166166

167+
# pylint: disable=use-implicit-booleaness-not-comparison
167168
# Test with unknown URL
168169
assert bz4.url_to_query("https://example.com") == {}
169170

tests/test_rw_functional.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ def cleardict_new(b):
363363
bz.update_flags(bug2.id, cleardict_new(bug2))
364364
bug2.refresh()
365365

366+
# pylint: disable=use-implicit-booleaness-not-comparison
366367
assert cleardict_old(bug1) == {}
367368
assert cleardict_old(bug2) == {}
368369

0 commit comments

Comments
 (0)