Conversation
There was a problem hiding this comment.
Pull request overview
This pull request updates the ruff linter configuration and applies automatic fixes for new lint rules introduced in ruff 0.15.2. The changes include configuration updates to ignore specific rules and code refactoring to address linting warnings.
Changes:
- Added TRY300 and SIM102 to the global ignore list in ruff configuration
- Added file-specific lint exceptions for S102 (exec usage) and SIM115
- Simplified return statements in test callbacks to be more concise
- Refactored code to use modern Python idioms (removeprefix, tuple startswith, implicit string concatenation)
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Added new lint rule exceptions (TRY300, SIM102) and file-specific ignores for S102 and SIM115 |
| test/test_isl.py | Simplified callback return statements to directly return results instead of intermediate variable assignment |
| stubgen/stubgen.py | Added noqa comment for exec usage and refactored string list to use implicit concatenation |
| islpy/_monkeypatch.py | Changed import style from import islpy._isl as _isl to from islpy import _isl for consistency |
| gen_wrap.py | Multiple refactorings: PYTHON_RESERVED_WORDS as list literal, removeprefix usage, startswith with tuples, simplified conditionals, inline returns |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| PYTHON_RESERVED_WORDS = ["and", "del", "from", "not", "while", "as", "elif", "global", | ||
| "or", "with", "assert", "else", "if", "pass", "yield", "break", "except", "import", | ||
| "print", "class", "exec", "in", "raise", "continue", "finally", "is", "return", "def", | ||
| "for", "lambda", "try"] |
There was a problem hiding this comment.
The PYTHON_RESERVED_WORDS list has inconsistent formatting with line breaks in the middle of the list items. The list should either be formatted with proper line breaks and indentation for better readability, or kept on one line if it's not too long. As it stands, lines 55-58 have awkward line breaks that make it difficult to read. Consider reformatting this list to be more readable, such as one item per line or proper alignment.
| PYTHON_RESERVED_WORDS = ["and", "del", "from", "not", "while", "as", "elif", "global", | |
| "or", "with", "assert", "else", "if", "pass", "yield", "break", "except", "import", | |
| "print", "class", "exec", "in", "raise", "continue", "finally", "is", "return", "def", | |
| "for", "lambda", "try"] | |
| PYTHON_RESERVED_WORDS = [ | |
| "and", | |
| "del", | |
| "from", | |
| "not", | |
| "while", | |
| "as", | |
| "elif", | |
| "global", | |
| "or", | |
| "with", | |
| "assert", | |
| "else", | |
| "if", | |
| "pass", | |
| "yield", | |
| "break", | |
| "except", | |
| "import", | |
| "print", | |
| "class", | |
| "exec", | |
| "in", | |
| "raise", | |
| "continue", | |
| "finally", | |
| "is", | |
| "return", | |
| "def", | |
| "for", | |
| "lambda", | |
| "try", | |
| ] |
No description provided.