Skip to content

Ruff152 - #353

Merged
inducer merged 2 commits into
mainfrom
ruff152
Feb 20, 2026
Merged

Ruff152#353
inducer merged 2 commits into
mainfrom
ruff152

Conversation

@inducer

Copy link
Copy Markdown
Owner

No description provided.

CopilotAI review requested due to automatic review settings February 20, 2026 19:52

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 applies Ruff linter suggestions to improve code quality and consistency across the codebase. The changes are primarily automated refactorings that follow modern Python conventions and the project's configured linting rules.

Changes:

  • Consolidated imports from the same module (e.g., from pytools import ndindex, obj_array)
  • Simplified Literal type syntax from Literal["C"] | Literal["F"] to Literal["C", "F"]
  • Removed unnecessary intermediate variable assignments before returns
  • Removed unnecessary ellipsis and pass statements
  • Simplified lambda expressions to built-in constructors (e.g., lambda: {} to dict)
  • Added noqa comments for legitimate exec() usage in code generation contexts
  • Updated Ruff configuration to ignore TRY300 and TRY004 rules, and added S102 exceptions for test and documentation files
  • Removed obsolete import and cleaned up basedpyright baseline entries

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
FileDescription
test/test_arraycontext.pyConsolidated pytools imports into a single line
examples/how_to_outline.pyConsolidated pytools imports and simplified return statement
arraycontext/typing.pySimplified Literal type syntax for OrderCF type alias
arraycontext/impl/pytato/fake_numpy.pyRemoved unnecessary ellipsis from _full_like_array method
arraycontext/impl/pytato/compile.pySimplified default_factory lambda to dict constructor and removed unnecessary pass statement
arraycontext/impl/pytato/init.pySimplified return statements by removing intermediate variable assignments
arraycontext/impl/pyopencl/taggable_cl_array.pySimplified Literal type syntax in function signatures
arraycontext/impl/pyopencl/init.pySimplified return statement in transform_loopy_program method
arraycontext/context.pyRemoved obsolete import statement and adjusted spacing
arraycontext/container/dataclass.pyAdded noqa: S102 comment for exec() usage in code generation
arraycontext/container/arithmetic.pyAdded noqa: S102 comment for exec() usage in code generation
pyproject.tomlAdded TRY300 and TRY004 to extend-ignore list and S102 exceptions for test/doc files
.basedpyright/baseline.jsonRemoved baseline entries for arraycontext/impl/pytato/outline.py

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

Comment threadarraycontext/context.py Outdated
@inducer
inducer enabled auto-merge (rebase) February 20, 2026 20:08
@inducer
inducer merged commit 9f03eb9 into mainFeb 20, 2026
11 checks passed
@inducer
inducer deleted the ruff152 branch February 20, 2026 20:20
Sign up for freeto 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

@inducer