45 lines · plain
1.. title:: clang-tidy - readability-duplicate-include2 3readability-duplicate-include4=============================5 6Looks for duplicate includes and removes them. The check maintains a list of7included files and looks for duplicates. If a macro is defined or undefined8then the list of included files is cleared.9 10Examples:11 12.. code-block:: c++13 14 #include <memory>15 #include <vector>16 #include <memory>17 18becomes19 20.. code-block:: c++21 22 #include <memory>23 #include <vector>24 25Because of the intervening macro definitions, this code remains unchanged:26 27.. code-block:: c++28 29 #undef NDEBUG30 #include "assertion.h"31 // ...code with assertions enabled32 33 #define NDEBUG34 #include "assertion.h"35 // ...code with assertions disabled36 37Options38-------39 40.. option:: IgnoredFilesList41 42 A semicolon-separated list of regular expressions or filenames that are43 allowed to be included multiple times without diagnostics. Matching is44 performed against the textual include name. Default is an empty string.45