RFR: 8352645: Add tool support to check order of includes

2025-04-05 Thread Doug Simon
This PR adds `bin/sort_includes.py`, a python3 script to check that blocks of include statements in C++ files are sorted alphabetically and that there's at least one blank line between user and sys includes (as per the [style guide](https://github.com/openjdk/jdk/blob/master/doc/hotspot-style.md

Re: RFR: 8352645: Add tool support to check order of includes

2025-04-04 Thread Johan Sjölen
On Sun, 23 Mar 2025 21:14:47 GMT, Doug Simon wrote: > This PR adds `bin/sort_includes.py`, a python3 script to check that blocks of > include statements in C++ files are sorted alphabetically and that there's at > least one blank line between user and sys includes (as per the [style > guide](h

Re: RFR: 8352645: Add tool support to check order of includes

2025-03-26 Thread Doug Simon
On Sun, 23 Mar 2025 21:14:47 GMT, Doug Simon wrote: > This PR adds `bin/sort_includes.py`, a python3 script to check that blocks of > include statements in C++ files are sorted alphabetically and that there's at > least one blank line between user and sys includes (as per the [style > guide](h

Re: RFR: 8352645: Add tool support to check order of includes

2025-03-26 Thread Stefan Karlsson
On Tue, 25 Mar 2025 22:19:39 GMT, Doug Simon wrote: >> src/hotspot/share/opto/output.cpp line 39: >> >>> 37: #include "opto/block.hpp" >>> 38: #include "opto/c2_MacroAssembler.hpp" >>> 39: #include "opto/c2compiler.hpp" >> >> Hmm. >> >> #include "opto/c2_MacroAssembler.hpp" >> #include "opto/c

Re: RFR: 8352645: Add tool support to check order of includes

2025-03-26 Thread Stefan Karlsson
On Tue, 25 Mar 2025 21:19:03 GMT, Doug Simon wrote: > Thanks for all the comments so far. > > First thing is that my tool does nothing about re-ordering block of > conditional includes vs unconditional includes. I briefly looked into that > but it gets very complicated, very quickly. That kind

Re: RFR: 8352645: Add tool support to check order of includes

2025-03-25 Thread Stefan Karlsson
On Tue, 25 Mar 2025 21:24:41 GMT, Doug Simon wrote: >> This PR adds `bin/sort_includes.py`, a python3 script to check that blocks >> of include statements in C++ files are sorted alphabetically and that >> there's at least one blank line between user and sys includes (as per the >> [style >>

Re: RFR: 8352645: Add tool support to check order of includes

2025-03-25 Thread Doug Simon
On Sun, 23 Mar 2025 21:14:47 GMT, Doug Simon wrote: > This PR adds `bin/sort_includes.py`, a python3 script to check that blocks of > include statements in C++ files are sorted alphabetically and that there's at > least one blank line between user and sys includes (as per the [style > guide](h

Re: RFR: 8352645: Add tool support to check order of includes

2025-03-25 Thread Doug Simon
On Tue, 25 Mar 2025 20:27:21 GMT, Stefan Karlsson wrote: >> This PR adds `bin/sort_includes.py`, a python3 script to check that blocks >> of include statements in C++ files are sorted alphabetically and that >> there's at least one blank line between user and sys includes (as per the >> [style

Re: RFR: 8352645: Add tool support to check order of includes

2025-03-25 Thread Doug Simon
On Sun, 23 Mar 2025 21:14:47 GMT, Doug Simon wrote: > This PR adds `bin/sort_includes.py`, a python3 script to check that blocks of > include statements in C++ files are sorted alphabetically and that there's at > least one blank line between user and sys includes (as per the [style > guide](h

Re: RFR: 8352645: Add tool support to check order of includes

2025-03-25 Thread Stefan Karlsson
On Sun, 23 Mar 2025 21:14:47 GMT, Doug Simon wrote: > This PR adds `bin/sort_includes.py`, a python3 script to check that blocks of > include statements in C++ files are sorted alphabetically and that there's at > least one blank line between user and sys includes (as per the [style > guide](h

Re: RFR: 8352645: Add tool support to check order of includes

2025-03-25 Thread Stefan Karlsson
On Tue, 25 Mar 2025 14:52:56 GMT, Magnus Ihse Bursie wrote: >> I pushed a commit that prevents the re-ordering: >> https://github.com/openjdk/jdk/pull/24180/commits/c0f202d2a7e7b8788719fe8cd2a4c7a095ecd3bb > > My gut reaction is that header files should be self-sustaining, that is if > they nee

Re: RFR: 8352645: Add tool support to check order of includes

2025-03-25 Thread Doug Simon
On Tue, 25 Mar 2025 14:56:27 GMT, Magnus Ihse Bursie wrote: > Did you consider writing the tool in Java? Or rather, could you be convinced > to convert it to Java? With the source code launch mechanism, it is just as > simple to run as a python script. Also, there is some kind of optics about i

Re: RFR: 8352645: Add tool support to check order of includes

2025-03-25 Thread Magnus Ihse Bursie
On Sun, 23 Mar 2025 21:14:47 GMT, Doug Simon wrote: > This PR adds `bin/sort_includes.py`, a python3 script to check that blocks of > include statements in C++ files are sorted alphabetically and that there's at > least one blank line between user and sys includes (as per the [style > guide](h

Re: RFR: 8352645: Add tool support to check order of includes

2025-03-25 Thread Magnus Ihse Bursie
On Tue, 25 Mar 2025 12:06:42 GMT, Doug Simon wrote: >> src/hotspot/cpu/aarch64/immediate_aarch64.cpp line 26: >> >>> 24: */ >>> 25: >>> 26: #include >> >> Moving these sys includes causes a build failure: >> https://github.com/dougxc/jdk/actions/runs/14054959680/job/39352322113#step:12:537

Re: RFR: 8352645: Add tool support to check order of includes

2025-03-25 Thread Doug Simon
On Tue, 25 Mar 2025 09:16:15 GMT, Doug Simon wrote: >> This PR adds `bin/sort_includes.py`, a python3 script to check that blocks >> of include statements in C++ files are sorted alphabetically and that >> there's at least one blank line between user and sys includes (as per the >> [style >>

Re: RFR: 8352645: Add tool support to check order of includes

2025-03-25 Thread Doug Simon
On Sun, 23 Mar 2025 21:14:47 GMT, Doug Simon wrote: > This PR adds `bin/sort_includes.py`, a python3 script to check that blocks of > include statements in C++ files are sorted alphabetically and that there's at > least one blank line between user and sys includes (as per the [style > guide](h