Sort includes in C++ files
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 29 Nov 2023 15:48:40 +0000 (10:48 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Fri, 1 Dec 2023 00:07:34 +0000 (19:07 -0500)
commitc802cacb9f0879a42e01575595a75bbefe7d3db9
tree70092a457f3b2d217b0a3f80fe0211b7d8b84fb3
parent145eca9d9f8caf8c3c084ec82b43dc1ee52870d2
Sort includes in C++ files

Set the `SortIncludes` option of clang-format to `Regroup`, meaning that
it will group include statements based on the categories in
`IncludeCategories`.

In `IncludeCategories`, define categories such that the groups are (in
order of priority):

  1. C++ system headers
  2. C system headers
  3. Babeltrace 2 public headers
  4. Logging headers (logging/log.h, as well as other header files
     including it): it might be important for these files to stay at the
     top, in case there is some logging in header files, so that things
     like log tags are properly set.
  5  Internal common headers (e.g. from common, cpp-common, compat,
     logging)
  6. Plugin common files (from plugins/common)
  7. Local headers
  8. tap/tap.h: it defines macros with common names, such as `ok` and
     `fail`, which may clash with identifiers in other headers.  It's
     safer to keep it last.

Includes in files parser.ypp and lexer.lpp were sorted by hand.  Due to
the change in inclusion order, parser.hpp (generated from parser.ypp)
did not see the definition of yyscan_t anymore.  Add an inclusion of
scanner.hpp in the `%code requires` section, which ends up in both the
generated .cpp and .hpp files.

Change-Id: I0568167065b90070ac03ea4daf4d0a1927bec4b5
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/11459
Tested-by: jenkins <jenkins@lttng.org>
91 files changed:
.clang-format
src/cpp-common/bt2/clock-class.hpp
src/cpp-common/bt2/clock-snapshot.hpp
src/cpp-common/bt2/exc.hpp
src/cpp-common/bt2/field-class.hpp
src/cpp-common/bt2/field-path.hpp
src/cpp-common/bt2/field.hpp
src/cpp-common/bt2/integer-range-set.hpp
src/cpp-common/bt2/integer-range.hpp
src/cpp-common/bt2/message.hpp
src/cpp-common/bt2/trace-ir.hpp
src/cpp-common/bt2/value.hpp
src/cpp-common/cfg-error-reporting-throw.hpp
src/cpp-common/cfg-error-reporting.hpp
src/cpp-common/cfg-logging-error-reporting-throw.hpp
src/cpp-common/cfg-logging-error-reporting.hpp
src/cpp-common/cfg-logging.hpp
src/cpp-common/exc.hpp
src/cpp-common/glib-up.hpp
src/cpp-common/log-cfg.hpp
src/cpp-common/make-unique.hpp
src/cpp-common/uuid-view.cpp
src/cpp-common/uuid-view.hpp
src/cpp-common/uuid.hpp
src/cpp-common/vector.hpp
src/plugins/ctf/common/bfcr/bfcr.cpp
src/plugins/ctf/common/bfcr/bfcr.hpp
src/plugins/ctf/common/metadata/ast.hpp
src/plugins/ctf/common/metadata/ctf-meta-resolve.cpp
src/plugins/ctf/common/metadata/ctf-meta-translate.cpp
src/plugins/ctf/common/metadata/ctf-meta-update-alignments.cpp
src/plugins/ctf/common/metadata/ctf-meta-update-default-clock-classes.cpp
src/plugins/ctf/common/metadata/ctf-meta-update-in-ir.cpp
src/plugins/ctf/common/metadata/ctf-meta-update-meanings.cpp
src/plugins/ctf/common/metadata/ctf-meta-update-stream-class-config.cpp
src/plugins/ctf/common/metadata/ctf-meta-update-text-array-sequence.cpp
src/plugins/ctf/common/metadata/ctf-meta-update-value-storing-indexes.cpp
src/plugins/ctf/common/metadata/ctf-meta-validate.cpp
src/plugins/ctf/common/metadata/ctf-meta-visitors.hpp
src/plugins/ctf/common/metadata/ctf-meta-warn-meaningless-header-fields.cpp
src/plugins/ctf/common/metadata/ctf-meta.hpp
src/plugins/ctf/common/metadata/decoder-packetized-file-stream-to-buf.cpp
src/plugins/ctf/common/metadata/decoder.cpp
src/plugins/ctf/common/metadata/decoder.hpp
src/plugins/ctf/common/metadata/lexer.lpp
src/plugins/ctf/common/metadata/logging.hpp
src/plugins/ctf/common/metadata/objstack.cpp
src/plugins/ctf/common/metadata/parser.ypp
src/plugins/ctf/common/metadata/scanner.hpp
src/plugins/ctf/common/metadata/visitor-generate-ir.cpp
src/plugins/ctf/common/metadata/visitor-parent-links.cpp
src/plugins/ctf/common/metadata/visitor-semantic-validator.cpp
src/plugins/ctf/common/msg-iter/msg-iter.cpp
src/plugins/ctf/common/msg-iter/msg-iter.hpp
src/plugins/ctf/common/print.hpp
src/plugins/ctf/fs-sink/fs-sink-ctf-meta.hpp
src/plugins/ctf/fs-sink/fs-sink-stream.cpp
src/plugins/ctf/fs-sink/fs-sink-stream.hpp
src/plugins/ctf/fs-sink/fs-sink-trace.cpp
src/plugins/ctf/fs-sink/fs-sink-trace.hpp
src/plugins/ctf/fs-sink/fs-sink.cpp
src/plugins/ctf/fs-sink/fs-sink.hpp
src/plugins/ctf/fs-sink/translate-ctf-ir-to-tsdl.cpp
src/plugins/ctf/fs-sink/translate-ctf-ir-to-tsdl.hpp
src/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.cpp
src/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.hpp
src/plugins/ctf/fs-src/data-stream-file.cpp
src/plugins/ctf/fs-src/data-stream-file.hpp
src/plugins/ctf/fs-src/file.cpp
src/plugins/ctf/fs-src/file.hpp
src/plugins/ctf/fs-src/fs.cpp
src/plugins/ctf/fs-src/fs.hpp
src/plugins/ctf/fs-src/lttng-index.hpp
src/plugins/ctf/fs-src/metadata.cpp
src/plugins/ctf/fs-src/metadata.hpp
src/plugins/ctf/fs-src/query.cpp
src/plugins/ctf/fs-src/query.hpp
src/plugins/ctf/lttng-live/data-stream.cpp
src/plugins/ctf/lttng-live/data-stream.hpp
src/plugins/ctf/lttng-live/lttng-live.cpp
src/plugins/ctf/lttng-live/lttng-live.hpp
src/plugins/ctf/lttng-live/lttng-viewer-abi.hpp
src/plugins/ctf/lttng-live/metadata.cpp
src/plugins/ctf/lttng-live/viewer-connection.cpp
src/plugins/ctf/lttng-live/viewer-connection.hpp
src/plugins/ctf/plugin.cpp
tests/lib/conds/conds-triggers.cpp
tests/lib/conds/utils.cpp
tests/lib/test-fields-bin.cpp
tests/lib/utils/run-in.cpp
tests/lib/utils/run-in.hpp
This page took 0.032988 seconds and 4 git commands to generate.