mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-27 04:19:18 +00:00
Fix up some types in the ecosystem code (#8898)
## Summary
Fixes up the type annotations to make type analyzers a little happier 😄
## Test Plan
N/A
This commit is contained in:
parent
ee5d95f751
commit
3ee1ec70cc
6 changed files with 17 additions and 14 deletions
|
@ -53,7 +53,7 @@ async def main(
|
|||
async with semaphore:
|
||||
return await coroutine
|
||||
|
||||
comparisons: list[Exception | Comparison] = await asyncio.gather(
|
||||
comparisons: list[BaseException | Comparison] = await asyncio.gather(
|
||||
*[
|
||||
limited_parallelism(
|
||||
clone_and_compare(
|
||||
|
@ -72,9 +72,10 @@ async def main(
|
|||
comparisons_by_target = dict(zip(targets, comparisons, strict=True))
|
||||
|
||||
# Split comparisons into errored / completed
|
||||
errored, completed = [], []
|
||||
errored: list[tuple[Project, BaseException]] = []
|
||||
completed: list[tuple[Project, Comparison]] = []
|
||||
for target, comparison in comparisons_by_target.items():
|
||||
if isinstance(comparison, Exception):
|
||||
if isinstance(comparison, BaseException):
|
||||
errored.append((target, comparison))
|
||||
else:
|
||||
completed.append((target, comparison))
|
||||
|
@ -138,7 +139,7 @@ async def clone_and_compare(
|
|||
|
||||
|
||||
class JSONEncoder(json.JSONEncoder):
|
||||
def default(self, o):
|
||||
def default(self, o: object):
|
||||
if isinstance(o, Serializable):
|
||||
return o.jsonable()
|
||||
if dataclasses.is_dataclass(o):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue