0

I've seen lots of mentions of using the idea plugin for Gradle to configure IntelliJ's code formatting, but I can't find any examples of what this would look like. I gather it would involve modifying the XML of IntelliJ's config files directly, but I can't find any examples of that either. Anyone have an example, or an explanation of how I can determine what's needed for this?

plugins {
    id 'idea'
}

idea {
    project {
        jdkName = "1.8"
        languageLevel = "1.8"
        targetBytecodeVersion = JavaVersion.VERSION_1_8

       // Now What? How do I control code formatting?
    }
}
Brad Mace
  • 27,194
  • 17
  • 102
  • 148
  • 1
    Only via hacks: https://stackoverflow.com/a/26128890/104891. Consider using EditorConfig instead. – CrazyCoder Oct 27 '21 at 17:51
  • EditorConfig is nice but it's hardly a replacement for any IDE's full set of code formatting options. – Brad Mace Oct 27 '21 at 18:19
  • IntelliJ IDEA exports its code style to .editorconfig, all the options will be supported by the IDE formatter. – CrazyCoder Oct 27 '21 at 18:20
  • What am I missing [here](https://editorconfig.org/)? I see like 5 basic options that EditorConfig supports. Nothing about placement of braces, line wrapping, import grouping, or a hundred other settings IntelliJ supports. – Brad Mace Oct 27 '21 at 19:25
  • 1
    IntelliJ IDEA exports all its formatting options that will be supported by the IDE. They will be not supported by the other editors, of course. – CrazyCoder Oct 27 '21 at 19:27

0 Answers0