Beautify shellfmt and add board configs to formatting list (#6910)

* tools: shellfmt: Beautify and add board configs to formatting list
* Format the whole code using `lib/tools/shellfmt.sh`
---------
Co-authored-by: Igor <igor@armbian.com>
This commit is contained in:
ColorfulRhino
2024-07-08 15:00:38 +00:00
committed by GitHub
parent 9e5b8592c9
commit 39fdf21b98
47 changed files with 135 additions and 145 deletions

View File

@@ -61,17 +61,23 @@ cd "${SRC}"
# Should match the .editorconfig
declare -a ALL_BASH_FILES=($(find config/sources -type f | grep -e "\.conf\$" -e "\.inc\$") $(find lib -type f | grep -e "\.sh\$" | grep -v -e "^lib\/tools\/") $(find extensions -type f | grep -e "\.sh\$") compile.sh)
# Aggregate all files that should be formatted
board_config_files=$(find config/boards -type f \( -name "*.conf" -o -name "*.csc" -o -name "*.tvb" \)) # All board config files
family_config_files=$(find config/sources -type f \( -name "*.conf" -o -name "*.inc" -o -name "*.sh" \)) # All family config files
lib_files=$(find lib -type f -name "*.sh") # All build framework shell files
extensions_files=$(find extensions -type f -name "*.sh") # All extension shell files
echo "All files:" "${ALL_BASH_FILES[@]}"
declare -a ALL_BASH_FILES=(compile.sh ${board_config_files} ${family_config_files} ${lib_files} ${extensions_files})
echo "Shellfmt files differing:"
echo -e "\nAll files:" "${ALL_BASH_FILES[@]}"
echo -e "\nShellfmt files differing:"
"${SHELLFMT_BIN}" -l "${ALL_BASH_FILES[@]}" | sort -h # list all formatted files
#echo "Diff with current:"
# "${SHELLFMT_BIN}" -d "${ALL_BASH_FILES[@]}" # list files that have different formatting than they should
echo "Doing for real:"
echo -e "\nFormatting files..."
"${SHELLFMT_BIN}" -w "${ALL_BASH_FILES[@]}"
echo "Shellfmt finished!"