Skip to content

Commit 84e91b2

Browse files
authored
Fix clang-10 formatting check (#105)
* format: fix clang-10 formatting check * apply reformatting suggestions
1 parent 8f955ef commit 84e91b2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tasks/format_code.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,12 @@ def format(ctx, check=False):
5151
.split("\n")[:-1]
5252
)
5353

54-
clang_cmd = "clang-format-10 -i {}".format(" ".join(files_to_check))
54+
clang_cmd = [
55+
"clang-format-10",
56+
"--dry-run --Werror" if check else "-i",
57+
" ".join(files_to_check),
58+
]
59+
clang_cmd = " ".join(clang_cmd)
5560
run(clang_cmd, shell=True, check=True, cwd=PROJ_ROOT)
5661

5762
# ---- Append newlines to C/C++ files if not there ----

0 commit comments

Comments
 (0)