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.
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.
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/81a4110338496714c0bf2bb0e8dd929461d9d492To 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.