Due to a bug, js files were not formatting.
Tested manually - js formatting works.
Change-Id: I5a4e2f2dc05241e15c85815f8380563303fa7ed1
Signed-off-by: Rafal Walczyna <r.walczyna@samsung.com>
}
checkUpdatedFiles() {
- files="$(git diff-index -z --name-only --diff-filter=AM HEAD --)"
- while IFS= read -r -d '' f; do
- if [ "${f: -3}" == ".cc" ] || [ "${f: -4}" == ".cpp" ] || [ "${f: -2}" == ".h" ] || \
- [ "${f: -4}" == ".hpp" ]; then
- printf '.'
- clang-format -i -style="$config" "$f";
- fi
- done <<< "$files"
+ while IFS= read -r -d '' f; do
+ if [ "${f: -3}" == ".cc" ] || [ "${f: -4}" == ".cpp" ] || [ "${f: -2}" == ".h" ] || \
+ [ "${f: -4}" == ".hpp" ]; then
+ printf '.'
+ clang-format -i -style="$config" "$f";
+ fi
+ done < <(git diff-index -z --name-only --diff-filter=AM HEAD --)
}
printf "C/C++ reformatting: ";
backupUpdatedFiles() {
files_to_update="$(git diff-index -z --name-only --diff-filter=AM HEAD --)";
if [[ "$files_to_update" == "" ]]; then
- echo "There are no updated files to dormat";
+ echo "There are no updated files to format";
exit;
fi
time_stamp=$(date +%Y-%m-%d-%T);
}
formatJSPath() {
- js_files="$(find -- "$1" -type f -name "*.js" -print0)"
while IFS= read -r -d '' f; do
formatJSFile "$f";
- done <<< "$js_files"
+ done < <(find -- "$1" -type f -name "*.js" -print0)
}
checkUpdatedFiles() {
- files="$(git diff-index -z --name-only --diff-filter=AM HEAD --)"
while IFS= read -r -d '' f; do
if [[ "${f: -3}" == ".js" ]]; then
formatJSFile "$f";
fi
- done <<< "$files"
+ done < <(git diff-index -z --name-only --diff-filter=AM HEAD --)
}
printf "JS reformatting: ";