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
Refactor V2 Black implementation #8671
Refactor V2 Black implementation #8671
Conversation
…on_target This will allow us to add rules/isort.py
8b82563
to
172c173
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.
So, there is potentially a larger concern with installing multiple auto-formatters this way. Which is that we haven't designed how to have multiple formatters depend on one another's output without knowing about eachother.
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.
So, there is potentially a larger concern with installing multiple auto-formatters this way. Which is that we haven't designed how to have multiple formatters depend on one another's output without knowing about eachother.
Oh! Interesting point! I don't think that should block this PR, but I agree that we'll need to design this interaction.
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.
I like these changes a lot. Thanks for this. Left one comment about the one change that makes me a tad worried that we may be breaking functionality, but if it works as expected, I'm good with this.
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.
Looks good (subject to @pierrechevalier83 concerns, which hopefully we can resolve one way or another by adding a test :)) Thanks!
…gets (which is used by several partially_checkd targets)
We will soon be adding a V2 implementation for isort. This PR is prework to make the Black code a bit more generic so that we can have Black and isort coincide as two rules for
fmt-v2
andlint-v2
.python_fmt
intorules/black.py
andtargets/formattable_python_target
rules/isort.py
and reuse theFormattablePythonTarget
abstraction created originally for Black_generate_black_pex_args()
and_generate_black_request()
onto methods defined onBlackInput
/BlackSetup
to mirror ourPex
dataclassBlackInput
toBlackSetup
and add docstring explaining why we use this abstraction.async await
style for rules--black-config
to not usefingerprint=True
, which is irrelevant in a V2 world.