Skip to content

Commit

Permalink
Merge pull request #29 from robert-scheck/flake8-rest
Browse files Browse the repository at this point in the history
Resolve remaining issues spotted by flake8
  • Loading branch information
job authored Nov 17, 2024
2 parents cf09195 + ebf5c1b commit 8e90749
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/python-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ jobs:
run: |
# Stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# For now, treat all errors as warnings using --exit-zero
flake8 . --count --exit-zero --max-complexity=10 --statistics
# For now, ignore F401 ('.aggregate6.aggregate' imported but unused)
# as, when removing the import, it at least breaks pytest, accept the
# max. complexity of 18 for main() - and just fail otherwise
flake8 . --count --ignore=F401 --max-complexity=18 --statistics
- name: Set $PYTHONPATH
run: echo "PYTHONPATH=$RUNNER_WORKSPACE/aggregate6" >> $GITHUB_ENV
- name: Test with pytest
Expand Down
3 changes: 2 additions & 1 deletion aggregate6/aggregate6.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ def _aggregate_phase2(tree):
for rnode in tree:
p = text(ip_network(text(rnode.prefix)).supernet())
r = tree.search_covered(p)
if len(r) == 2 and r[0].prefixlen == r[1].prefixlen == rnode.prefixlen:
if len(r) == 2 \
and r[0].prefixlen == r[1].prefixlen == rnode.prefixlen:
n_tree.add(p)
aggregations += 1
else:
Expand Down

0 comments on commit 8e90749

Please sign in to comment.