Skip to content

Conversation

@milov-dmitriy
Copy link
Collaborator

No description provided.

@milov-dmitriy milov-dmitriy changed the title Task 508 ruff Task 508 ruff: docstrings Jun 16, 2025
@milov-dmitriy milov-dmitriy self-assigned this Jun 16, 2025
@milov-dmitriy milov-dmitriy added documentation Improvements or additions to documentation python Pull requests that update Python code labels Jun 16, 2025
@Mastermind-U Mastermind-U requested review from Copilot June 17, 2025 10:55
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the docstrings across multiple API modules, exception handlers, authentication routines, and Kerberos configuration to use a standardized Args/Returns style, in line with ruff documentation guidelines. The changes also include minor adjustments to Makefile commands and Dockerfile paths for linting and formatting.

Reviewed Changes

Copilot reviewed 97 out of 97 changed files in this pull request and generated no comments.

Show a summary per file
File Description
app/api/main/ap_router.py Updated docstring format for access policies endpoint.
app/api/ldap_schema/object_class_router.py Revised docstrings for object class CRUD operations.
app/api/ldap_schema/entity_type_router.py Standardized documentation for entity type endpoints.
app/api/ldap_schema/attribute_type_router.py Updated documentation for attribute type endpoints.
app/api/exception_handlers.py Enhanced docstrings for exception handling functions.
app/api/auth/utils.py Updated docstrings for utility functions.
app/api/auth/session_router.py Revised docstrings for session management endpoints.
app/api/auth/schema.py Updated form initialization and field validator docstrings.
app/api/auth/router_pwd_policy.py Standardized password policy endpoint documentation.
app/api/auth/router_mfa.py Updated docstrings for MFA-related endpoints.
app/api/auth/router.py Revised documentation for authentication and session-related endpoints.
app/api/auth/oauth2.py Updated docstrings for OAuth2 authentication routines.
app/api/init.py Reordered export entries to match new API documentation.
app/alembic/* Added type hinting and updated docstrings in migration scripts.
Makefile Modified ruff commands to include the --preview flag.
.kerberos/config_server.py Updated docstrings for Kerberos principal management functions.
.github/workflows/checks.yml Updated linters commands to use the --preview flag.
.docker/lint.Dockerfile Changed WORKDIR and adjusted COPY commands for clarity.
Comments suppressed due to low confidence (1)

app/api/auth/schema.py:74

  • [nitpick] Consider removing or clarifying the 'FIXME why noqa?' inline comment from the domain validator function to avoid confusion in production code.
def validate_domain(cls, v: str) -> str:  # noqa FIXME why noqa?

This comment was marked as outdated.

@milov-dmitriy milov-dmitriy changed the title Task 508 ruff: docstrings Task_508 ruff: docstrings Jun 23, 2025
@milov-dmitriy milov-dmitriy requested a review from Copilot June 23, 2025 09:38

This comment was marked as outdated.

@milov-dmitriy milov-dmitriy requested a review from Copilot June 30, 2025 10:49
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR standardizes docstrings across the codebase to Google style (using Args/Returns/Raises sections), adjusts Ruff configuration to enable docstring linting, and cleans up redundant parentheses in multi-line string concatenations in tests.

  • Switched :param/:return sections to Google-style Args/Returns/Raises blocks.
  • Updated pyproject.toml to enable docstring rules and adjust per-file ignores.
  • Simplified test code by removing unnecessary grouping parentheses around multiline file.write calls.

Reviewed Changes

Copilot reviewed 104 out of 104 changed files in this pull request and generated no comments.

File Description
tests/test_api/test_shadow/conftest.py Condensed model docstring, removed field docs
app/models.py Replaced timezone import with UTC
app/ldap_protocol/session_storage.py Replaced timezone import with UTC
app/ldap_protocol/ldap_requests/modify.py Replaced timezone import with UTC
Comments suppressed due to low confidence (4)

tests/test_api/test_shadow/conftest.py:18

  • [nitpick] The docstring for ProxyRequestModel no longer documents its fields. Consider adding an Args section or field descriptions to improve test clarity.
    """Model for the proxy request."""

app/models.py:12

  • The import UTC from the datetime module is invalid—datetime does not provide UTC. Replace with from datetime import timezone and use timezone.utc, or import from zoneinfo.
from datetime import UTC, datetime

app/ldap_protocol/session_storage.py:10

  • Invalid import of UTC from datetime. Consider from datetime import timezone and using timezone.utc.
from datetime import UTC, datetime

app/ldap_protocol/ldap_requests/modify.py:7

  • The module-level import UTC is not defined in datetime. Use timezone.utc or import the correct tzinfo.
from datetime import UTC, datetime, timedelta

@rimu-stack rimu-stack changed the base branch from main to dev December 9, 2025 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants