Update header sorting.
authorM. Eric Irrgang <ericirrgang@gmail.com>
Fri, 24 Apr 2020 13:15:42 +0000 (16:15 +0300)
committerM. Eric Irrgang <ericirrgang@gmail.com>
Thu, 30 Apr 2020 08:51:35 +0000 (11:51 +0300)
* Add missing C++ standard library headers to includesorter.py
* Work around some logic errors in the way includesorter.py enforces
  the stated scoping of sorted include blocks. Document.
* Apply updated includesorter.py

Refs #3297

20 files changed:
docs/doxygen/includesorter.py
src/api/cpp/context_impl.h
src/api/cpp/createsession.h
src/api/cpp/mdsignals.h
src/api/cpp/session_impl.h
src/api/cpp/workflow.h
src/api/cpp/workflow/tests/workflow.cpp
src/api/cpp/workflow_impl.h
src/gromacs/applied_forces/densityfittingforceprovider.cpp
src/gromacs/commandline/filenm.h
src/gromacs/gmxpreprocess/gmxcpp.cpp
src/gromacs/gmxpreprocess/topio.cpp
src/gromacs/math/utilities.cpp
src/gromacs/mdrun/tpi.cpp
src/gromacs/mdrunutility/handlerestart.cpp
src/gromacs/topology/residuetypes.cpp
src/gromacs/topology/residuetypes.h
src/gromacs/utility/path.cpp
src/gromacs/utility/path.h
src/gromacs/utility/tests/mutex.cpp

index f28b08c447ca86a257f849d4fa77d7616d33793b..1003caebec4dfb4d5ca9cbe58f16526345f7d01d 100755 (executable)
@@ -113,14 +113,68 @@ class GroupedSorter(object):
             'stddef.h', 'stdint.h', 'stdio.h', 'stdlib.h', 'string.h',
             'time.h']
     _std_c_cpp_headers = ['c' + x[:-2] for x in _std_c_headers]
-    _std_cpp_headers = ['algorithm', 'array', 'chrono', 'deque', 'exception', 'fstream',
-            'functional', 'initializer_list', 'iomanip', 'ios', 'iosfwd',
-            'iostream', 'istream', 'iterator',
-            'limits', 'list', 'map', 'memory', 'mutex',
-            'new', 'numeric', 'ostream', 'random',
-            'regex', 'set', 'sstream', 'stdexcept', 'streambuf', 'string', 'strstream',
-            'thread', 'tuple', 'type_traits', 'typeindex', 'typeinfo', 'vector',
-            'unordered_map', 'utility']
+    _std_cpp_headers = ['algorithm',
+                        'any',
+                        'array',
+                        'atomic',
+                        'charconv',
+                        'chrono',
+                        'cinttypes',
+                        'cfenv',
+                        'complex',
+                        'cstdint',
+                        'deque',
+                        'exception',
+                        'execution',
+                        'filesystem',
+                        'forward_list',
+                        'fstream',
+                        'functional',
+                        'future',
+                        'initializer_list',
+                        'iomanip',
+                        'ios',
+                        'iosfwd',
+                        'iostream',
+                        'istream',
+                        'iterator',
+                        'limits',
+                        'list',
+                        'locale',
+                        'map',
+                        'memory',
+                        'memory_resource',
+                        'mutex',
+                        'new',
+                        'numeric',
+                        'optional',
+                        'ostream',
+                        'queue',
+                        'random',
+                        'ratio',
+                        'regex',
+                        'scoped_allocator',
+                        'set',
+                        'sstream',
+                        'stack',
+                        'stdexcept',
+                        'streambuf',
+                        'string',
+                        'string_view',
+                        'strstream',
+                        'system_error',
+                        'thread',
+                        'tuple',
+                        'type_traits',
+                        'typeindex',
+                        'typeinfo',
+                        'unordered_map',
+                        'unordered_set',
+                        'valarray',
+                        'variant',
+                        'vector',
+                        'unordered_map',
+                        'utility']
 
     def __init__(self, style='pub-priv', absolute=False):
         """Initialize a sorted with the given style."""
index f55ad0ba42965a037aba0adeafc8408342a2d9f2..0b5f9a69b2c3216de5b8f884535e4775e130016f 100644 (file)
 #include <memory>
 #include <string>
 
-#include "gmxapi/context.h"
-#include "gmxapi/session.h"
-
 #include "gromacs/mdrun/legacymdrunoptions.h"
 #include "gromacs/mdtypes/mdrunoptions.h"
 
+// Above are headers for dependencies.
+// Following are public headers for the current module.
+#include "gmxapi/context.h"
+#include "gmxapi/session.h"
+
 namespace gmxapi
 {
 
index d3c40163773c50f95c845783863a6d6242cb99f5..fd6b2fe0c4d659e6fc2d46f98048dd3a6983171c 100644 (file)
  * \ingroup gmxapi
  */
 
+#include "gromacs/mdrunutility/logging.h"
+
+// Above are headers for dependencies.
+// Following are public headers for the current module.
 #include "gmxapi/context.h"
 #include "gmxapi/session.h"
 
-#include "gromacs/mdrunutility/logging.h"
-
 namespace gmx
 {
 class MdrunnerBuilder;
index 32ec22cac7c340ada925d68e378c4362ba8a5cff..2354712f9e55baf90e92720bbf974acbb5479252 100644 (file)
  * \ingroup gmxapi_md
  */
 
+#include <atomic>
 #include <functional>
 #include <memory>
 
-#include <atomic>
+#include "gromacs/mdlib/simulationsignal.h"
+#include "gromacs/mdlib/stophandler.h"
+#include "gromacs/mdrun/runner.h"
+
+// Public gmxapi headers.
 #include "gmxapi/session.h"
 #include "gmxapi/md/mdsignals.h"
 
+// Internal gmxapi headers.
 #include "api/cpp/session_impl.h"
-#include "gromacs/mdlib/simulationsignal.h"
-#include "gromacs/mdlib/stophandler.h"
-#include "gromacs/mdrun/runner.h"
 
 namespace gmxapi
 {
index 82e304a034fd4ef0d0148a4ca3756904877a78a2..9d07ac7cb2165bfe0b7dd621e2566f5a1b056fb8 100644 (file)
 
 #include <map>
 
+#include "gromacs/mdrun/runner.h"
+#include "gromacs/mdrun/simulationcontext.h"
+#include "gromacs/mdrunutility/logging.h"
+
+// Above are the public headers from other modules.
+// Following are public headers for the current module.
 #include "gmxapi/context.h"
 #include "gmxapi/md.h"
 #include "gmxapi/status.h"
 #include "gmxapi/md/mdmodule.h"
 #include "gmxapi/session/resources.h"
 
-#include "gromacs/mdrun/runner.h"
-#include "gromacs/mdrun/simulationcontext.h"
-#include "gromacs/mdrunutility/logging.h"
 
 namespace gmxapi
 {
index 945c791c2783511ff19c6f1f571b1940d6708be0..0571395ec263cd050cf113cb4ec0d52421bb7546 100644 (file)
  * \ingroup gmxapi
  */
 
+#include <forward_list>
 #include <map>
 #include <memory>
 #include <string>
 
-#include <forward_list>
-
 namespace gmxapi
 {
 
index c4d3f925cd60ff59814ca425742dfff635814b25..1fff2ed2ebcfd9c64ae9a02207b645278c2dbd35 100644 (file)
 
 #include <memory>
 
-#include "api/cpp/workflow.h"
-#include "api/cpp/workflow_impl.h"
-#include "api/cpp/include/gmxapi/context.h"
-#include "api/cpp/include/gmxapi/status.h"
-#include "api/cpp/include/gmxapi/system.h"
-#include "gromacs/utility/arrayref.h"
-
-#include "api/cpp/tests/testingconfiguration.h"
+#include "workflow.h"
+#include "workflow_impl.h"
+#include "tests/testingconfiguration.h"
 
 namespace gmxapi
 {
index c614947dd28f3fd39644d35fae39dbc91e431015..fe13604acf5f6abf486010a509bb948e4ec64486 100644 (file)
@@ -48,6 +48,7 @@
 
 #include "gmxapi/exceptions.h"
 
+// Local module internal headers.
 #include "api/cpp/workflow.h"
 
 namespace gmxapi
index 01570eabe10acea9bfa11bd65549f25e3b76f204..f278fd94770c28be42984f7b4e7d5d450852ee07 100644 (file)
@@ -44,7 +44,6 @@
 #include "densityfittingforceprovider.h"
 
 #include <numeric>
-
 #include <optional>
 
 #include "gromacs/gmxlib/network.h"
index 5e4bbae107cd1a372bb34d2e299c4331cccbbaea..d5e654abb076690e643f582ae1fd2afe299735e3 100644 (file)
@@ -46,9 +46,8 @@
 #define GMX_COMMANDLINE_FILENM_H
 
 #include <string>
-#include <vector>
-
 #include <string_view>
+#include <vector>
 
 #include "gromacs/fileio/filetypes.h"
 #include "gromacs/utility/arrayref.h"
index 95efb82d8a812d01094e8fe9641cca9d033f0acc..c359c7a450851cbabcafe7686df08df1b98075ce 100644 (file)
@@ -49,8 +49,8 @@
 
 #include <algorithm>
 #include <memory>
-
 #include <unordered_set>
+
 #include <sys/types.h>
 
 #include "gromacs/utility/arrayref.h"
index 8237ed1ea08dd7926f0aa478ddc43132dfd7656e..316656d7a63ea08b7e2c5c6718bdc327247f8e5b 100644 (file)
@@ -49,8 +49,8 @@
 
 #include <algorithm>
 #include <memory>
-
 #include <unordered_set>
+
 #include <sys/types.h>
 
 #include "gromacs/fileio/gmxfio.h"
index b55a59379e4e8867a1fd30bc1d07c363e69ad896..1d68325a54f0c12847f4d97554ee54f79a5183cb 100644 (file)
@@ -46,7 +46,6 @@
 #include <cmath>
 
 #include <algorithm>
-
 #include <cfenv>
 
 //! Floating point exception set that we use and care about
index 68836614a66e1d7ae0f8a04538c75ab3da0d1a0e..ac2340ce17ebef9a3764f1d50ece9a97cde7ae4f 100644 (file)
@@ -50,7 +50,6 @@
 #include <ctime>
 
 #include <algorithm>
-
 #include <cfenv>
 
 #include "gromacs/commandline/filenm.h"
index 68c2328e51c220d4fe29f5f275d59135e509e66c..220a92f36530f175949006464053d55bdf7690e1 100644 (file)
@@ -65,9 +65,8 @@
 #include <algorithm>
 #include <exception>
 #include <functional>
-#include <tuple>
-
 #include <optional>
+#include <tuple>
 
 #include "gromacs/commandline/filenm.h"
 #include "gromacs/fileio/checkpoint.h"
index 1f76d7ccb5c17971b2c57c7fe3d142af8ca5a47e..73aad6d57f7f7dd9bf4b0b4f27c2620eef0af61c 100644 (file)
@@ -42,9 +42,8 @@
 
 #include <algorithm>
 #include <iterator>
-#include <string>
-
 #include <optional>
+#include <string>
 
 #include "gromacs/utility/arrayref.h"
 #include "gromacs/utility/cstringutil.h"
index 9b466fe80708e6900becd4af966fb5e23ee7931a..104101d4b777ea66dbcf7d87b27b21eff1ec7d8f 100644 (file)
@@ -35,9 +35,8 @@
 #ifndef GMX_TOPOLOGY_RESIDUETYPES_H
 #define GMX_TOPOLOGY_RESIDUETYPES_H
 
-#include <string>
-
 #include <optional>
+#include <string>
 
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/classhelpers.h"
index f9f7ce730137c9b49335acb60c4367aae59eb4c5..1b0f4645af6ec9f72660429a5aba23909fbbcf51 100644 (file)
@@ -55,9 +55,9 @@
 
 #include <algorithm>
 #include <string>
+#include <string_view>
 #include <utility>
 
-#include <string_view>
 #include <sys/stat.h>
 
 #if GMX_NATIVE_WINDOWS
index df54725a027de9c306ebdc093ce276c654df90f8..354ae7ea80bbc55054eb7aea63608502d0f6d801 100644 (file)
 #define GMX_UTILITY_PATH_H
 
 #include <string>
+#include <string_view>
 #include <utility>
 #include <vector>
 
-#include <string_view>
-
 namespace gmx
 {
 
index 8b1725c5c7a1cc7dc0334b3a18634f971ea757df..dba7019add389c842503a52a21e436d18e9eecc6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2017,2018,2019,2020, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -55,6 +55,7 @@
 #include "config.h"
 
 #include <future>
+
 #include <gtest/gtest.h>