RFR: 8311227: Add .editorconfig so IDEs would pick up the common settings automatically: indent, trim trailing whitespace [v2]

Kim Barrett kbarrett at openjdk.org
Mon Mar 10 10:56:53 UTC 2025


On Mon, 10 Mar 2025 09:03:40 GMT, David Linus Briemann <duke at openjdk.org> wrote:

>> Add an .editorconfig to define indentation, trim trailing whitespace and open curly brace position for C++ and Java.
>> This allows various editors to easily infer basics of the coding style.
>
> David Linus Briemann has updated the pull request incrementally with one additional commit since the last revision:
> 
>   simplify editorconfig

.editorconfig line 8:

> 6: [*.{cpp,hpp,c,h,cc,hh}]
> 7: indent_style = space
> 8: indent_size = 2

The HotSpot style guide prescribes 2 space indentation.  The rest of the JDK not so much, and
counterexamples abound.  For example, java.base/*/native looks to be 4 space indentation
(consistently? I only spot-checked).

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/23693#discussion_r1987049051


More information about the build-dev mailing list