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

David Linus Briemann duke at openjdk.org
Mon Apr 7 07:11:52 UTC 2025


On Tue, 11 Mar 2025 09:12:45 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:
> 
>   make editorconfig hotspot specific

I have to respectfully disagree with your assessment for the following reasons:

- The editorconfig as defined in this PR follows the hotspot style guide and the indentation settings only apply to hotspot code.
- How does it conflict with the jcheck rules? The rules defined in this editorconfig are stricter than the jcheck rules. So jcheck could not find issues after the editorconfig rules were applied.
- Providing an editorconfig as you proposed in #24448 is not a good idea in my opinion. 
Only defining whitespace trimming will not provide real benefit to anyone. However the existing editorconfig file would conflict with locally defined ones and cause problems for developers using these files to define project specific formatting. 
So no editorconfig would be better than one representing only a small part of the core formatting rules.

I also would ask about `jcheck`. Where and how is it used. The only information I found are:
<https://openjdk.org/projects/code-tools/jcheck/> and the config file in `jdk/.jcheck`.

Thanks

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

PR Comment: https://git.openjdk.org/jdk/pull/23693#issuecomment-2782242008


More information about the hotspot-dev mailing list