palantir / palantir/palantir-java-format
Project import fails with JetBrains Fleet
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 907
- Forks
- 101
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 19
Description
What happened?
When enabling Smart Mode with JetBrains Fleet, projects with this plugin applied fail due to the expectation that the .idea directory will exist:
java.io.FileNotFoundException: /home/coder/Projects/bb/edge/edgezuul/.idea/palantir-java-format.xml (No such file or directory)
at com.google.common.io.Files.newWriter(Files.java:110)
at com.palantir.javaformat.gradle.PalantirJavaFormatIdeaPlugin.updateIdeaXmlFile(PalantirJavaFormatIdeaPlugin.java:132)
at com.palantir.javaformat.gradle.PalantirJavaFormatIdeaPlugin.createOrUpdateIdeaXmlFile(PalantirJavaFormatIdeaPlugin.java:108)
at com.palantir.javaformat.gradle.PalantirJavaFormatIdeaPlugin.lambda$configureIntelliJImport$8(PalantirJavaFormatIdeaPlugin.java:87)
at org.gradle.internal.code.DefaultUserCodeApplicationContext$CurrentApplication$1.execute(DefaultUserCodeApplicationContext.java:122)
That's not the case with Fleet, but it is technically an IntelliJ import because that's what the smart mode backend is hosting.
What did you want to happen?
Avoid failing when the .idea directory does not exist. Workaround is to mkdir .idea.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at PalantirJavaFormatIdeaPlugin.createOrUpdateIdeaXmlFile and updateIdeaXmlFile, where the stack trace shows the IntelliJ import setup attempts to write under .idea. Reproduce a Fleet Smart Mode import without an existing .idea directory and verify that the project import succeeds without requiring the mkdir workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100