-
Notifications
You must be signed in to change notification settings - Fork 461
Apply reformatting by hand and with Ruff #1202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1202 +/- ##
==========================================
+ Coverage 91.98% 92.10% +0.11%
==========================================
Files 27 27
Lines 4693 4685 -8
==========================================
- Hits 4317 4315 -2
+ Misses 376 370 -6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
c0e3a27
to
a587a5b
Compare
74912ba
to
d026dca
Compare
There was a problem hiding this 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 standardizes code formatting in the babel/
directory using Ruff (line length set to 95) and manual # fmt: skip
annotations, without altering functionality, and updates tooling configs.
- Set Ruff line-length to 95 to balance existing line widths and readability
- Reformatted all Babel modules for consistent multi-line arguments and trailing commas
- Bumped the Ruff hook version in
.pre-commit-config.yaml
Reviewed Changes
Copilot reviewed 22 out of 26 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
pyproject.toml | Added line-length = 95 to the Ruff config |
babel/util.py | Multi-line regex and function signatures |
babel/units.py | Expanded format_decimal and dict lookups |
babel/support.py | Reformatted method calls and class slots |
babel/plural.py | Multi-line function definitions |
babel/numbers.py | Multi-line literals and warning calls |
babel/messages/pofile.py | Expanded constructors and ValueError calls |
babel/messages/plurals.py | Added # fmt: skip to closing brace |
babel/messages/mofile.py | Streamlined comprehensions and header packing |
babel/messages/jslexer.py | Added # fmt: skip , expanded signatures |
babel/messages/frontend.py | Wrapped lists and log calls |
babel/messages/extract.py | Expanded type aliases and calls |
babel/messages/checkers.py | Reformatted TranslationError messages |
babel/messages/catalog.py | Expanded regex conditions and property defs |
babel/localtime/_win32.py | Condensed lookup exception |
babel/localtime/_fallback.py | Added # fmt: skip to a closing parenthesis |
babel/localedata.py | Reformatted comprehension and constructor |
babel/lists.py | Multi-line Literal for style argument |
babel/languages.py | Expanded function signatures |
babel/dates.py | Reformatted type aliases and functions |
babel/core.py | Expanded error messages and repr/str methods |
.pre-commit-config.yaml | Bumped Ruff hook from v0.9.1 to v0.12.0 |
This PR updates Ruff, configures the target line-length to 95 (strikes a balance between the current line lengths in the repo and readability), and formats
babel/
.Some artful
# fmt: skip
s, as well as very minor refactoring was done to keep things more readable.Tests are unformatted in this PR to prove that there are no functional changes in the
babel/
code, so as to make this easy to review.A future PR will likely reformat
tests/
similarly, and enforce formatting in CI.