- 
                Notifications
    
You must be signed in to change notification settings  - Fork 24
 
Introduce more ruff rules #139
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
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 modernizes the Python codebase by applying various linting and code quality improvements. The changes update older Python idioms to their modern equivalents, improve code clarity, and enhance the CI/CD pipeline.
- Replaces old-style 
%string formatting with f-strings throughout the codebase - Updates 
super()calls to use the argument-free form available in Python 3+ - Adds 
stacklevel=2parameter towarnings.warn()calls for better warning source location - Replaces explicit iterator loops with 
yield fromstatements for cleaner generator delegation - Replaces deprecated 
socket.errorwithOSError - Adds 
from Noneto exception chains where appropriate to suppress context - Reorders imports alphabetically (alphabetically within import groups)
 - Updates Ruff linting configuration to enable additional rule sets (W, I, UP, B)
 - Restructures GitHub Actions workflow to run linting checks in a separate job
 
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description | 
|---|---|
| tdclient/util.py | Updated string formatting to f-strings, added stacklevel to warnings, replaced explicit loop with yield from, sorted imports | 
| tdclient/user_model.py | Modernized super() call | 
| tdclient/table_model.py | Modernized super() call and updated string formatting to f-strings | 
| tdclient/table_api.py | Updated string formatting to f-strings | 
| tdclient/server_status_api.py | Updated string formatting to f-strings | 
| tdclient/schedule_model.py | Modernized super() calls | 
| tdclient/result_model.py | Modernized super() call | 
| tdclient/result_api.py | Sorted imports | 
| tdclient/job_model.py | Modernized super() call and added stacklevel to warnings | 
| tdclient/job_api.py | Updated string formatting to f-strings, replaced explicit loop with yield from, removed blank line | 
| tdclient/export_api.py | Sorted imports | 
| tdclient/database_model.py | Modernized super() call | 
| tdclient/cursor.py | Updated string formatting to f-strings | 
| tdclient/connector_api.py | Updated string formatting to f-strings | 
| tdclient/client.py | Updated string formatting to f-strings, replaced explicit loops with yield from, sorted imports, removed blank line | 
| tdclient/bulk_import_model.py | Modernized super() call, updated string formatting to f-strings, replaced explicit loop with yield from | 
| tdclient/bulk_import_api.py | Updated string formatting to f-strings, replaced explicit loop with yield from | 
| tdclient/api.py | Updated string formatting to f-strings, replaced socket.error with OSError, added error chaining with from None/from error, removed socket import, removed blank line | 
| pyproject.toml | Added W, I, UP, and B rule sets to Ruff linting configuration | 
| docs/conf.py | Updated string formatting to f-strings | 
| .github/workflows/pythontest.yml | Created separate lint job and moved pyright check from test job to lint job | 
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
LGTM
Ensure code quality with introducing I, UP, B rules.
Merge after #138