8323158: HotSpot Style Guide should specify more include ordering#23388
8323158: HotSpot Style Guide should specify more include ordering#23388stefank wants to merge 3 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back stefank! A progress list of the required criteria for merging this PR into |
|
@stefank This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 276 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
Webrevs
|
kimbarrett
left a comment
There was a problem hiding this comment.
Just a couple of minor wording nits. Otherwise looks good to me.
|
A lot of these rules looks like they could be checked with some simple scripting or additions to jcheck. Have you considered that? |
I haven't felt the urge to write such a script, but I know that others have scripts to sort the includes. |
Ok, it was just a suggestion. My experience is that while clearly written conventions/rules are important, the more they can be automated, the less hassle for everyone. |
I agree, that a script is beneficial. Do you know of anyone that would be willing to help out and write such script? |
tstuefe
left a comment
There was a problem hiding this comment.
This looks good to me. Thank you.
dholmes-ora
left a comment
There was a problem hiding this comment.
Generally seems fine. Thanks.
| <li><p>Put conditional inclusions (`#if ...`) at the end of the section of HotSpot | ||
| include lines. This also applies to macro-expanded includes of platform | ||
| dependent files.</p></li> |
There was a problem hiding this comment.
What is the order for the conditional sections? Alphabetic on the include guard?
There was a problem hiding this comment.
I don't think there's a set order. I wouldn't mind making it alphabetic with platforms includes coming before the other conditional includes.
There was a problem hiding this comment.
FWIW, I also tend to sort the forward declarations but that's also not something that everyone does.
There was a problem hiding this comment.
FWIW, I also tend to sort the forward declarations but that's also not something that everyone does.
I, too, am an obsessive sorter. Clean code is good code.
|
We could use clang-format for these specific include rules. For example, when we still had Implementing all of the rules for Clang format is left as an exercise to the reader, and the author would be very appreciative if someone posted their solution here :-). |
|
/label -build |
|
@magicus |
|
This RFR has now been out for a while, with positive feedback from HotSpot Members, and no negative feedback. I think that this we have reached consensus about this update. Thanks for reviewing! /integrate |
|
Going to push as commit 649ef77.
Your commit was automatically rebased without conflicts. |
The HotSpot Style Guide has a section about source files and includes. The style used for includes have mostly been introduced by scripts when includeDB was replaced, but also when various other enhancements to our includes were made. Some of the introduced styles were never written down in the style guide.
I propose a couple of changes to the HotSpot Style Guide to reflect some of these implicit styles that we have. While updating the text I also took the liberty to order the items in an order that I felt was good.
Note that JDK-8323158 contains a few more suggestions, but I've only addressed the items that I think can be accepted without much contention. Either I extract the items that have not been address into a new RFE, or I create a new RFE for this PR.
There a some small whitespace tweaks that I made so that the .md and .html had a similar layout.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/23388/head:pull/23388$ git checkout pull/23388Update a local copy of the PR:
$ git checkout pull/23388$ git pull https://git.openjdk.org/jdk.git pull/23388/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 23388View PR using the GUI difftool:
$ git pr show -t 23388Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/23388.diff
Using Webrev
Link to Webrev Comment