-
Notifications
You must be signed in to change notification settings - Fork 460
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
Better method for managing python black package #674
Comments
When this is run on linux the
This doesn't parse with the regex I see this has already been fixed, sorry for the confusion |
One way to "bundle" black would be to bootstrap a python-environment with black using gradle-python-envs from JetBrains:
However, this always bootstraps MiniConda and the environment, independent of whether another python installation with black already exists. |
This would work for the Gradle plugin, but not the Maven one, and that's fine with me! One way to incorporate something like this would be to add documentation to the manual on how to glue the two plugins together: https://github.com/diffplug/spotless/tree/main/plugin-gradle#black and then do |
Unfortunately, it seems like this approach won't work. |
Ahh, yes. |
@ibabel-chwy if you have a specific problem you should open a new issue and include the requested info (version, logs, etc) |
Is there a way to say "use whatever version of black you find on the path"? I would have assumed that's what happened by using the default: spotless {
python {
target '**/*.py'
black()
}
} but it appears the default that spotless sets (22.3.0) is a necessity?
|
You can specify |
We are able to call
black
by shelling out to it on the system path, and we are able to cache its results by enforcing a version check on the binary. However, if it isn't on the path, or the version is wrong, we just show a helpful error message and let the user figure it out from there:spotless/lib/src/main/java/com/diffplug/spotless/python/BlackStep.java
Lines 65 to 66 in 608e128
It would be nice if we could handle this better, or at least have better instructions. There are a few python plugins in the gradle ecosystem, I'll reach out to them to see if they are interested.
The text was updated successfully, but these errors were encountered: