diff --git a/FindClangFormatCurrent.cmake b/FindClangFormatCurrent.cmake index 1db0795..37efbaa 100644 --- a/FindClangFormatCurrent.cmake +++ b/FindClangFormatCurrent.cmake @@ -32,6 +32,9 @@ find_program(CLANG_FORMAT_EXECUTABLE NAMES + clang-format-20 clang-format-19 + clang-format-18 clang-format-17 + clang-format-16 clang-format-15 clang-format-14 clang-format-13 clang-format-12 clang-format-11 clang-format-10 clang-format-9 diff --git a/FindClangTidyCurrent.cmake b/FindClangTidyCurrent.cmake index e602350..55a5a12 100644 --- a/FindClangTidyCurrent.cmake +++ b/FindClangTidyCurrent.cmake @@ -32,6 +32,9 @@ find_program(CLANG_TIDY_EXECUTABLE NAMES + clang-tidy-20 clang-tidy-19 + clang-tidy-18 clang-tidy-17 + clang-tidy-16 clang-tidy-15 clang-tidy-14 clang-tidy-13 clang-tidy-12 clang-tidy-11 clang-tidy-10 clang-tidy-9 diff --git a/FindClangdCurrent.cmake b/FindClangdCurrent.cmake index 5c4ae86..a5a5044 100644 --- a/FindClangdCurrent.cmake +++ b/FindClangdCurrent.cmake @@ -32,6 +32,9 @@ find_program(CLANGD_EXECUTABLE NAMES + clangd-20 clangd-19 + clangd-18 clangd-17 + clangd-16 clangd-15 clangd-14 clangd-13 clangd-12 clangd-11 clangd-10 clangd-9 diff --git a/clangd_client b/clangd_client index 29a426d..da61af9 100755 --- a/clangd_client +++ b/clangd_client @@ -235,7 +235,7 @@ def handle_files(clangd, root_dir, build_dir, files, j=8): pos_line = 0 pos_char = 0 def insert_until(end_line, end_char): - global pos_line, pos_char, res + nonlocal pos_line, pos_char, res while start.line > pos_line: print(pos_line, pos_char, len(contents)) @@ -252,7 +252,7 @@ def handle_files(clangd, root_dir, build_dir, files, j=8): res += edit.newText pos_line = end.line pos_char = end.character - insert_until(len(contents)-1, len(contens[-1])) + insert_until(len(contents)-1, len(contents[-1])) # with open(u2p(fn)), "w") as f: # f.write(res) diff --git a/git-cmake-format.py b/git-cmake-format.py index 2f01ce4..1ce007f 100644 --- a/git-cmake-format.py +++ b/git-cmake-format.py @@ -234,9 +234,8 @@ def requiresFormat(fileName, f_type, project): EditedFiles = list([os.path.join(GitRoot, f) for f in EditedFiles]) UnstagedFiles = list([os.path.join(GitRoot, f) for f in UnstagedFiles]) - common = set(EditedFiles) & set(UnstagedFiles) - if len(common) != 0: + if args.mode != 'all' and len(common) != 0: print(colored("Warning: The following files have only been added partially, they will be ignored because they cannot be formatted partially!", 'yellow')) for f in common: print(" ", colored(f[len(GitRoot)+1:], 'yellow'))