Skip to content

Conversation

@simark
Copy link
Collaborator

@simark simark commented Dec 2, 2025

No description provided.

simark and others added 6 commits December 1, 2025 22:52
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add return type annotations to http.py route handlers
- Add type annotations to triangle.py async helper functions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Move `import asyncio` to the correct position in the standard library
imports block, as required by isort.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
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 the flake8-bugbear linter plugin to the project's development dependencies and fixes various flake8 issues identified by the tool. The changes focus on code quality improvements including adding type annotations, renaming unused variables to follow Python conventions, refactoring exception handling, and removing unused imports.

Key changes:

  • Added flake8-bugbear package (version 25.11.29) and its dependency attrs to development dependencies
  • Added type annotations to async functions and renamed unused loop variables to use underscore prefix
  • Refactored exception classes to simplify their implementation

Reviewed changes

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

Show a summary per file
File Description
src/canadiantracker/triangle.py Added type annotations to async functions and updated exception initialization (contains a bug)
src/canadiantracker/storage.py Simplified InvalidDatabaseRevisionException by moving message formatting to super().__init__() and removing redundant __str__() method
src/canadiantracker/scraper.py Renamed unused loop variable i to _i to indicate it's intentionally unused
src/canadiantracker/http.py Removed unused starlette.templating import and added return type annotations to route handlers
pyproject.toml Added flake8-bugbear dependency
poetry.lock Updated lock file with flake8-bugbear and attrs package entries
alembic/versions/9169a7c5bda3_add_skus_table.py Renamed unused loop variables to use underscore prefix

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


def __init__(self, msg: str, request_status_code: Optional[int] = None):
super().__init__(msg)
super().__init__(msg, request_status_code)
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

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

Passing request_status_code to super().__init__() is incorrect. The base Exception class expects only the error message(s) as arguments. The request_status_code should only be stored in the instance variable _request_status_code on line 407, not passed to the parent constructor.

The correct implementation should be:

super().__init__(msg)
Suggested change
super().__init__(msg, request_status_code)
super().__init__(msg)

Copilot uses AI. Check for mistakes.
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.

1 participant