diff options
| author | Dennis Fink | 2026-11-12 22:07:12 +0100 |
|---|---|---|
| committer | Dennis Fink | 2026-11-12 22:07:12 +0100 |
| commit | c7993952c585b66acad5275e39dbf91cf662b975 (patch) | |
| tree | 976b3746444b3bd0bbb269bef9197c8b6a2e1696 /webmentions_ssg/views | |
| parent | b930b4425b91aa42abcec6c3443685065a5ca242 (diff) | |
| download | webmentions-ssg-c7993952c585b66acad5275e39dbf91cf662b975.tar.gz webmentions-ssg-c7993952c585b66acad5275e39dbf91cf662b975.zip | |
chore(core): enable stricter Ruff lint rules
Expand Ruff checks for bugbear, complexity, pathlib, return statements,
simplifications, upgrades, and docstring style.
Apply the resulting behavior-neutral cleanup across application and test
code.
Diffstat (limited to '')
| -rw-r--r-- | webmentions_ssg/views/admin.py | 21 | ||||
| -rw-r--r-- | webmentions_ssg/views/endpoint.py | 6 | ||||
| -rw-r--r-- | webmentions_ssg/views/session.py | 9 |
3 files changed, 12 insertions, 24 deletions
diff --git a/webmentions_ssg/views/admin.py b/webmentions_ssg/views/admin.py index 46e3b18..2f3f3ab 100644 --- a/webmentions_ssg/views/admin.py +++ b/webmentions_ssg/views/admin.py @@ -24,8 +24,7 @@ from . import root_page @root_page.route("/received") @login_required def received() -> ResponseReturnValue: - """ - Display received Webmentions. + """Display received Webmentions. :return: Rendered page containing the paginated received Webmentions. """ @@ -45,8 +44,7 @@ def received() -> ResponseReturnValue: @root_page.post("/received/<uuid:identifier>/delete") @login_required def delete_received_webmention(identifier: uuid.UUID) -> ResponseReturnValue: - """ - Delete a received Webmention. + """Delete a received Webmention. :param identifier: Identifier of the Webmention to delete. :return: Redirect response to the received Webmentions view. @@ -74,8 +72,7 @@ def delete_received_webmention(identifier: uuid.UUID) -> ResponseReturnValue: @root_page.post("/received/<uuid:identifier>/reverify") @login_required def reverify_received_webmention(identifier: uuid.UUID) -> ResponseReturnValue: - """ - Queue a received Webmention for reverification. + """Queue a received Webmention for reverification. The Webmention status is reset before a new verification task is queued. @@ -108,8 +105,7 @@ def reverify_received_webmention(identifier: uuid.UUID) -> ResponseReturnValue: @root_page.route("/sent") @login_required def sent() -> ResponseReturnValue: - """ - Display sources with sent Webmentions. + """Display sources with sent Webmentions. :return: Rendered page containing the paginated source list. """ @@ -130,8 +126,7 @@ def sent() -> ResponseReturnValue: @root_page.post("/sent/rescan") @login_required def rescan_sent_sources() -> ResponseReturnValue: - """ - Queue a manual scan of sent Webmention sources. + """Queue a manual scan of sent Webmention sources. :return: Redirect response to the sent Webmentions view. """ @@ -145,8 +140,7 @@ def rescan_sent_sources() -> ResponseReturnValue: @root_page.route("/sent/<uuid:source_identifier>") @login_required def sent_source(source_identifier: uuid.UUID) -> ResponseReturnValue: - """ - Display the sent Webmentions associated with a source. + """Display the sent Webmentions associated with a source. :param source_identifier: Identifier of the source to display. :return: Rendered source details page. @@ -179,8 +173,7 @@ def sent_source(source_identifier: uuid.UUID) -> ResponseReturnValue: def resend_sent_webmention( source_identifier: uuid.UUID, webmention_identifier: uuid.UUID ) -> ResponseReturnValue: - """ - Queue an outgoing Webmention to be sent again. + """Queue an outgoing Webmention to be sent again. The current desired source revision is reopened for processing so the sender task does not treat the Webmention as already completed. Historical diff --git a/webmentions_ssg/views/endpoint.py b/webmentions_ssg/views/endpoint.py index 1c2fe13..baab397 100644 --- a/webmentions_ssg/views/endpoint.py +++ b/webmentions_ssg/views/endpoint.py @@ -99,8 +99,7 @@ def submit_received(source: str, target: str) -> tuple[uuid.UUID, bool] | None: @LIMITER.limit(lambda: current_app.config["ENDPOINT_RATE_LIMIT"]) @CSRF.exempt def endpoint() -> ResponseReturnValue: - """ - Receive and queue a Webmention for verification. + """Receive and queue a Webmention for verification. Existing Webmentions with the same source and target are reset for reverification. Concurrent insertion of the same Webmention is handled by @@ -134,8 +133,7 @@ def endpoint() -> ResponseReturnValue: @root_page.route("/status/<uuid:identifier>") def status(identifier: uuid.UUID) -> ResponseReturnValue: - """ - Display the verification status of a received Webmention. + """Display the verification status of a received Webmention. :param identifier: Identifier of the Webmention to display. :return: Rendered Webmention status page. diff --git a/webmentions_ssg/views/session.py b/webmentions_ssg/views/session.py index 7bd8a10..3f8a0f2 100644 --- a/webmentions_ssg/views/session.py +++ b/webmentions_ssg/views/session.py @@ -19,8 +19,7 @@ from . import root_page @root_page.route("/") def index() -> ResponseReturnValue: - """ - Redirect to the received Webmentions view. + """Redirect to the received Webmentions view. :return: Redirect response to the received Webmentions view. """ @@ -40,8 +39,7 @@ def index() -> ResponseReturnValue: error_message="Too many login attempts. Please try again later.", ) def login() -> ResponseReturnValue: - """ - Authenticate a user and start a login session. + """Authenticate a user and start a login session. Authenticated users are redirected to the application index. After a successful login, the user is redirected to the requested local URL when @@ -84,8 +82,7 @@ def login() -> ResponseReturnValue: @root_page.route("/logout", methods=("POST",)) @login_required def logout() -> ResponseReturnValue: - """ - End the current user's login session. + """End the current user's login session. :return: Redirect response to the application index. """ |
