Skip to content

Update config, fix lints for ruff 0.15.2#204

Merged
inducer merged 1 commit intomainfrom
ruf152
Feb 21, 2026
Merged

Update config, fix lints for ruff 0.15.2#204
inducer merged 1 commit intomainfrom
ruf152

Conversation

@inducer
Copy link
Owner

@inducer inducer commented Feb 21, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 21, 2026 04:49
@inducer inducer enabled auto-merge (rebase) February 21, 2026 04:50
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 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.

Comment on lines +55 to +58
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"]
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
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",
]

Copilot uses AI. Check for mistakes.
@inducer inducer merged commit eba2a71 into main Feb 21, 2026
23 checks passed
@inducer inducer deleted the ruf152 branch February 21, 2026 05:08
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.

2 participants