Skip to content

Commit

Permalink
Consider files with '.hh' extension as C++ headers (#374)
Browse files Browse the repository at this point in the history
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 <jacob@openrobotics.org>
  • Loading branch information
jacobperron committed May 9, 2022
1 parent 88f424d commit f01bc41
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ament_cpplint/ament_cpplint/cpplint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit f01bc41

Please sign in to comment.