From ebc4febd2c3be1adf52d89e0bb61552e9411ef87 Mon Sep 17 00:00:00 2001 From: Zach Bjornson Date: Tue, 22 Mar 2022 10:33:03 -0700 Subject: [PATCH] Use unanchored clang-format version check (#573) `clang-format -version` installed with apt on Ubuntu reports `Ubuntu clang-format version 11.0.0-2~ubuntu20.04.1`, so we need an unanchored search here. (Equivalent to https://github.com/rapidsai/cuml/commit/dafcd6f30da3101ab7a4d2852dcf11d8aa0d8125.) Authors: - Zach Bjornson (https://github.com/zbjornson) Approvers: - Corey J. Nolet (https://github.com/cjnolet) URL: https://github.com/rapidsai/raft/pull/573 --- cpp/scripts/run-clang-format.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/scripts/run-clang-format.py b/cpp/scripts/run-clang-format.py index 56fc9a5928..2545907688 100755 --- a/cpp/scripts/run-clang-format.py +++ b/cpp/scripts/run-clang-format.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020, NVIDIA CORPORATION. +# Copyright (c) 2020-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -64,7 +64,7 @@ def parse_args(): args.dstdir = tempfile.mkdtemp() ret = subprocess.check_output("%s --version" % args.exe, shell=True) ret = ret.decode("utf-8") - version = VERSION_REGEX.match(ret) + version = VERSION_REGEX.search(ret) if version is None: raise Exception("Failed to figure out clang-format version!") version = version.group(1)