Skip to content

Commit b10665c

Browse files
committed
lint code
1 parent c80b8d8 commit b10665c

File tree

4 files changed

+13
-15
lines changed

4 files changed

+13
-15
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ safety: ## Check for insecure dependencies
6060

6161
.PHONY: py-upgrade
6262
py-upgrade: ## Upgrade Python syntax to a newer version
63-
pyupgrade --py313-plus `find app -name "*.py"`
63+
pyupgrade --py314-plus `find app -name "*.py"`
6464

6565
.PHONY: lint
6666
lint: ## Lint and format project code

app/models/shakespeare.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ class Character(Base):
4646
abbrev: Mapped[str | None] = mapped_column(String(32))
4747
description: Mapped[str | None] = mapped_column(String(2056))
4848

49-
work: Mapped[list["Work"]] = relationship(
49+
work: Mapped[list[Work]] = relationship(
5050
"Work", secondary="shakespeare.character_work", back_populates="character"
5151
)
52-
paragraph: Mapped[list["Paragraph"]] = relationship(
52+
paragraph: Mapped[list[Paragraph]] = relationship(
5353
"Paragraph", back_populates="character"
5454
)
5555

@@ -122,11 +122,11 @@ class Work(Base):
122122
total_paragraphs: Mapped[int] = mapped_column(Integer)
123123
notes: Mapped[str | None] = mapped_column(Text)
124124

125-
character: Mapped[list["Character"]] = relationship(
125+
character: Mapped[list[Character]] = relationship(
126126
"Character", secondary="shakespeare.character_work", back_populates="work"
127127
)
128-
chapter: Mapped[list["Chapter"]] = relationship("Chapter", back_populates="work")
129-
paragraph: Mapped[list["Paragraph"]] = relationship(
128+
chapter: Mapped[list[Chapter]] = relationship("Chapter", back_populates="work")
129+
paragraph: Mapped[list[Paragraph]] = relationship(
130130
"Paragraph", back_populates="work"
131131
)
132132

@@ -170,8 +170,8 @@ class Chapter(Base):
170170
chapter_number: Mapped[int] = mapped_column(Integer)
171171
description: Mapped[str] = mapped_column(String(256))
172172

173-
work: Mapped["Work"] = relationship("Work", back_populates="chapter")
174-
paragraph: Mapped[list["Paragraph"]] = relationship(
173+
work: Mapped[Work] = relationship("Work", back_populates="chapter")
174+
paragraph: Mapped[list[Paragraph]] = relationship(
175175
"Paragraph", back_populates="chapter"
176176
)
177177

@@ -259,11 +259,11 @@ class Paragraph(Base):
259259
char_count: Mapped[int] = mapped_column(Integer)
260260
word_count: Mapped[int] = mapped_column(Integer)
261261

262-
character: Mapped["Character"] = relationship(
262+
character: Mapped[Character] = relationship(
263263
"Character", back_populates="paragraph"
264264
)
265-
chapter: Mapped["Chapter"] = relationship("Chapter", back_populates="paragraph")
266-
work: Mapped["Work"] = relationship("Work", back_populates="paragraph")
265+
chapter: Mapped[Chapter] = relationship("Chapter", back_populates="paragraph")
266+
work: Mapped[Work] = relationship("Work", back_populates="paragraph")
267267

268268
@classmethod
269269
async def find(cls, db_session: AsyncSession, character: str):

app/models/stuff.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Stuff(Base):
2929
name: Mapped[str] = mapped_column(String, primary_key=True, unique=True)
3030
description: Mapped[str | None]
3131

32-
nonsense: Mapped["Nonsense"] = relationship(
32+
nonsense: Mapped[Nonsense] = relationship(
3333
"Nonsense", secondary="happy_hog.stuff_full_of_nonsense"
3434
)
3535

@@ -47,7 +47,7 @@ class StuffFullOfNonsense(Base):
4747
UUID(as_uuid=True), default=uuid.uuid4, primary_key=True
4848
)
4949
stuff_id: Mapped[Stuff] = mapped_column(UUID, ForeignKey("happy_hog.stuff.id"))
50-
nonsense_id: Mapped["Nonsense"] = mapped_column(
50+
nonsense_id: Mapped[Nonsense] = mapped_column(
5151
UUID, ForeignKey("happy_hog.nonsense.id")
5252
)
5353
but_why: Mapped[str | None]

app/schemas/shakespeare.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from typing import Any
42

53
from pydantic import BaseModel

0 commit comments

Comments
 (0)