Skip to content

Commit

Permalink
Fix clang-format-diff usage
Browse files Browse the repository at this point in the history
"--style" is invalid:

$ ./checkpatch.sh -r HEAD
usage: clang-format-diff [-h] [-i] [-p NUM] [-regex PATTERN] [-iregex PATTERN]
                         [-sort-includes] [-v] [-style STYLE] [-binary BINARY]
clang-format-diff: error: unrecognized arguments: --style={ Language:... }
  • Loading branch information
wataash committed May 27, 2020
1 parent 7426a56 commit 866fbb5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions checkpatch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ function clang_style()
local c="${options[cfg]}"
echo "{ $(sed -e 's/#.*//' -e '/---/d' -e '/\.\.\./d' "$c" | tr $'\n' ,) }"
}
function clang_format() { clang-format --style="$(clang_style)" "$@"; }
function clang_format_diff() { clang-format-diff --style="$(clang_style)" "$@"; }
function clang_format() { clang-format -style="$(clang_style)" "$@"; }
function clang_format_diff() { clang-format-diff -style="$(clang_style)" "$@"; }
# for non-bare repo will work
function clang_format_git()
{ git format-patch --stdout "$@" -1 | clang_format_diff; }
Expand Down

0 comments on commit 866fbb5

Please sign in to comment.