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:
Steve C 2023-11-30 17:02:20 -05:00 committed by GitHub
parent ee5d95f751
commit 3ee1ec70cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 17 additions and 14 deletions

View file

@ -3,11 +3,11 @@ from __future__ import annotations
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from ruff_ecosystem.projects import Project
from ruff_ecosystem.projects import CommandOptions, Project
def markdown_project_section(
title: str, content: str | list[str], options: object, project: Project
title: str, content: str | list[str], options: CommandOptions, project: Project
) -> list[str]:
return markdown_details(
summary=f'<a href="{project.repo.url}">{project.repo.fullname}</a> ({title})',
@ -28,8 +28,10 @@ def markdown_plus_minus(added: int, removed: int) -> str:
return f"+{added} -{removed}"
def markdown_details(summary: str, content: str | list[str], preface: str):
lines = []
def markdown_details(
summary: str, content: str | list[str], preface: str | None
) -> list[str]:
lines: list[str] = []
lines.append(f"<details><summary>{summary}</summary>")
if preface:
lines.append("<p>")