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:
|
.fixCantFind("Try running `pip install black=={version}`, or else tell Spotless where it is with `black().pathToExe('path/to/executable')`") |
|
.fixWrongVersion("Try running `pip install --force-reinstall black=={version}`, or else specify `black('{versionFound}')` to Spotless") |
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.
We are able to call
blackby 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.