Skip to content

Conversation

@brandonschabell
Copy link
Owner

Added type hinting and docstrings.

Copilot AI review requested due to automatic review settings October 12, 2025 04:35
Copy link

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 adds comprehensive type annotations and modernizes docstrings throughout the codebase to improve code quality and developer experience. The changes enable static type checking with mypy and enforce documentation standards with pydocstyle.

Key changes:

  • Added complete type annotations for all functions, methods, and properties
  • Converted all docstrings from reStructuredText to Google/NumPy style format
  • Enabled strict mypy type checking and pydocstyle linting in configuration

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
urlpath/init.py Added type annotations and comprehensive Google-style docstrings for all classes and methods
tests/test_url.py Added return type annotations (-> None) to all test functions
pyproject.toml Enabled mypy strict mode and pydocstyle linting with Google convention
CHANGELOG.md Documented the type annotation and docstring improvements
Comments suppressed due to low confidence (1)

urlpath/init.py:1

  • The line has a malformed bullet point marker '=-' instead of '-'.
"""Object-oriented URL from `urllib.parse` and `pathlib`."""

requests.Response object from the HEAD request.
"""
url = str(self)
return requests.options(url, **kwargs)
Copy link

Copilot AI Oct 12, 2025

Choose a reason for hiding this comment

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

The head() method is incorrectly calling requests.options() instead of requests.head(). This will return OPTIONS response instead of HEAD response.

Suggested change
return requests.options(url, **kwargs)
return requests.head(url, **kwargs)

Copilot uses AI. Check for mistakes.
@brandonschabell brandonschabell merged commit 873c834 into main Oct 12, 2025
3 checks passed
@brandonschabell brandonschabell deleted the typing-and-docstrings branch October 12, 2025 04:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants