Skip to content

Commit 096c624

Browse files
committed
Fix some pylint/pep8 issues, silence others
1 parent ac92f99 commit 096c624

4 files changed

Lines changed: 7 additions & 6 deletions

File tree

bugzilla/_cli.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
from __future__ import print_function
1616

17+
import errno
1718
import locale
1819
from logging import getLogger, DEBUG, INFO, WARN, StreamHandler, Formatter
1920
import argparse
@@ -85,7 +86,7 @@ def open_without_clobber(name, *args):
8586
try:
8687
fd = os.open(name, os.O_CREAT | os.O_EXCL, 0o666)
8788
except OSError as err:
88-
if err.errno == os.errno.EEXIST:
89+
if err.errno == errno.EEXIST:
8990
name = "%s.%i" % (orig_name, count)
9091
count += 1
9192
else:
@@ -705,7 +706,7 @@ def bug_field(matchobj):
705706
if fieldname == "flag" and rest:
706707
val = b.get_flag_status(rest)
707708

708-
elif fieldname == "flags" or fieldname == "flags_requestee":
709+
elif fieldname in ["flags", "flags_requestee"]:
709710
tmpstr = []
710711
for f in getattr(b, "flags", []):
711712
requestee = f.get('requestee', "")
@@ -979,8 +980,6 @@ def _do_get_attach(bz, opt):
979980
data = att.read(4096)
980981
print("Wrote %s" % outfile.name)
981982

982-
return
983-
984983

985984
def _do_set_attach(bz, opt, parser):
986985
if not opt.ids:

bugzilla/transport.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ def _request_helper(self, url, request_body):
159159
response.
160160
"""
161161
response = None
162+
# pylint: disable=try-except-raise
162163
try:
163164
response = self.session.post(
164165
url, data=request_body, **self.request_defaults)

tests/pycodestyle.cfg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ format = pylint
88
# [E303] Too many blank lines
99
# [E402] module level import not at top of file
1010
# [E731] do not assign a lambda expression, use a def
11+
# [W504] line break after binary operator
1112

12-
ignore=E125,E128,E129,E303,E402,E731
13+
ignore=E125,E128,E129,E303,E402,E731,W504

tests/pylint.cfg

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
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
1111
enable=fixme
1212

1313

0 commit comments

Comments
 (0)