-
Notifications
You must be signed in to change notification settings - Fork 157
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
chore: Update Python development tools and unify Black into Ruff #1771
Conversation
- Mostly about missing type guards for the return value of `asyncio.gather(*, return_exceptions=True)`
.misc.md -> 1771.misc.md
NOTE: |
Currently I'd like to hold merging of this PR due to: |
Ah, we can use https://docs.astral.sh/ruff/settings/#format-preview ! But still there are some deviations, and the outcome is different for some complex (in terms of style) files like |
- Now ruff provides a full-fledged black compatible formatter on its own! - You may even disable the Black formatter completely in your IDE and editor to speed up your coding experience.
For now, let's stay on the 2023 stable style whereas both ruff and black almost identically works. |
Decided to commence a complete transition from black to ruff in favor of speed. (We are mono-repo with 670+ files to lint.) Backported and vendored the Ruff plugin with proper "formatter" support from Pantsbuild 2.20.0dev0. Now all our |
Backported-from: main Backported-to: 23.09
pants tailor
, which implicitly installs the black to scanBUILD
files.Note
You need to re-run:
pants export --resolve=black --resolve=mypy --resolve=ruff --resolve=black
to use the latest tool versions with your IDE or editor with LSPs.
Note
Note that black is deprecated but still remains as a dependency resolve set (
tools/black-requirements.txt
andtools/black.lock
) to prevent Pantsbuild from failing on setting uppants tailor
command when lintingBUILD
files.Important
Ruff now provides an intrinsic formatter that works almost in the same way Black does.
Now Ruff replaces Black completely, so please DISABLE the black formatter but ENABLE the ruff formatter in your IDE and editors.
when there are no sibling items.
Tip
This PR changes a wide range of source files as we replace the formatter implementation.
When you encounter conflicts during merging the updated main branch to your topic branch:
git checkout --ours
to keep your work.pants fix :: && pants fmt ::
.If you still see previously unobserved type errors, refer the commit 805128c to fix them.
Checklist: (if applicable)