mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
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:
@@ -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!"
|
||||
|
||||
Reference in New Issue
Block a user