checkstyle-idea
checkstyle-idea copied to clipboard
cache configuration
If you specify the use of a configuration with HTTP resource, the plug-in checking each time trying to pick up the file from the network. More logical to caching plugin to periodically check for updates for at least two reasons:
- The configuration file is not updated as often
- The configuration file may not be available at this time (eg IDE installed on the laptop and the developer is off-line)
It is cached, but only for 30s :-) The reason for this is that it was an experimental feature added for someone - very little thought went into it. So it's pretty naive.
A better implementation would use caching, and fallback when the HTTP service wasn't available. It'd also be good to check for 304s and skip where required.
I'll be honest though, not high on my priorities at present.
@jshiell We have shared checkstyle config situated in separate github project. To not manually fetch and pull changes (in case they are) - was configured http link.
Sometimes there are errors in idea's event log:
SocketTimeoutException: Couldn't read URL: https://raw.github.com/...checkStyle.xml: connect timed out
But it's not problem.
Problem is that, after a year of using such config, under USER_HOME/.IntellijIdeaX/system/tmp was found about 1,500,000 files (looking like checkStyle{20digits}.xml).
The JVM is notoriously bad at deleting temp files. They should all be flagged for deletion on JVM shutdown, but that often doesn't work. I'll double check it in any case.
It seems odd that IDEA is redirecting the temporary directory, as otherwise the OS would ensure you wouldn't get into this state. Again, I'll double check this, but I'm pretty sure I'm using the JVM's tools for creating temp files.
Issue for me as well.
What OS(s) do you use? I don't seem to have any left over files at present (emphasis on at present - could be OS, could just be luck, I'm on OS X 10.11).
Looking further, it seems that the HTTP path relies entirely on File.deleteOnExit() to clean up. Given how unreliable it is, I'll have a think about how this can be improved.
I've made a change so the HTTP fetch is now done in memory, rather than using a temp file. It's had next to no testing though, as I'd tied up this evening, hence it's only a test build. But if you could please give it a try and report back your results, I'd be most grateful. Thanks.
https://dl.dropboxusercontent.com/u/5423904/checkstyle-idea-4.20.1.zip
I have tried but plugin version is not compatible with my idea version )). May be Pavel will be more lucky.
Have same version and moreover I stick to Java6 because of https://bulenkov.com/2013/09/12/font-rendering-apple-jdk-6-vs-oracle-jdk-1-7-0_40/
I'm afraid bug fixes will only be done to head, which does need IDEA 14.x and JDK 8. IDEA publish their own JDK for use on OS X to fix the font rendering issue. I believe there are still edge cases, but I've been using that for some time with no problems.
In any case, I'll give my fix some further testing and push it out.
Updated to 4.20.1, thank you
Seems to be working fine, no issues found so far.
Superb, thanks for the update!