Upgrade Ruff 0.16.2 - #12
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
Pull Request Overview
The PR is up to standards according to automated quality checks, but it contains documentation formatting errors and significant scope creep. Specifically, Markdown documentation for PLR6104 and PT018 contains prose text erroneously nested within code blocks, which will impact rendering. Additionally, the PR includes several dependency upgrades and .gitignore changes that are not mentioned in the title or description. The lack of updated tests for these new dependency versions presents a regression risk.
About this PR
- No test files were included or updated to verify that the upgraded dependencies (including NumPy and Pytest) do not introduce regressions.
- This PR contains scope creep. Title-unrelated changes to .gitignore and multiple dependencies should either be moved to separate PRs or explicitly documented in the description.
- The PR description is empty. Please provide context for the changes to assist with long-term maintenance and traceability.
Test suggestions
- Verify that Ruff 0.16.2 correctly handles assertions within TYPE_CHECKING blocks as per the documentation update in S101.
- Verify that the automated fixes for PT018 (pytest-composite-assertion) respect the 'preview' vs 'stable' safety rules described.
- Verify compatibility of the codebase with NumPy 2.5.2 and Pytest 9.1.1.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify that Ruff 0.16.2 correctly handles assertions within TYPE_CHECKING blocks as per the documentation update in S101.
2. Verify that the automated fixes for PT018 (pytest-composite-assertion) respect the 'preview' vs 'stable' safety rules described.
3. Verify compatibility of the codebase with NumPy 2.5.2 and Pytest 9.1.1.
TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback
| Fix safety | ||
| On stable, the rule's fix is always unsafe and not offered when it would remove comments in the | ||
| compound assertion. In preview, the fix is only unsafe when it would delete such comments and | ||
| safe otherwise. |
There was a problem hiding this comment.
🟡 MEDIUM RISK
Move the 'Fix safety' section (lines 27-30) outside the triple-backtick code block (after line 31) so that it is properly formatted as a Markdown header and text.
| An augmented assignment can also fail where the plain form succeeds. NumPy | ||
| writes the result into the target's buffer, so a *= b raises where | ||
| a = a * b would broadcast to a new shape or promote the dtype. The same | ||
| applies to a @= b, which requires the product to have the target's shape. | ||
| The fix replaces the whole statement, so any comments inside it are lost. |
There was a problem hiding this comment.
🟡 MEDIUM RISK
Move the descriptive text on lines 50-54 outside the triple-backtick code block (after line 55) to ensure it renders correctly as prose rather than Python code.
| .idea/ No newline at end of file | ||
| .idea/ | ||
|
|
||
| #Ignore vscode AI rules |
There was a problem hiding this comment.
⚪ LOW RISK
Nitpick: Remove the redundant '#Ignore vscode AI rules' comment and move the '.idea/' entry to a generic section for IDE-specific files, as it is related to JetBrains IDEs rather than VS Code.
No description provided.