From 94bf67aaca97c004a3d7a120f5003ea9b6083fa5 Mon Sep 17 00:00:00 2001 From: Jan Strohbeck Date: Fri, 29 Mar 2019 14:46:25 +0100 Subject: [PATCH] [UPDATE] Remove default clang tidy configuration. --- CMakeLists.txt | 3 +-- git-cmake-format.py | 6 ++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c3a4e46..66d194a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,8 +37,7 @@ function(create_git_hook) # clang-format style GCF_CHECK_OPTION_OR_DEFAULT("CLANG_FORMAT_STYLE" "file") # Checks executed by clang-tidy - GCF_CHECK_OPTION_OR_DEFAULT("CLANG_TIDY_CHECKS" - "readability-*,bugprone-*,modernize-*,google-*") + GCF_CHECK_OPTION_OR_DEFAULT("CLANG_TIDY_CHECKS" "") # Comma-separated list of tools to run GCF_CHECK_OPTION_OR_DEFAULT("MODES" "format,lint") # Abort commit if files would be formatted diff --git a/git-cmake-format.py b/git-cmake-format.py index 98884f2..25bbe9e 100644 --- a/git-cmake-format.py +++ b/git-cmake-format.py @@ -57,7 +57,9 @@ def callLinter(linter_name, project, files): sys.exit(1) linter_args = [project[linter_name]] if linter_name == 'clang-tidy': - linter_args.extend(['-checks=' + project["clang_tidy_checks"], '-p', project["builddir"]]) + if project["clang_tidy_checks"]is not None: + linter_args.extend(['-checks=' + project["clang_tidy_checks"]]) + linter_args.extend(['-p', project["builddir"]]) if args.fix: linter_args.extend(['--fix', '-format-style', project["clang_format_style"]]) linter_args.extend(files) @@ -110,7 +112,7 @@ def is_subdir(path, directory): path = normpath(normcase(path)) directory = normpath(normcase(directory)) if len(path) > len(directory): - sep = os.path.sep.encode('ascii') if isinstance(directory, bytes) else sep + sep = os.path.sep.encode('ascii') if isinstance(directory, bytes) else os.path.sep if path.startswith(directory.rstrip(sep) + sep): return True return False