Migrate Python formatter from yapf to black#182966
Migrate Python formatter from yapf to black#182966harryterkelsen wants to merge 3 commits intoflutter:masterfrom
Conversation
Migrates the engine\'s Python formatting from yapf to black. yapf depends on lib2to3 which was removed in Python 3.13, causing failures on machines with Python 3.14. Changes: - Added black CIPD package to DEPS. - Created black.sh/bat wrappers in tools/ to use the CIPD-managed black. - Updated format.dart to use black instead of yapf. - Added pyproject.toml for black configuration (line-length = 100). - Removed yapf scripts and configuration. - Updated documentation and code comments.
There was a problem hiding this comment.
Code Review
This pull request migrates the Python code formatter from yapf to black. This includes removing yapf configuration and scripts, adding black configuration in pyproject.toml and wrapper scripts, and updating the format.dart script to use black for Python formatting. A large number of Python files have been reformatted with black, and documentation has been updated to reflect this change.
|
This pull request executed golden file tests, but it has not been updated in a while (20+ days). Test results from Gold expire after as many days, so this pull request will need to be updated with a fresh commit in order to get results from Gold. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
Migrates the engine's Python formatting from yapf to black. yapf depends on lib2to3 which was removed in Python 3.13, causing failures on machines with newer Python versions.
Changes:
Fixes #158384
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.