Fix Ruff formatting violations blocking CI style check - #7
Merged
Conversation
…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
marked this pull request as ready for review
March 2, 2026 00:29
01101sam
approved these changes
Mar 2, 2026
There was a problem hiding this comment.
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
lambdabody 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 inChannelForbiddenbranch to multi-line with double quoteshydrogram/parser/utils.py— wrap lambda body in parentheses to satisfy Ruff's inline-comment formatting ruledev_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.