Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions ament_uncrustify/ament_uncrustify/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ def main(argv: list[str] = sys.argv[1:]) -> Literal[0, 1]:
return 1

# Version 0.78.1 is different enough that we have a specific
# configuration file for it. Anything before that uses the 0.72 one.
# configuration file for it. Anything newer than or equal to that
# uses the 0.78 one. Anything before that uses the 0.72 one.
# The strings that uncrustify can print vary depending on how it was
# built; common variations are "Uncrustify_d-0.78.1"
# and "Uncrustify-0.72.0_f".
Expand All @@ -59,7 +60,9 @@ def main(argv: list[str] = sys.argv[1:]) -> Literal[0, 1]:
return 1

version = version_match.group(1)
if version == b'0.78.1':
# Note: we use byte comparison here. This works as long as the
# major and minor versions are the same number of digits.
if version >= b'0.78.1':
default_config_file = 'ament_code_style_0_78.cfg'
else:
default_config_file = 'ament_code_style_0_72.cfg'
Expand Down