Skip to content

Commit

Permalink
pep8: Make git-pw pass flake8
Browse files Browse the repository at this point in the history
I silenced yet another warning because I really want to be able to
write:

    'need_git_repo': True,
    'need_project' : False,
    'need_auth'    : False,

and flake8 was complaining about the number of spaces around ':'

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
  • Loading branch information
Damien Lespiau committed Dec 10, 2015
1 parent b4be78b commit d40b7c9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
12 changes: 8 additions & 4 deletions git-pw/git-pw
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class HttpError(Exception):
elif self.status_code in msg:
die(msg[self.status_code])


class Command(object):
meta = {
'apply': {
Expand Down Expand Up @@ -145,7 +146,7 @@ class Command(object):

class User(object):

def __init__(self, username, password):
def __init__(self, username, password):
self.username = username
self.password = password

Expand Down Expand Up @@ -307,7 +308,7 @@ class GitPatchwork(object):
def setup(self):
try:
self.repo = git.Repo(os.getcwd())
except git.exc.InvalidGitRepositoryError as e:
except git.exc.InvalidGitRepositoryError:
if self.cmd.need_git_repo:
die('Not a git repository.')

Expand Down Expand Up @@ -338,7 +339,8 @@ class GitPatchwork(object):
except:
die("git-pw isn't configured.\n\n"
"Please set up the patchwork url and project, e.g.:\n\n"
" git config patchwork.%(config)s.url https://patchwork.freedesktop.org\n"
" git config patchwork.%(config)s.url "
"https://patchwork.freedesktop.org\n"
" git config patchwork.%(config)s.project intel-gfx\n" % {
'config': self.cmd.config,
})
Expand Down Expand Up @@ -564,7 +566,8 @@ class AliasedSubParsersAction(argparse._SubParsersAction):
else:
aliases = []

parser = super(AliasedSubParsersAction, self).add_parser(name, **kwargs)
parser = super(AliasedSubParsersAction, self). \
add_parser(name, **kwargs)

# Make the aliases work.
for alias in aliases:
Expand All @@ -578,6 +581,7 @@ class AliasedSubParsersAction(argparse._SubParsersAction):

return parser


def parser_add_result_options(parser):
parser.add_argument('--url', '-u', metavar='url', type=str,
help='the URL where to get full test results')
Expand Down
2 changes: 2 additions & 0 deletions tests/test_pep8.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
script_dir=$(cd `dirname $0`; pwd)
root_dir=`dirname $script_dir`
patchwork=$root_dir/patchwork
gitpw=$root_dir/git-pw

files=$(cat <<-END
$patchwork/bin/parsemail.py
$patchwork/admin.py
$patchwork/tests/test_rest.py
$patchwork/views/xmlrpc.py
$gitpw/git-pw
END
)

Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ deps = flake
commands = flake8 {posargs:patchwork}

[flake8]
ignore = E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E251,H405
ignore = E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E203,E251,H405
exclude = ./patchwork/tests

[testenv:lint]
Expand Down

0 comments on commit d40b7c9

Please sign in to comment.