flake8
-
rbtools/commands/post.py (Diff revision 1) -
-
Review Request #9897 — Created April 30, 2018 and submitted
CommandError is intended to be used only within
rbtools.commands
, and
it was a layering violation to use it from util code. I've swapped out
the places that raised it to instead use other, more appropriate
exception types, and then the commands that call those APIs can catch
and handle those.
Description | From | Last Updated |
---|---|---|
F821 undefined name 'six' |
reviewbot | |
F821 undefined name 'six' |
reviewbot | |
F821 undefined name 'review_request_id' |
reviewbot | |
Can we use keyword arguments here, to help with readability? |
chipx86 | |
Maybe worth inversing this? if i == num_retries - 1: raise logging.error(...) Maybe getting into the weeds here, but that … |
chipx86 | |
There's no need for an else. The raise ends things for this function. |
chipx86 |
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 2 (+114 -79) |
rbtools/utils/users.py (Diff revision 2) |
---|
Can we use keyword arguments here, to help with readability?
rbtools/utils/users.py (Diff revision 2) |
---|
Maybe worth inversing this?
if i == num_retries - 1: raise logging.error(...)
Maybe getting into the weeds here, but that code actually gets nicer if we change the loop:
for i in range(num_retries + 1): ... if i == num_retries: raise ...
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 3 (+117 -82) |
rbtools/utils/users.py (Diff revisions 2 - 3) |
---|
There's no need for an
else
. Theraise
ends things for this function.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 4 (+119 -84) |