4 # Imported from TAOS-CI
5 # Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved.
6 # Modified for Github-Action in 2024.
8 # Argument 1 ($1): the file containing the list of files to be checked
12 # @brief Check the code formatting style with GNU indent. Orignally pr-prebuild-indent.sh
13 # @see https://www.gnu.org/software/indent
14 # @see https://github.com/nnstreamer/TAOS-CI
15 # @see https://github.com/nnstreamer/nnstreamer
16 # @author Geunsik Lim <geunsik.lim@samsung.com>
17 # @author MyungJoo Ham <myungjoo.ham@samsung.com>
21 echo "::error The argument (file path) is not given."
28 if [ ! -f $files ]; then
29 echo "::error The file $files does not exists."
34 if [[ $? -ne 0 ]]; then
35 echo "::error The indent utility is not found."
39 echo "::group::Indent check started"
41 for file in `cat $files`; do
42 if [[ `file $file | grep "ASCII text" | wc -l` -gt 0 ]]; then
47 --case-brace-indentation0 \
49 --braces-after-struct-decl-line \
53 --dont-line-up-parentheses \
54 --continuation-indentation4 \
66 PATCHFILESIZE=$(stat -c%s ${tmpfile})
67 if [[ $PATCHFILESIZE -ne 0 ]]; then
73 if [ $failed = 1 ]; then
74 echo "::error There is an indentation style error."
75 echo "::group::The indentation style errors are..."