Skip to content

Comments

Ruff152#983

Merged
inducer merged 2 commits intomainfrom
ruff152
Feb 21, 2026
Merged

Ruff152#983
inducer merged 2 commits intomainfrom
ruff152

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:40
@inducer inducer enabled auto-merge (rebase) February 21, 2026 04:41
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 PR implements various Ruff linting rule fixes (Ruff152) to improve code quality and consistency across the codebase.

Changes:

  • Simplified return statements by removing unnecessary intermediate variable assignments
  • Consolidated import statements using from imports where appropriate
  • Replaced string manipulation patterns with built-in methods like removesuffix(), removeprefix(), and startswith() with tuple arguments
  • Updated type hints to use Literal["A", "B"] instead of Literal["A"] | Literal["B"]
  • Replaced manual list building loops with list comprehensions

Reviewed changes

Copilot reviewed 63 out of 63 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/testlib.py Removed unnecessary pass statement after variable assignment
test/test_target.py Changed import style from import X as Y to from X import Y for clrandom
test/test_split_iname_slabs.py Simplified return statements by removing intermediate variable assignments
test/test_numa_diff.py Replaced manual string suffix removal with removesuffix() method
test/test_nbody.py Simplified multiple return statements by removing intermediate variables
test/test_loopy.py Consolidated imports using from syntax
test/test_linalg.py Simplified return statements across multiple variant functions
test/test_dg.py Removed intermediate variable assignments before returns
test/test_apps.py Simplified return statements in multiple test variant functions
test/gnuma_loopy_transforms.py Removed intermediate variables before return statements
pyproject.toml Added new Ruff rule exclusions and updated per-file ignores
loopy/type_inference.py Simplified control flow by removing redundant else after raising exception
loopy/translation_unit.py Renamed abc_Set to AbstractSet for clarity
loopy/transform/subst.py Removed intermediate variable assignment before return
loopy/transform/parameter.py Updated type hints and simplified return statements
loopy/transform/padding.py Updated Literal type hints to use comma-separated syntax
loopy/transform/loop_fusion.py Renamed Set import to AbstractSet and simplified returns
loopy/transform/instruction.py Added type hints and marked unused parameters with del
loopy/transform/iname.py Renamed Set to AbstractSet, simplified returns and conditionals
loopy/transform/fusion.py Simplified chained comparison expressions
loopy/transform/diff.py Removed intermediate variable before return
loopy/transform/data.py Replaced manual list building with list comprehension
loopy/transform/buffer.py Removed unnecessary assignment and intermediate variable
loopy/transform/batch.py Simplified return statement
loopy/transform/array_buffer_map.py Added assertion and simplified return
loopy/transform/add_barrier.py Removed intermediate variable before return
loopy/tools.py Updated function signatures with type hints, replaced string methods with built-ins
loopy/target/python.py Converted loop-based list building to list comprehension
loopy/target/pyopencl.py Simplified conditional logic and removed deprecated property
loopy/target/opencl.py Updated Literal type hints
loopy/target/execution.py Renamed Set import to AbstractSet
loopy/target/c/compyte Updated subproject commit hash
loopy/target/c/codegen/expression.py Removed intermediate variable before return
loopy/target/c/c_execution.py Changed exception type, removed pass statement, replaced string concatenation
loopy/target/c/init.py Updated regex flag from re.M to re.MULTILINE
loopy/target/init.py Reordered Generic type parameter position
loopy/symbolic.py Renamed Set to AbstractSet throughout, converted loops to comprehensions
loopy/statistics.py Converted dictionary building loops to comprehensions, removed unused function
loopy/schedule/tools.py Renamed Set to AbstractSet
loopy/schedule/device_mapping.py Removed intermediate variable before return
loopy/schedule/init.py Replaced TypeVar with Self, renamed Set to AbstractSet
loopy/preprocess.py Simplified return statements
loopy/match.py Simplified range expression
loopy/library/reduction.py Removed intermediate variables and unnecessary return statements
loopy/library/random123.py Removed unnecessary return statement
loopy/kernel/tools.py Renamed Set to AbstractSet, added type hints, improved loop efficiency
loopy/kernel/instruction.py Renamed abc_Set to AbstractSet, removed pass statement
loopy/kernel/function_interface.py Renamed Set to AbstractSet, reformatted method signatures
loopy/kernel/creation.py Updated Literal type hints, converted loops to comprehensions
loopy/kernel/init.py Renamed Set to AbstractSet, added type hints, converted loops to comprehensions
loopy/frontend/fortran/translator.py Removed intermediate variable before return
loopy/frontend/fortran/expression.py Updated regex flags to use named constants
loopy/frontend/fortran/init.py Consolidated imports, added noqa comments for exec usage
loopy/diagnostic.py Removed unnecessary pass statement
loopy/codegen/instruction.py Renamed Set to AbstractSet
loopy/codegen/control.py Renamed Set to AbstractSet
loopy/cli.py Added noqa comments for exec usage
examples/python/ispc-stream-harness.py Simplified return statements
examples/python/call-external.py Removed unnecessary return statement
examples/fortran/matmul-driver.py Changed import style
contrib/mem-pattern-explorer/pattern_vis.py Reordered imports
contrib/c-integer-semantics.py Removed shebang and blank line
.basedpyright/baseline.json Updated baseline for type checking

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@inducer inducer merged commit 018a513 into main Feb 21, 2026
20 of 21 checks passed
@inducer inducer deleted the ruff152 branch February 21, 2026 05:15
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.

1 participant