Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Link to issue number:
Discussion in #15299
Unblocks PR #15546
Summary of the issue:
The version of Flake8 we're using is extremely old. While it worked well up to now, it does not support some newer syntactic construct in recent versions of Python (in particular walrus operator). Unfortunately we cannot update to the latest release, since it does not support flake8-tabs, nor linting a diff (the latter can be achieved using external tools).
Description of user facing changes
None
Description of development approach
Flake8 is updated to the version 4.0.1. This is the last version which supports flake8-tabs, and it also recognizes various newer language constructs in Python, by the simple fact that it was released almost 2.5 years after the version we're using currently.
Testing strategy:
Ensured that code from PR #15546 can be linted correctly.
Known issues with pull request:
While this version of Flake8 is way more recent than what we we're using up to now, it predates Python 3.11. It means that some constructs (
casestatements) would not be recognized. Possible solutions are discussed in #15299.Code Review Checklist: