Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve remaining issues spotted by flake8 #29

Merged
merged 1 commit into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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