-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
📋 Formatter black compatibility tracking issue #5828
Comments
I know it's comment placement, but is #5630 related to black compatibility? |
i'd expect fixing this would be a minor improvement in the compatibility score, but it's unfortunately hard to tell beforehand |
Old numbers: build: similarity index 0.738 New numbers: build: 40 files, similarity index 0.740 I'm unsure what happened with typeshed |
#5882 fixes the transformers bugs, after that all test projects pass without errors (except for those files that already have syntax errors in the input) |
Updated the gist to today (https://gist.github.com/konstin/edd2a914fdf4196020d9efa3f2c7e6ff) and filed issues for recurring themes. |
I minimized all cases of unstable formatting from the ecosystem checks: https://gist.github.com/konstin/61adab19d5615160750171944653673d . This gives us a single file that checks for all known cases of unstable formatting |
**Summary** Add script to shrink all formatter errors: This started as a fun idea and turned out really useful: This script gives us a single Python file with all formatter stability errors. I want to keep it around to occasionally update #5828 so I added it to the git. **Test Plan** None, this is a helper script
#6035 documents how to run the formatter progress tracking script yourself, and it's also part of CI now |
Tracking issue specifically for django: #6069 |
Updated the original post |
Was browsing. Figured I could cc #6905 (comment). Looks to be no longer used :) |
We've reached >99.9% in 5 out of 6 projects! There's still some differences remaining, but all nodes are implemented and all the big recurring themes are fixed, so i'm closing this issue. |
We will continuously update this issue with compatibility measure between our formatter and black and the general status of the formatter.
Not Implemented
not_yet_implemented
usages: 0not_yet_implemented_custom_text
usages: 0Select Projects / Small ecosystem check
To condense the compatibility over an entire repository, we use the similarity index. It is defined as the percentage of lines that remains unchanged between black's formatting and our formatting. You could compute it as the number of neutral lines in a diff divided by the neutral plus the removed lines.
I chose 6 different projects to check for now, we may update this list in the future.
To reproduce these numbers or to check your own changes, you can run
scripts/formatter_progress.sh
:django (web framework): 2752 files, similarity index 0.99805:
transformers (ML framework): 2527 files, similarity index 0.99620
black .
butblack examples tests src utils
, same thing for ruff)twine (small util library): 32 files, similarity index 0.99876
typeshed (stub files): 3627 files, similarity index 0.99953
warehouse (pypi backend): 641 files, similarity index 0.99601
zulip (a django user): 1424 files, similarity index 0.99727
Large ecosystem check
There is a number of formatter bugs showing up in the ecosystem checks, a list from 2023-08-21 is in https://gist.github.com/konstin/c7183dda99e65c7a1acbd970d2f44b42. Implicit string concatenation and fluent style seem to be the two common causes. Gist created by:
and manually removing e.g. slow formatting.
The text was updated successfully, but these errors were encountered: