mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-15 15:02:16 -07:00
update format.sh
add shellcheck to format.sh add statement macros to .clang-format add no clang format to format.sh add changed file list to format.sh diff rename --cf-version to --print-version in format.sh lint files
This commit is contained in:
parent
b8983f27ab
commit
209d66fe82
13 changed files with 130 additions and 27 deletions
|
|
@ -13,9 +13,17 @@ fi
|
|||
# Check formatting using format.sh
|
||||
echo "Checking your code using clang-format/cmake-format..."
|
||||
|
||||
diff="$(./format.sh --diff --cmake --cf-version --branch origin/master)"
|
||||
diff="$(./format.sh --diff --cmake --print-version --branch origin/master)"
|
||||
err=$?
|
||||
|
||||
sep="
|
||||
----------
|
||||
"
|
||||
used_version="${diff%%"$sep"*}"
|
||||
diff="${diff#*"$sep"}"
|
||||
changes_to_make="${diff%%"$sep"*}"
|
||||
files_to_edit="${diff#*"$sep"}"
|
||||
|
||||
case $err in
|
||||
1)
|
||||
cat <<EOM
|
||||
|
|
@ -33,14 +41,13 @@ case $err in
|
|||
***********************************************************
|
||||
|
||||
Used version:
|
||||
${diff%%
|
||||
----------
|
||||
*}
|
||||
$used_version
|
||||
|
||||
Affected files:
|
||||
$files_to_edit
|
||||
|
||||
The following changes should be made:
|
||||
${diff#*
|
||||
----------
|
||||
}
|
||||
$changes_to_make
|
||||
|
||||
Exiting...
|
||||
EOM
|
||||
|
|
@ -58,6 +65,9 @@ EOM
|
|||
*** ***
|
||||
***********************************************************
|
||||
|
||||
Used version:
|
||||
$used_version
|
||||
|
||||
Exiting...
|
||||
EOM
|
||||
exit 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue