-
Notifications
You must be signed in to change notification settings - Fork 459
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
spotlessXmlApply task is never completing #308
Comments
@JLLeitschuh Do you have a little bit more input. I applied the formatter in spotlessSelf.gradle and also in a small sample. |
This might be caused by spotless trying to format a file that is opened by another process? Is there any way I could tell that? |
I am only aware that Windows uses mandatory file locking. What OS do you use?
|
It's listed in the original issue, but anyways: |
Ah, sorry, have no web at the moment. OS X behaves to my understanding like any other UNIX. No mandatory file locking. Has the download from Maven Central been completed? Can you check the open TCP connections? Unfortunately I have not finished the logging implementation, so there is not much feedback from the Eclipse formatters yet.
|
Just realized that you can see the download of the Eclipse dependencies also in the Gradle debug output. If that is also okay, I can only think of the DTD/XSD resolver. You can check by removing the references in your XML files.
|
Why would the formatter/linter be downloading the XSD or DTD's? I want my formatter to format, not ensure that the XML is valid. |
XSD and DTD can contain instructions how to treat whitespace. Eclipse just ignores (got a unit test) missing XSD and DTD. However, theoretically there can be network setups where a timeout takes a while. I also once had an issue where the XSD was badly written (generated) and was in total so big, that the parser required more memory.
|
@JLLeitschuh I was quite busy the last two weeks. With my small sample, I was not able to reproduce the problem, but I found that the debug output from gradle is quite good. In my example I get the following debug output:
Can you provide your output? Maybe it gives me a better idea, where the problem might be... |
I'll see what I can do on monday, sure. |
I experienced the same problem using spotless-gradle-plugin 3.15. It would not do any formatting.
Moving to a newer spotless 3.18 that now has changed the XML configuration to eclipseWtp I now can format my XML again.
Sadly though it does more than I want, when using the eclipse configuration. In comparison with xmllint, it breaks lines after the lineWidth, and it formats comment sections making them "ugly" and unreadable. The lineWidth problem I can circumvent by setting it to a high value 500. |
@DJViking I am surprised to hear that the formatting did not work with spotless-gradle-plugin 3.15. As stated before, I was never able to reproduce the problem. For spotless-gradle-plugin 3.18 nothing has changed on the XML processor, except the scripting syntax. But the old syntax is still supported. Both syntax using internally the same functions. I would really appreciate some trace logs from gradle demonstrating the problem. About the "ugly and unreadable" formatting: The properties you configure in the Eclipse GUI are stored in |
Hold on. @fvgh. If you're seeing HTTP get requests inside of your XML parser that means that the parser is vulnerable to XXE. We need to fix this so that the spotless XML formatter is not making external entity requests. We can't have our linting infrastructure making web requests. Especially web requests over HTTP as those can be maliciously intercepted by a MITM. Here's an example where this has been a serious problem in the past. https://research.checkpoint.com/parsedroid-targeting-android-development-research-community/ CC: @nedtwigg |
Thanks for the heads up. It was there all along in Eclipse, staring me right in the face, but I did not see it. |
@JLLeitschuh I admit that the WTP should respect the Anyhow, please open a new issue for this topic. To be hones, it is not urgent for me. Every formatter can contain holes in its parsing step. With external URIs it is easier to get something into the parser unnoticed, that is true. |
Can we close this one @JLLeitschuh? |
I no longer have access to the repository that had this problem. New job. I now work for Gradle! 😄 |
Congrats! Gradle is very lucky, and so are the rest of us! Since this issue is unlikely to see more action, I'll close it for now. |
Running
./gradlew spotlessXmlApply
the:spotlessXml
task is never completing.This is a little bit of the output running with the gradle
--info
flag:After this, the process gets hung up.
Spotless version:
3.15.0
.The text was updated successfully, but these errors were encountered: