Skip to content

Fix Ruff formatting violations blocking CI style check - #7

Merged
01101sam merged 3 commits into
devfrom
copilot/fix-action-run-issue
Mar 2, 2026
Merged

Fix Ruff formatting violations blocking CI style check#7
01101sam merged 3 commits into
devfrom
copilot/fix-action-run-issue

Conversation

Copilot AI commented Mar 2, 2026

Copy link
Copy Markdown

The "Check style" CI workflow was failing due to Ruff formatting violations introduced by the Layer 223 MTProto schema update. The key constraint: CI pins ruff==0.12.5, which formats some constructs differently than newer versions.

Changes

  • hydrogram/types/user_and_chats/chat.py — reformat long ternary in ChannelForbidden branch to multi-line with double quotes
  • hydrogram/parser/utils.py — wrap lambda body in parentheses to satisfy Ruff's inline-comment formatting rule
  • dev_tools/generate_docs_json.py — preserve the dict comprehension method-chain format expected by ruff 0.12.5 (differs from 0.15.x)

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…on.py

Co-authored-by: 01101sam <100821827+01101sam@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issue with action run in hydrogram repository Fix Ruff formatting violations causing CI style check failure Mar 2, 2026
Co-authored-by: 01101sam <100821827+01101sam@users.noreply.github.com>
Copilot AI changed the title Fix Ruff formatting violations causing CI style check failure Fix Ruff formatting violations blocking CI style check Mar 2, 2026
@01101sam
01101sam marked this pull request as ready for review March 2, 2026 00:29
Copilot AI review requested due to automatic review settings March 2, 2026 00:29
@01101sam
01101sam merged commit 28e6933 into dev Mar 2, 2026
24 checks passed
@01101sam
01101sam deleted the copilot/fix-action-run-issue branch March 2, 2026 00:30

Copilot AI left a comment

Copy link
Copy Markdown

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 fixes CI “Check style” failures by applying formatting adjustments compatible with the repository’s pinned ruff==0.12.5, addressing differences introduced by a recent MTProto schema update.

Changes:

  • Reformats a long conditional expression in channel chat parsing to a multi-line layout.
  • Adjusts a lambda body formatting in text surrogate handling to satisfy Ruff’s inline-comment formatting expectations.
  • Preserves a dict-comprehension/method-chain layout in the docs JSON generator to match Ruff 0.12.5 formatting behavior.

Reviewed changes

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

File Description
hydrogram/types/user_and_chats/chat.py Multi-line formatting for the ChannelForbidden type= conditional expression to satisfy Ruff formatting.
hydrogram/parser/utils.py Wraps the lambda body in parentheses to satisfy Ruff formatting around inline comments.
dev_tools/generate_docs_json.py Keeps method-chain formatting within a dict comprehension consistent with Ruff 0.12.5 expectations.

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

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.

3 participants