From 96363629bd8d49ba020e12e1594adf003a3e7962 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 10 Nov 2026 15:41:17 -0500 Subject: [PATCH] flake8: fix warnings with newer versions The flake8 version hasn't updated properly due the uv.lock file being out of date. Fix newer warnings before unwedging that. We have a lot of B042 errors that probably should be fixed by reworking the code, but for now suppress them since we've been doing this for a long time in repo. error.py:25:5: B042 Exception class with `__init__` should pass all args to `super().__init__()` to work in edge cases of `pickle` and `copy.copy()`. It should also not take any kwargs. The only other warning is fairly simple: subcmds/sync.py:1154:9: B018 Found useless Call expression. Consider either assigning it to a variable or removing it. Change-Id: I532000a66a5d8493a490fa30080b137aff5f706e Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/655844 Tested-by: Mike Frysinger Commit-Queue: Mike Frysinger Reviewed-by: Gavin Mak --- .flake8 | 3 +++ subcmds/sync.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.flake8 b/.flake8 index 0a219a4bb..e6dbe70f2 100644 --- a/.flake8 +++ b/.flake8 @@ -26,6 +26,9 @@ per-file-ignores = tests/e2e/test_workflows.py: IMR241, tests/test_subcmds_sync.py: IMR241, extend-ignore = + # B042: Exception class with __init__ should pass all args to super().__init__() + # We should fix this by reworking our exception classes. + B042, # E203: Whitespace before ':' # See https://github.com/PyCQA/pycodestyle/issues/373 E203, diff --git a/subcmds/sync.py b/subcmds/sync.py index 7d3e2f925..4b13d6d96 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py @@ -1199,7 +1199,7 @@ later is required to fix a server side protocol bug. # job at the same time. Then the connection may fail if too many # connections are pending and execeeded the socket listening backlog, # especially on MacOS. - len(cls.get_parallel_context()["sync_dict"]) + _ = len(cls.get_parallel_context()["sync_dict"]) def _Fetch(self, projects, opt, err_event, ssh_proxy, errors): ret = True