Skip to content

Conversation

akx
Copy link
Member

@akx akx commented Mar 17, 2025

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: skips, 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.

Copy link

codecov bot commented Mar 18, 2025

Codecov Report

Attention: Patch coverage is 89.21569% with 22 lines in your changes missing coverage. Please review.

Project coverage is 92.10%. Comparing base (de44e18) to head (859ba8d).
Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
babel/dates.py 68.75% 10 Missing ⚠️
babel/messages/checkers.py 60.00% 2 Missing ⚠️
babel/messages/frontend.py 92.85% 2 Missing ⚠️
babel/core.py 91.66% 1 Missing ⚠️
babel/localtime/_win32.py 0.00% 1 Missing ⚠️
babel/messages/catalog.py 94.11% 1 Missing ⚠️
babel/messages/extract.py 94.11% 1 Missing ⚠️
babel/messages/pofile.py 92.30% 1 Missing ⚠️
babel/numbers.py 96.15% 1 Missing ⚠️
babel/support.py 93.75% 1 Missing ⚠️
... and 1 more
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     
Flag Coverage Δ
macos-14-3.10 91.14% <89.21%> (+0.11%) ⬆️
macos-14-3.11 91.07% <89.21%> (+0.11%) ⬆️
macos-14-3.12 91.29% <89.21%> (+0.11%) ⬆️
macos-14-3.13 91.29% <89.21%> (+0.11%) ⬆️
macos-14-3.8 91.00% <89.21%> (+0.11%) ⬆️
macos-14-3.9 91.07% <89.21%> (+0.11%) ⬆️
macos-14-pypy3.10 91.14% <89.21%> (+0.11%) ⬆️
ubuntu-24.04-3.10 91.16% <89.21%> (+0.11%) ⬆️
ubuntu-24.04-3.11 91.09% <89.21%> (+0.11%) ⬆️
ubuntu-24.04-3.12 91.31% <89.21%> (+0.11%) ⬆️
ubuntu-24.04-3.13 91.31% <89.21%> (+0.11%) ⬆️
ubuntu-24.04-3.8 91.02% <89.21%> (+0.11%) ⬆️
ubuntu-24.04-3.9 91.09% <89.21%> (+0.11%) ⬆️
ubuntu-24.04-pypy3.10 91.16% <89.21%> (+0.11%) ⬆️
windows-2022-3.10 91.15% <88.72%> (+0.11%) ⬆️
windows-2022-3.11 91.08% <88.72%> (+0.11%) ⬆️
windows-2022-3.12 91.30% <88.72%> (+0.11%) ⬆️
windows-2022-3.13 91.30% <88.72%> (+0.11%) ⬆️
windows-2022-3.8 91.12% <88.72%> (+0.11%) ⬆️
windows-2022-3.9 91.08% <88.72%> (+0.11%) ⬆️
windows-2022-pypy3.10 91.15% <88.72%> (+0.11%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@akx akx marked this pull request as ready for review March 18, 2025 08:08
@akx akx force-pushed the reruff branch 3 times, most recently from c0e3a27 to a587a5b Compare March 19, 2025 11:05
@akx akx marked this pull request as draft March 19, 2025 11:05
@akx akx force-pushed the reruff branch 2 times, most recently from 74912ba to d026dca Compare June 24, 2025 06:52
@akx akx marked this pull request as ready for review June 24, 2025 12:02
@akx akx requested review from Copilot and tomasr8 June 24, 2025 12:02
Copy link

@Copilot 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 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

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