-
Notifications
You must be signed in to change notification settings - Fork 38.2k
IntelliJ IDEA Editor Settings
Sam Brannen edited this page Sep 5, 2019
·
3 revisions
This page describes the noticeable changes made to the default code formatting settings in Intellij IDEA. This is also a chance to review some of these changes to validate or tweak them if necessary:
These are the reported issues that we still discuss (or simply things that the formatter does not support). The first is what we use.
- Space in annotation parameter assignment:
@Foo(name="foo")
vs.@Foo(name = "foo")
- Space in annotation array parameter:
@Target({ ElementType.METHOD, ElementType.TYPE })
vs.@Target({ElementType.METHOD, ElementType.TYPE})
- Default indent option to use tab character instead of space
- Use tab character
- Add a space before the left brace of an array initializer
- Keep when reformating: multiple expressions in one line, simple blocks in one line, simple classes in one line
-
else
,catch
andfinally
on new line - Method declaration parameters: do not align when multiline
- Keep one space before } (solely use to keep the space between the end of the last method and the end of the class)
- Minimum blank line after class header 0 (instead of 1)
- Disabled
- Use 100 for "Class count to use import with
*
" so that imported classes are always listed individually. - Use 0 for "Names count to use static imports with
*
" since static imports are only allowed in test sources where they can and should be aggregated, e.g.import static org.junit.Assert.*;
. - Use the following import sequence order:
java.*
<blank line>
javax.*
<blank line>
all other imports
<blank line>
org.springframework.*
import static all other methods