Skip to content

Commit 8e90749

Browse files
authored
Merge pull request #29 from robert-scheck/flake8-rest
Resolve remaining issues spotted by flake8
2 parents cf09195 + ebf5c1b commit 8e90749

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

.github/workflows/python-package.yaml

+4-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ jobs:
4545
run: |
4646
# Stop the build if there are Python syntax errors or undefined names
4747
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
48-
# For now, treat all errors as warnings using --exit-zero
49-
flake8 . --count --exit-zero --max-complexity=10 --statistics
48+
# For now, ignore F401 ('.aggregate6.aggregate' imported but unused)
49+
# as, when removing the import, it at least breaks pytest, accept the
50+
# max. complexity of 18 for main() - and just fail otherwise
51+
flake8 . --count --ignore=F401 --max-complexity=18 --statistics
5052
- name: Set $PYTHONPATH
5153
run: echo "PYTHONPATH=$RUNNER_WORKSPACE/aggregate6" >> $GITHUB_ENV
5254
- name: Test with pytest

aggregate6/aggregate6.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ def _aggregate_phase2(tree):
8989
for rnode in tree:
9090
p = text(ip_network(text(rnode.prefix)).supernet())
9191
r = tree.search_covered(p)
92-
if len(r) == 2 and r[0].prefixlen == r[1].prefixlen == rnode.prefixlen:
92+
if len(r) == 2 \
93+
and r[0].prefixlen == r[1].prefixlen == rnode.prefixlen:
9394
n_tree.add(p)
9495
aggregations += 1
9596
else:

0 commit comments

Comments
 (0)