From 148978657cb279d14e42291adf266e2cd739ce77 Mon Sep 17 00:00:00 2001 From: Jacob Perron Date: Thu, 5 May 2022 15:35:01 -0700 Subject: [PATCH] Consider files with '.hh' extension as C++ headers (#374) 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: