From b802f146e601a776dc053cd9d7d90b887a276ce8 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 27 Jun 2024 11:47:25 +0200 Subject: [PATCH] Tools: Move warning about wrong clang-format version to the bottom So it doesn't scroll off screen and is easy to miss. --- tools/utils_maintenance/clang_format_paths.py | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/tools/utils_maintenance/clang_format_paths.py b/tools/utils_maintenance/clang_format_paths.py index 1bc5863cd38..677ff8d1a36 100755 --- a/tools/utils_maintenance/clang_format_paths.py +++ b/tools/utils_maintenance/clang_format_paths.py @@ -230,17 +230,6 @@ def main() -> None: if version < VERSION_MIN: print("Version of clang-format is too old:", version, "<", VERSION_MIN) sys.exit(1) - if version > VERSION_MAX_RECOMMENDED: - print( - "WARNING: Version of clang-format is too recent:", - version, ">", VERSION_MAX_RECOMMENDED, - ) - print( - "You may want to install clang-format-{:d}.{:d}, " - "or use the precompiled libs repository.".format( - VERSION_MAX_RECOMMENDED[0], VERSION_MAX_RECOMMENDED[1], - ), - ) args = argparse_create().parse_args() @@ -268,6 +257,20 @@ def main() -> None: convert_tabs_to_spaces(files + files_retab) clang_format(files) + if version > VERSION_MAX_RECOMMENDED: + print() + print( + "WARNING: Version of clang-format is too recent:", + version, ">", VERSION_MAX_RECOMMENDED, + ) + print( + "You may want to install clang-format-{:d}.{:d}, " + "or use the precompiled libs repository.".format( + VERSION_MAX_RECOMMENDED[0], VERSION_MAX_RECOMMENDED[1], + ), + ) + print() + if __name__ == "__main__": main()