Keyboard

↓ ↑
move between the rows you can see
→
open a feature, then step into it
←
close a feature, or step out to the one above
Enter
go to the page in focus
Tab
the same rows, plus everything else on the page
/
search the whole report
m
open or close the navigation drawer
Esc
leave the search box, or close the drawer
?
this list

Reads the indent from .editorconfig, or from the caller

All 10 scenarios hold

The formatter carries no indent setting of its own. It asks EditorConfig, the convention the surrounding project already states. The search starts in the directory of the source file and walks up. The indent_style and indent_size it finds become the style and the size the Indentation feature applies.

The formatter resolves the style and the size one at a time. A file that sets only one of them leaves the caller's default in force for the other. Anything else the search cannot use leaves both defaults in force. A broken .editorconfig never fails a build.

Each row writes the file it shows into a temporary project with one Java source file. An indent takes the form style:size.

expected outcome broken scenario
ScenarioConfig file linesSitsCaller's defaultIndent used?
Two-space Java indent
  • root = true
  • [*.java]
  • indent_style = space
  • indent_size = 2
BESIDEspace:4space:2
Tabs, one per level
  • root = true
  • [*.java]
  • indent_style = tab
  • indent_size = 1
BESIDEspace:4tab:1
Setting from a parent
  • root = true
  • [*.java]
  • indent_style = tab
  • indent_size = 1
ANCESTORspace:4tab:1
A file that ends the search
  • root = true
BESIDEspace:4space:4
A style but no size
  • root = true
  • [*.java]
  • indent_style = tab
BESIDEspace:4tab:4
A size but no style
  • root = true
  • [*.java]
  • indent_size = 2
BESIDEtab:1tab:2
A section for other files
  • root = true
  • [*.kt]
  • indent_style = tab
  • indent_size = 1
BESIDEspace:4space:4
No .editorconfig at all[]NOWHEREspace:4space:4
A file that cannot be read
  • this is not valid editorconfig
  • [unclosed section
BESIDEspace:4space:4
Caller asking for no indent[]NOWHEREspace:0space:0