Skip to content

Commit

Permalink
flake8: fix W504 warnings, and ignore W503
Browse files Browse the repository at this point in the history
  • Loading branch information
praiskup committed Jan 13, 2019
1 parent a11be5d commit 55d855d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ test-end2end:
test-unit:
PYTHONPATH=..:$${PYTHONPATH} ${PYTHON} -m pytest `[ ! -z ${COVERAGE} ] && echo "--cov distgen"` tests/unittests/

# Note that flake8 reports both W503 and W504 ATM :-/ so ignore W503 for now,
# which is what should be considered the right setup.
test-lint:
flake8 distgen/
flake8 distgen/ --ignore=W503

# Check that testsuite in packaged sources work fine, too.
test-sdist-check:
Expand Down
12 changes: 6 additions & 6 deletions distgen/multispec.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ def get_distroinfos_by_distro(self, distro):
return distroinfos

def has_spec_group_item(self, group, item):
return (self.has_spec_group(group) and
item in self.get_spec_group(group))
return (self.has_spec_group(group)
and item in self.get_spec_group(group))

def get_spec_group_item(self, group, item):
return copy.deepcopy(self.get_spec_group(group)[item])
Expand Down Expand Up @@ -186,8 +186,8 @@ def process_combinations(data, distro, parsed_selectors):
for k, v in data.items():
if k == DISTROINFO_GRP_DISTROS and distro not in v:
return False
elif (k != DISTROINFO_GRP_DISTROS and k in parsed_selectors and
parsed_selectors[k] != v):
elif (k != DISTROINFO_GRP_DISTROS and k in parsed_selectors
and parsed_selectors[k] != v):
return False
return data.get('data', True)

Expand Down Expand Up @@ -218,8 +218,8 @@ def verify_selectors(self, selectors, distro):
)

for selector_name in self.raw_data['specs'].keys():
if (selector_name != DISTROINFO_GRP and
selector_name not in parsed_selectors):
if (selector_name != DISTROINFO_GRP
and selector_name not in parsed_selectors):
return (
False,
'"{0}" selector must be present'.format(selector_name)
Expand Down

0 comments on commit 55d855d

Please sign in to comment.