-
Notifications
You must be signed in to change notification settings - Fork 0
Task_508 ruff: docstrings #584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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?
There was a problem hiding this 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/:returnsections to Google-styleArgs/Returns/Raisesblocks. - Updated
pyproject.tomlto enable docstring rules and adjust per-file ignores. - Simplified test code by removing unnecessary grouping parentheses around multiline
file.writecalls.
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
ProxyRequestModelno longer documents its fields. Consider adding anArgssection or field descriptions to improve test clarity.
"""Model for the proxy request."""
app/models.py:12
- The import
UTCfrom thedatetimemodule is invalid—datetimedoes not provideUTC. Replace withfrom datetime import timezoneand usetimezone.utc, or import fromzoneinfo.
from datetime import UTC, datetime
app/ldap_protocol/session_storage.py:10
- Invalid import of
UTCfromdatetime. Considerfrom datetime import timezoneand usingtimezone.utc.
from datetime import UTC, datetime
app/ldap_protocol/ldap_requests/modify.py:7
- The module-level import
UTCis not defined indatetime. Usetimezone.utcor import the correct tzinfo.
from datetime import UTC, datetime, timedelta
No description provided.