Skip to content

Commit

Permalink
[UPDATE] small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
janstrohbeck committed May 31, 2023
1 parent 4a50883 commit 6b2bfc9
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
3 changes: 3 additions & 0 deletions FindClangFormatCurrent.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions FindClangTidyCurrent.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions FindClangdCurrent.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions clangd_client
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions git-cmake-format.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down

0 comments on commit 6b2bfc9

Please sign in to comment.