File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed
Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
33# ##############################################################################
4- # entrypoint .sh #
4+ # check .sh #
55# ##############################################################################
66# USAGE: ./entrypoint.sh [<path>] [<fallback style>]
77#
@@ -21,9 +21,23 @@ format_diff() {
2121 local filepath=" $1 "
2222 # Invoke clang-format with dry run and formatting error output
2323 if [[ $CLANG_FORMAT_MAJOR_VERSION -gt " 9" ]]; then
24- local_format=" $( docker run -i -v " $( pwd) " :" $( pwd) " -w " $( pwd) " --rm ghcr.io/jidicula/clang-format:" $CLANG_FORMAT_MAJOR_VERSION " -n --Werror --style=file --fallback-style=" $FALLBACK_STYLE " " ${filepath} " ) "
24+ local_format=" $( docker run \
25+ --volume " $( pwd) " :" $( pwd) " \
26+ --workdir " $( pwd) " \
27+ ghcr.io/jidicula/clang-format:" $CLANG_FORMAT_MAJOR_VERSION " \
28+ --dry-run \
29+ --Werror \
30+ --style=file \
31+ --fallback-style=" $FALLBACK_STYLE " \
32+ " ${filepath} " ) "
2533 else # Versions below 9 don't have dry run
26- formatted=" $( docker run -i -v " $( pwd) " :" $( pwd) " -w " $( pwd) " --rm ghcr.io/jidicula/clang-format:" $CLANG_FORMAT_MAJOR_VERSION " --style=file --fallback-style=" $FALLBACK_STYLE " " ${filepath} " ) "
34+ formatted=" $( docker run \
35+ --volume " $( pwd) " :" $( pwd) " \
36+ --workdir " $( pwd) " \
37+ ghcr.io/jidicula/clang-format:" $CLANG_FORMAT_MAJOR_VERSION " \
38+ --style=file \
39+ --fallback-style=" $FALLBACK_STYLE " \
40+ " ${filepath} " ) "
2741 local_format=" $( diff -q <( cat " ${filepath} " ) <( echo " ${formatted} " ) ) "
2842 fi
2943
You can’t perform that action at this time.
0 commit comments