scionproto / scion

SCION Internet Architecture
https://www.scion-architecture.net/
Apache License 2.0
369 stars 156 forks source link

lint: fix flake8 bazel integration after update #4514

Closed matzf closed 2 months ago

matzf commented 2 months ago

Fix flake8 bazel integration after updating from version 3.8.4 to 7.0.0. While the linter was running and working, it always returned a zero exit code, making bazel think everything is ok.

This problem was caused by our wrapper script, flakelint.py, and a change in the internal API. cli.main no longer sets/raises the exit code, this is done by the caller now. See https://github.com/PyCQA/flake8/commit/81a4110338496714c0bf2bb0e8dd929461d9d492

To fix this, and avoid similar issues in the future, replace the wrapper script with an "entry_point" declaration. This serves the same purpose of creating a runnable bazel target for flake8. I assume that this was not already done when creating this flake8 integration, because either this entry_point mechanism did not yet exist or it was just too obscure.

matzf commented 2 months ago

This change is Reviewable