Use set literal notation

This commit is contained in:
Joseph T. Lyons 2024-04-11 00:43:06 -04:00
parent 859c5279c4
commit 43c115a747

View file

@ -14,32 +14,26 @@ from typer import Typer
app: Typer = typer.Typer() app: Typer = typer.Typer()
DATETIME_FORMAT: str = "%m/%d/%Y %I:%M %p" DATETIME_FORMAT: str = "%m/%d/%Y %I:%M %p"
CORE_LABELS: set[str] = set( CORE_LABELS: set[str] = {
[
"defect", "defect",
"design", "design",
"documentation", "documentation",
"enhancement", "enhancement",
"panic / crash", "panic / crash",
] }
)
# A set of labels for adding in labels that we want present in the final # A set of labels for adding in labels that we want present in the final
# report, but that we don't want being defined as a core label, since issues # report, but that we don't want being defined as a core label, since issues
# with without core labels are flagged as errors. # with without core labels are flagged as errors.
ADDITIONAL_LABELS: set[str] = set( ADDITIONAL_LABELS: set[str] = {
[
"ai", "ai",
"linux", "linux",
"vim", "vim",
"windows", "windows",
] }
) IGNORED_LABELS: set[str] = {
IGNORED_LABELS: set[str] = set(
[
"ignore top-ranking issues", "ignore top-ranking issues",
"meta", "meta",
] }
)
ISSUES_PER_LABEL: int = 20 ISSUES_PER_LABEL: int = 20
@ -49,7 +43,7 @@ class IssueData:
self.like_count: int = issue._rawData["reactions"]["+1"] # type: ignore [attr-defined] self.like_count: int = issue._rawData["reactions"]["+1"] # type: ignore [attr-defined]
self.creation_datetime: str = issue.created_at.strftime(DATETIME_FORMAT) self.creation_datetime: str = issue.created_at.strftime(DATETIME_FORMAT)
# TODO: Change script to support storing labels here, rather than directly in the script # TODO: Change script to support storing labels here, rather than directly in the script
self.labels: set[str] = set(label["name"] for label in issue._rawData["labels"]) # type: ignore [attr-defined] self.labels: set[str] = {label["name"] for label in issue._rawData["labels"]} # type: ignore [attr-defined]
@app.command() @app.command()