-
Notifications
You must be signed in to change notification settings - Fork 1
Add flake8-bugbear and ask Claude to fix all flake8 issues #82
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: main
Are you sure you want to change the base?
Conversation
I think it finds some interesting stuff. See: https://github.com/PyCQA/flake8-bugbear
🤖 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>
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 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-bugbearpackage (version 25.11.29) and its dependencyattrsto 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) |
Copilot
AI
Dec 2, 2025
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.
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)| super().__init__(msg, request_status_code) | |
| super().__init__(msg) |
No description provided.