From ecb99461c0b1bcb6571d7b8b0c5c7161bfa59e09 Mon Sep 17 00:00:00 2001 From: Jacob Perron Date: Tue, 3 May 2022 16:48:55 -0700 Subject: [PATCH] Consider files with '.hh' extension as C++ headers Without this change, these files are considered to be C system headers. This change affects the expected include order with respect to '.hh' files. Signed-off-by: Jacob Perron --- ament_cpplint/ament_cpplint/cpplint.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ament_cpplint/ament_cpplint/cpplint.py b/ament_cpplint/ament_cpplint/cpplint.py index 0628febf..567227ba 100644 --- a/ament_cpplint/ament_cpplint/cpplint.py +++ b/ament_cpplint/ament_cpplint/cpplint.py @@ -5017,7 +5017,8 @@ def _ClassifyInclude(fileinfo, include, used_angle_brackets, include_order="defa or Search(r'(?:%s)\/.*\.h' % "|".join(C_STANDARD_HEADER_FOLDERS), include)) # Headers with C++ extensions shouldn't be considered C system headers - is_system = used_angle_brackets and not os.path.splitext(include)[1] in ['.hpp', '.hxx', '.h++'] + include_ext = os.path.splitext(include)[1] + is_system = used_angle_brackets and not include_ext in ['.hh', '.hpp', '.hxx', '.h++'] if is_system: if is_cpp_header: