You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kvrocks.apache.org by ti...@apache.org on 2022/10/15 01:16:30 UTC

[incubator-kvrocks] branch unstable updated: Use warning instead of error for clang-format version mismatch in x.py (#994)

This is an automated email from the ASF dual-hosted git repository.

tison pushed a commit to branch unstable
in repository https://gitbox.apache.org/repos/asf/incubator-kvrocks.git


The following commit(s) were added to refs/heads/unstable by this push:
     new 21b92a9  Use warning instead of error for clang-format version mismatch in x.py (#994)
21b92a9 is described below

commit 21b92a9f11cdd479498e592e500c29d137d8eec1
Author: Twice <tw...@gmail.com>
AuthorDate: Sat Oct 15 09:16:24 2022 +0800

    Use warning instead of error for clang-format version mismatch in x.py (#994)
---
 x.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/x.py b/x.py
index 59558b4..de21477 100755
--- a/x.py
+++ b/x.py
@@ -20,13 +20,13 @@
 from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter, REMAINDER
 from glob import glob
 from os import makedirs
-import os
 from pathlib import Path
 import re
 from subprocess import Popen, PIPE
 import sys
 from typing import List, Any, Optional, TextIO, Tuple
 from shutil import copyfile
+from warnings import warn
 
 CMAKE_REQUIRE_VERSION = (3, 16, 0)
 CLANG_FORMAT_REQUIRED_VERSION = (12, 0, 0)
@@ -138,10 +138,10 @@ def clang_format(clang_format_path: str, fix: bool = False) -> None:
     version = check_version(version_str, CLANG_FORMAT_REQUIRED_VERSION, "clang-format")
 
     if version[0] > 12:
-        raise RuntimeError("We use clang-format 12 in CI, "
-            "so we recommend that you also use this version locally to avoid inconsistencies. "
-            "You can install it from your package manager (usually in clang-12 package) "
-            "or download it from https://github.com/llvm/llvm-project/releases/tag/llvmorg-12.0.1")
+        warn("We use clang-format 12 in CI, "
+             "so we recommend that you also use this version locally to avoid inconsistencies. "
+             "You can install it from your package manager (usually in clang-12 package) "
+             "or download it from https://github.com/llvm/llvm-project/releases/tag/llvmorg-12.0.1")
 
     basedir = Path(__file__).parent.absolute()
     sources = get_source_files()