diff options
| author | Dennis Fink | 2026-11-13 18:02:49 +0100 |
|---|---|---|
| committer | Dennis Fink | 2026-11-13 18:02:49 +0100 |
| commit | fd61299d8a4d54836f0aa082aa47d02a786c7d93 (patch) | |
| tree | cbc2c20ca651ac45822aa64338a3cf27a43b2cda | |
| parent | 177186a0952d51fc41f51e09a1ac8e60fdb26bd8 (diff) | |
| download | webmentions-ssg-fd61299d8a4d54836f0aa082aa47d02a786c7d93.tar.gz webmentions-ssg-fd61299d8a4d54836f0aa082aa47d02a786c7d93.zip | |
chore(core): enforce Ruff docstring spacing
Enable additional Ruff docstring checks for summary separation and
closing quotes, then normalize migration and application docstrings to
satisfy the new rules.
10 files changed, 13 insertions, 47 deletions
diff --git a/pyproject.toml b/pyproject.toml index 14c5932..f092ac9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -115,7 +115,7 @@ default-groups = ["dev", "test"] skip-magic-trailing-comma = true [tool.ruff.lint] -extend-select = ["B", "C4", "C90", "PIE", "PLR09", "PTH", "RET", "RUF", "SIM", "UP", "D200", "D202", "D212"] +extend-select = ["B", "C4", "C90", "PIE", "PLR09", "PTH", "RET", "RUF", "SIM", "UP", "D200", "D202", "D205", "D209", "D212"] [tool.ruff.lint.isort] split-on-trailing-comma = false diff --git a/webmentions_ssg/migrations/env.py b/webmentions_ssg/migrations/env.py index e2e0ec9..86d9d99 100644 --- a/webmentions_ssg/migrations/env.py +++ b/webmentions_ssg/migrations/env.py @@ -57,7 +57,6 @@ def run_migrations_offline(): Calls to context.execute() here emit the given string to the script output. - """ url = config.get_main_option("sqlalchemy.url") context.configure(url=url, target_metadata=get_metadata(), literal_binds=True) @@ -71,7 +70,6 @@ def run_migrations_online(): In this scenario we need to create an Engine and associate a connection with the context. - """ # this callback is used to prevent an auto-migration from being generated diff --git a/webmentions_ssg/migrations/versions/408fc2eca9ce_track_webmention_digest_notifications.py b/webmentions_ssg/migrations/versions/408fc2eca9ce_track_webmention_digest_notifications.py index a263a2f..6f337be 100644 --- a/webmentions_ssg/migrations/versions/408fc2eca9ce_track_webmention_digest_notifications.py +++ b/webmentions_ssg/migrations/versions/408fc2eca9ce_track_webmention_digest_notifications.py @@ -7,7 +7,6 @@ Revision ID: 408fc2eca9ce Revises: be6e229d6a3d Create Date: 2026-10-29 20:24:42.008723 - """ import sqlalchemy as sa diff --git a/webmentions_ssg/migrations/versions/681a2a9a1bc0_webmention_sender.py b/webmentions_ssg/migrations/versions/681a2a9a1bc0_webmention_sender.py index 23bf2dd..0a77094 100644 --- a/webmentions_ssg/migrations/versions/681a2a9a1bc0_webmention_sender.py +++ b/webmentions_ssg/migrations/versions/681a2a9a1bc0_webmention_sender.py @@ -7,7 +7,6 @@ Revision ID: 681a2a9a1bc0 Revises: f63641044cc1 Create Date: 2026-08-14 13:40:55.149604 - """ import sqlalchemy as sa diff --git a/webmentions_ssg/migrations/versions/85f2b226ec99_add_webmention_retry_backoff.py b/webmentions_ssg/migrations/versions/85f2b226ec99_add_webmention_retry_backoff.py index ee6ad09..66fa289 100644 --- a/webmentions_ssg/migrations/versions/85f2b226ec99_add_webmention_retry_backoff.py +++ b/webmentions_ssg/migrations/versions/85f2b226ec99_add_webmention_retry_backoff.py @@ -7,7 +7,6 @@ Revision ID: 85f2b226ec99 Revises: 408fc2eca9ce Create Date: 2026-10-30 13:08:17.340631 - """ import sqlalchemy as sa diff --git a/webmentions_ssg/migrations/versions/be6e229d6a3d_do_not_limit_username_and_password_hash_.py b/webmentions_ssg/migrations/versions/be6e229d6a3d_do_not_limit_username_and_password_hash_.py index 4bb7a7c..3ba49dd 100644 --- a/webmentions_ssg/migrations/versions/be6e229d6a3d_do_not_limit_username_and_password_hash_.py +++ b/webmentions_ssg/migrations/versions/be6e229d6a3d_do_not_limit_username_and_password_hash_.py @@ -7,7 +7,6 @@ Revision ID: be6e229d6a3d Revises: 681a2a9a1bc0 Create Date: 2026-08-16 20:38:27.992624 - """ import sqlalchemy as sa diff --git a/webmentions_ssg/migrations/versions/f63641044cc1_initial_database_schema.py b/webmentions_ssg/migrations/versions/f63641044cc1_initial_database_schema.py index 5017bc3..b6064fe 100644 --- a/webmentions_ssg/migrations/versions/f63641044cc1_initial_database_schema.py +++ b/webmentions_ssg/migrations/versions/f63641044cc1_initial_database_schema.py @@ -7,7 +7,6 @@ Revision ID: f63641044cc1 Revises: Create Date: 2026-08-09 11:18:10.051888 - """ import sqlalchemy as sa diff --git a/webmentions_ssg/models.py b/webmentions_ssg/models.py index 0932962..37e5f0e 100644 --- a/webmentions_ssg/models.py +++ b/webmentions_ssg/models.py @@ -60,10 +60,7 @@ class User(UserMixin, Base): password_hash: Mapped[str] = mapped_column(Text(), nullable=False) def __repr__(self) -> str: - """Return a developer-readable representation of the user. - - :return: Representation containing the username. - """ + """Represent the user by username.""" return f"<User {self.username}>" @property @@ -149,10 +146,7 @@ class ReceivedWebmention(Base): ) def __repr__(self) -> str: - """Return a developer-readable representation of the received Webmention. - - :return: Representation containing the identifier, source, and target. - """ + """Represent the received Webmention by source and target.""" return f"<ReceivedWebmention {self.source!r} -> {self.target!r}>" @staticmethod @@ -175,18 +169,12 @@ class ReceivedWebmention(Base): @property def verified(self) -> bool: - """Return whether the Webmention has been successfully verified. - - :return: Whether the Webmention status is ``verified``. - """ + """Return whether the Webmention has been successfully verified.""" return self.status == ReceivedStatus.VERIFIED @property def created_at(self) -> datetime: - """Return the creation time encoded in the Webmention UUID. - - :return: Creation time as a timezone-aware datetime. - """ + """Return the creation time encoded in the Webmention UUID.""" return uuid7_to_datetime(self.uuid) @@ -220,18 +208,12 @@ class Source(Base): ) def __repr__(self) -> str: - """Return a developer-readable representation of the source. - - :return: Representation containing the identifier and public URL. - """ + """Represent the source by its public URL.""" return f"<Source {self.url!r}>" @property def created_at(self) -> datetime: - """Return the creation time encoded in the source UUID. - - :return: Creation time as a timezone-aware datetime. - """ + """Return the creation time encoded in the source UUID.""" return uuid7_to_datetime(self.uuid) @@ -312,10 +294,7 @@ class SentWebmention(Base): ) def __repr__(self) -> str: - """Return a developer-readable representation of the sent Webmention. - - :return: Representation containing the identifier and target URL. - """ + """Represent the sent Webmention by its target URL.""" return f"<SentWebmention {self.target!r}>" def reopen( @@ -339,10 +318,7 @@ class SentWebmention(Base): @property def pending(self) -> bool: - """Return whether the Webmention has an unprocessed source revision. - - :return: Whether the desired revision still requires processing. - """ + """Return whether the Webmention has an unprocessed source revision.""" return ( self.processed_revision is None or self.processed_revision < self.desired_revision @@ -350,10 +326,7 @@ class SentWebmention(Base): @property def created_at(self) -> datetime: - """Return the creation time encoded in the Webmention UUID. - - :return: Creation time as a timezone-aware datetime. - """ + """Return the creation time encoded in the Webmention UUID.""" return uuid7_to_datetime(self.uuid) diff --git a/webmentions_ssg/tasks/extension.py b/webmentions_ssg/tasks/extension.py index 0e031e6..029de68 100644 --- a/webmentions_ssg/tasks/extension.py +++ b/webmentions_ssg/tasks/extension.py @@ -136,7 +136,6 @@ class Huey: def huey(self) -> BaseHuey: """Return the initialized Huey instance. - :return: Configured Huey backend instance. :raises RuntimeError: If the extension has not been initialized. """ if self._huey is None: diff --git a/webmentions_ssg/tasks/mentions.py b/webmentions_ssg/tasks/mentions.py index 687ba38..8f41902 100644 --- a/webmentions_ssg/tasks/mentions.py +++ b/webmentions_ssg/tasks/mentions.py @@ -57,8 +57,9 @@ def html_mentions_target(body: bytes, source_url: str, target_url: str) -> bool: def text_mentions_target(body: str, target_url: str) -> bool: - """Check whether plain text contains the target IRI, ignoring trailing prose - punctuation but not extra URL path or query characters. + """Check whether plain text contains the target IRI. + + Ignore trailing prose punctuation, but not extra URL path or query characters. :param body: Plain-text document body. :param target_url: Exact IRI to look for. |
