-
Notifications
You must be signed in to change notification settings - Fork 160
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
$PROJECT_DIR$ in checkstyle-idea.xml replaced with absolute paths #430
Comments
Hi - this was last changed in #404, when we started using Hence if there's a change in the behaviour it's most likely a change in the IDEA version. Has this changed recently? And if so, do you recall what versions were involved? |
I'm seeing this behavior as well. I can't say if the behavior changed since this is my first time viewing the exported configuration, however my versions are: IntelliJ IDEA 2019.3 (#IU-193.5233.102) Edit: also one thing that might be relevant is my path to the <entry key="active-configuration" value="LOCAL_FILE:$PROJECT_DIR$/../checkstyle-shared/checkstyle.xml:Custom" /> which is turned to: <entry key="active-configuration" value="LOCAL_FILE:/Users/andrewryno/checkstyle-shared/checkstyle.xml:Custom" /> |
Thanks for the report. Is that a normal configuration layout, or something custom? I haven't encountered it before. |
Sorry, somehow missed your last reply. Not sure what you mean by normal/custom. By default it saves with |
No worries. By "custom" I meant "edited directly", rather than saved through the configuration UI. By your clarification I guess that you have manually edited it to try and accomplish your goal? From memory (it's been a while since I played with this), IDEA itself resolves The downside is that if it's IDEA doing it then we're probably scuppered. But I'll have a look in any case. |
…sals during out [de]tokenisation (#430)
Hello, I just stumbled upon the same problem with IntelliJ 2021.3.1 . Never seen this before, which is also weird. Some colleagues see the same behaviour, some others don't. I get this with every change hence I need to remember not to commit the change to the checkstyle configuration file. Would you know of work-around or how this has been solved for others? |
Unfortunately the above is an accurate representation of the progress, or lack of. Given IDEA is also involved in the resolution of this, is a bit messier than we'd hope. We also do manual checks in the plugin to try and tokenise the value where it starts with the IDEA project path, but this obviously isn't helping in this case. Without a reproducible case, I don't expect much progress to be made here. Indeed, it may be unfixable, as the concept of a "project path" has become very ambiguous in newer versions of IDEA - even the API call is now called guessProjectDir, with this delightful explanation:
So it's possible, given the above, that it could be dependent on the local project setup, and hence may differ from workstation to workstation. Which is madness. One thought - are you using Windows? I only use MacOS and hence all my testing is with Unix paths, and we've certainly run into problems before with some of the delights of Windows FS paths. |
Thanks @jshiell for the help. I am on Linux, no Windows. |
It seems whenever someone edits something, and saves the settings in the Checkstyle-Dialog with "OK", IntelliJ resolves the |
#569 appears to be a reoccurrence of this. As stated there, it's messy, because it's IDEA that does this transformation rather than the plugin. Presumably we're doing something to trigger this behaviour, but finding it is proving difficult - in a large part because I still can't reproduce it. |
I have noticed that in my case, this happens when I commit changes through IntelliJ. As soon I commit a change, I will find the modified file. If I stick to committing from command line, this never happens. Hope this helps. |
Since one of the last updates (sorry, can't say for sure which one) the variable
$PROJECT_DIR$
in the filecheckstyle-idea.xml
is replaced with absolute paths which changes the file and requires me to manually revert it.The text was updated successfully, but these errors were encountered: