chore(style): normalize indentation and line continuations in shell scripts

Apply consistent 4-space indentation and trailing-operator style for line
continuations (&&, |) across all development and release scripts. No logic
changes.

Release-Notes: skip
This commit is contained in:
Julian Pawlowski 2026-04-12 14:15:17 +00:00
parent a93ad1ac96
commit e163a47d57
9 changed files with 110 additions and 112 deletions

View file

@ -51,15 +51,15 @@ if grep -q '^\[alias\]' ~/.gitconfig.host; then
# First, collect all aliases from host config # First, collect all aliases from host config
TEMP_ALIASES=$(mktemp) TEMP_ALIASES=$(mktemp)
sed -n '/^\[alias\]/,/^\[/p' ~/.gitconfig.host | \ sed -n '/^\[alias\]/,/^\[/p' ~/.gitconfig.host |
grep -v '^\[' | \ grep -v '^\[' |
grep -v '^$' | \ grep -v '^$' |
while IFS= read -r line; do while IFS= read -r line; do
# Skip aliases with macOS-specific paths # Skip aliases with macOS-specific paths
if echo "$line" | grep -q -E '/(Applications|usr/local)'; then if echo "$line" | grep -q -E '/(Applications|usr/local)'; then
continue continue
fi fi
echo "$line" >> "$TEMP_ALIASES" echo "$line" >>"$TEMP_ALIASES"
done done
# Apply each alias (git config --global overwrites existing values = idempotent) # Apply each alias (git config --global overwrites existing values = idempotent)
@ -68,8 +68,8 @@ if grep -q '^\[alias\]' ~/.gitconfig.host; then
ALIAS_NAME=$(echo "$line" | awk '{print $1}') ALIAS_NAME=$(echo "$line" | awk '{print $1}')
ALIAS_VALUE=$(echo "$line" | sed "s/^$ALIAS_NAME = //") ALIAS_VALUE=$(echo "$line" | sed "s/^$ALIAS_NAME = //")
git config --global "alias.$ALIAS_NAME" "$ALIAS_VALUE" 2>/dev/null || true git config --global "alias.$ALIAS_NAME" "$ALIAS_VALUE" 2>/dev/null || true
done < "$TEMP_ALIASES" done <"$TEMP_ALIASES"
echo " Synced $(wc -l < "$TEMP_ALIASES") aliases" echo " Synced $(wc -l <"$TEMP_ALIASES") aliases"
fi fi
rm -f "$TEMP_ALIASES" rm -f "$TEMP_ALIASES"

View file

@ -168,8 +168,8 @@ build_diff_context() {
if ! diff_context=$( if ! diff_context=$(
set -o pipefail set -o pipefail
git diff --unified=0 --no-color --minimal --patience --diff-filter=AM \ git diff --unified=0 --no-color --minimal --patience --diff-filter=AM \
"${FROM_TAG}..${TO_TAG}" -- "${USER_FACING_PATHS[@]}" 2>/dev/null \ "${FROM_TAG}..${TO_TAG}" -- "${USER_FACING_PATHS[@]}" 2>/dev/null |
| awk ' awk '
/^diff --git / { print; next } /^diff --git / { print; next }
/^--- / || /^\+\+\+ / || /^@@ / { print; next } /^--- / || /^\+\+\+ / || /^@@ / { print; next }
/^[+-]/ { /^[+-]/ {
@ -177,18 +177,18 @@ build_diff_context() {
print print
next next
} }
' \ ' |
| head -c "$RELEASE_NOTES_DIFF_MAX_BYTES" head -c "$RELEASE_NOTES_DIFF_MAX_BYTES"
); then ); then
log_info "${YELLOW}Warning: compact diff generation failed, falling back to legacy diff context${NC}" log_info "${YELLOW}Warning: compact diff generation failed, falling back to legacy diff context${NC}"
diff_context=$(git diff --unified=2 --diff-filter=AM \ diff_context=$(git diff --unified=2 --diff-filter=AM \
"${FROM_TAG}..${TO_TAG}" -- "${USER_FACING_PATHS[@]}" 2>/dev/null \ "${FROM_TAG}..${TO_TAG}" -- "${USER_FACING_PATHS[@]}" 2>/dev/null |
| head -c "$RELEASE_NOTES_DIFF_MAX_BYTES" || true) head -c "$RELEASE_NOTES_DIFF_MAX_BYTES" || true)
fi fi
else else
diff_context=$(git diff --unified=2 --diff-filter=AM \ diff_context=$(git diff --unified=2 --diff-filter=AM \
"${FROM_TAG}..${TO_TAG}" -- "${USER_FACING_PATHS[@]}" 2>/dev/null \ "${FROM_TAG}..${TO_TAG}" -- "${USER_FACING_PATHS[@]}" 2>/dev/null |
| head -c "$RELEASE_NOTES_DIFF_MAX_BYTES" || true) head -c "$RELEASE_NOTES_DIFF_MAX_BYTES" || true)
fi fi
echo "$diff_context" echo "$diff_context"
@ -264,8 +264,8 @@ generate_with_copilot() {
FINAL_FILE_CHANGES=$(git diff --name-status "${FROM_TAG}..${TO_TAG}" 2>/dev/null || true) FINAL_FILE_CHANGES=$(git diff --name-status "${FROM_TAG}..${TO_TAG}" 2>/dev/null || true)
# Revert commits are useful chronology hints (earlier changes may be superseded). # Revert commits are useful chronology hints (earlier changes may be superseded).
REVERT_COMMITS=$(git log --reverse --pretty=format:"%h | %s" "${FROM_TAG}..${TO_TAG}" \ REVERT_COMMITS=$(git log --reverse --pretty=format:"%h | %s" "${FROM_TAG}..${TO_TAG}" |
| grep -Ei '\|[[:space:]]*revert\b' || true) grep -Ei '\|[[:space:]]*revert\b' || true)
if [[ -z $FINAL_FILE_CHANGES ]]; then if [[ -z $FINAL_FILE_CHANGES ]]; then
FINAL_FILE_CHANGES="(none)" FINAL_FILE_CHANGES="(none)"
@ -442,7 +442,7 @@ End after the Buy Me A Coffee button. No meta-commentary, no explanations."
# Save prompt to temp file for copilot # Save prompt to temp file for copilot
TEMP_PROMPT=$(mktemp) TEMP_PROMPT=$(mktemp)
echo "$PROMPT" > "$TEMP_PROMPT" echo "$PROMPT" >"$TEMP_PROMPT"
# Use Claude Sonnet for better user-focused, plain-language release notes. # Use Claude Sonnet for better user-focused, plain-language release notes.
# Haiku tends to echo technical commit language; Sonnet better translates to user benefits. # Haiku tends to echo technical commit language; Sonnet better translates to user benefits.
@ -450,7 +450,7 @@ End after the Buy Me A Coffee button. No meta-commentary, no explanations."
COPILOT_MODEL="${COPILOT_MODEL:-claude-sonnet-4.6}" COPILOT_MODEL="${COPILOT_MODEL:-claude-sonnet-4.6}"
# Call copilot CLI (it will handle authentication interactively) # Call copilot CLI (it will handle authentication interactively)
copilot --model "$COPILOT_MODEL" < "$TEMP_PROMPT" || { copilot --model "$COPILOT_MODEL" <"$TEMP_PROMPT" || {
echo "" echo ""
log_info "${YELLOW}Warning: GitHub Copilot CLI failed or was not authenticated${NC}" log_info "${YELLOW}Warning: GitHub Copilot CLI failed or was not authenticated${NC}"
log_info "${YELLOW}Falling back to git-cliff${NC}" log_info "${YELLOW}Falling back to git-cliff${NC}"
@ -501,7 +501,7 @@ generate_with_gitcliff() {
# Create temporary cliff.toml if not exists # Create temporary cliff.toml if not exists
if [ ! -f "cliff.toml" ]; then if [ ! -f "cliff.toml" ]; then
cat > /tmp/cliff.toml <<'EOF' cat >/tmp/cliff.toml <<'EOF'
[changelog] [changelog]
header = "" header = ""
body = """ body = """
@ -723,21 +723,19 @@ generate_with_manual() {
# Append to appropriate file # Append to appropriate file
case "$TYPE" in case "$TYPE" in
whats_new) whats_new)
echo "$LINE" >> "$WHATS_NEW_FILE" echo "$LINE" >>"$WHATS_NEW_FILE"
;; ;;
fixed) fixed)
echo "$LINE" >> "$FIXED_FILE" echo "$LINE" >>"$FIXED_FILE"
;; ;;
reliable) reliable)
echo "$LINE" >> "$RELIABLE_FILE" echo "$LINE" >>"$RELIABLE_FILE"
;; ;;
deps) deps)
echo "$LINE" >> "$DEPS_FILE" echo "$LINE" >>"$DEPS_FILE"
;;
skip)
;;
*)
;; ;;
skip) ;;
*) ;;
esac esac
done done
@ -797,7 +795,7 @@ fi
# Validate backend availability # Validate backend availability
case "$BACKEND" in case "$BACKEND" in
copilot) copilot)
if ! command -v copilot >/dev/null 2>&1; then if ! command -v copilot >/dev/null 2>&1; then
echo -e "${RED}Error: GitHub Copilot CLI not found${NC}" >&2 echo -e "${RED}Error: GitHub Copilot CLI not found${NC}" >&2
echo "Install: npm install -g @github/copilot" >&2 echo "Install: npm install -g @github/copilot" >&2
@ -805,7 +803,7 @@ case "$BACKEND" in
exit 1 exit 1
fi fi
;; ;;
git-cliff) git-cliff)
if ! command -v git-cliff >/dev/null 2>&1; then if ! command -v git-cliff >/dev/null 2>&1; then
echo -e "${RED}Error: git-cliff not found${NC}" >&2 echo -e "${RED}Error: git-cliff not found${NC}" >&2
echo "Install: https://git-cliff.org/docs/installation" >&2 echo "Install: https://git-cliff.org/docs/installation" >&2
@ -819,13 +817,13 @@ if [ "$AUTO_UPDATE_AVAILABLE" = "true" ]; then
TEMP_NOTES=$(mktemp) TEMP_NOTES=$(mktemp)
case "$BACKEND" in case "$BACKEND" in
copilot) copilot)
generate_with_copilot > "$TEMP_NOTES" generate_with_copilot >"$TEMP_NOTES"
;; ;;
git-cliff) git-cliff)
generate_with_gitcliff > "$TEMP_NOTES" generate_with_gitcliff >"$TEMP_NOTES"
;; ;;
manual) manual)
generate_with_manual > "$TEMP_NOTES" generate_with_manual >"$TEMP_NOTES"
;; ;;
esac esac
else else
@ -903,7 +901,7 @@ fi
# Save body (without H1 title) to temp file for GitHub # Save body (without H1 title) to temp file for GitHub
TEMP_BODY=$(mktemp) TEMP_BODY=$(mktemp)
echo "$NOTES_BODY" > "$TEMP_BODY" echo "$NOTES_BODY" >"$TEMP_BODY"
# Show the generated notes (with title for preview) # Show the generated notes (with title for preview)
if [ -n "$EXTRACTED_TITLE" ]; then if [ -n "$EXTRACTED_TITLE" ]; then

View file

@ -37,7 +37,7 @@ fi
# Check 2: manifest.json syntax # Check 2: manifest.json syntax
printf "%b Checking manifest.json syntax...%b\n" "$BOLD" "$NC" printf "%b Checking manifest.json syntax...%b\n" "$BOLD" "$NC"
if ! python -m json.tool "$INTEGRATION_PATH/manifest.json" > /dev/null 2>&1; then if ! python -m json.tool "$INTEGRATION_PATH/manifest.json" >/dev/null 2>&1; then
log_result 1 "manifest.json has invalid JSON syntax" log_result 1 "manifest.json has invalid JSON syntax"
ERRORS=$((ERRORS + 1)) ERRORS=$((ERRORS + 1))
else else
@ -49,7 +49,7 @@ printf "%b Checking translation files syntax...%b\n" "$BOLD" "$NC"
for lang_file in "$INTEGRATION_PATH"/translations/*.json; do for lang_file in "$INTEGRATION_PATH"/translations/*.json; do
if [[ -f $lang_file ]]; then if [[ -f $lang_file ]]; then
lang=$(basename "$lang_file") lang=$(basename "$lang_file")
if ! python -m json.tool "$lang_file" > /dev/null 2>&1; then if ! python -m json.tool "$lang_file" >/dev/null 2>&1; then
log_result 1 "$lang has invalid JSON syntax" log_result 1 "$lang has invalid JSON syntax"
ERRORS=$((ERRORS + 1)) ERRORS=$((ERRORS + 1))
else else
@ -64,7 +64,7 @@ if [[ -d $INTEGRATION_PATH/custom_translations ]]; then
for lang_file in "$INTEGRATION_PATH"/custom_translations/*.json; do for lang_file in "$INTEGRATION_PATH"/custom_translations/*.json; do
if [[ -f $lang_file ]]; then if [[ -f $lang_file ]]; then
lang=$(basename "$lang_file") lang=$(basename "$lang_file")
if ! python -m json.tool "$lang_file" > /dev/null 2>&1; then if ! python -m json.tool "$lang_file" >/dev/null 2>&1; then
log_result 1 "custom_translations/$lang has invalid JSON syntax" log_result 1 "custom_translations/$lang has invalid JSON syntax"
ERRORS=$((ERRORS + 1)) ERRORS=$((ERRORS + 1))
else else

View file

@ -94,7 +94,7 @@ require_command "jq" "apt-get install jq (or brew install jq)"
cp "$MANIFEST" "$MANIFEST.backup" cp "$MANIFEST" "$MANIFEST.backup"
# Update version with jq # Update version with jq
if ! jq ".version = \"$VERSION\"" "$MANIFEST" > "$MANIFEST.tmp"; then if ! jq ".version = \"$VERSION\"" "$MANIFEST" >"$MANIFEST.tmp"; then
mv "$MANIFEST.backup" "$MANIFEST" mv "$MANIFEST.backup" "$MANIFEST"
die "Failed to update manifest.json" die "Failed to update manifest.json"
fi fi

View file

@ -66,7 +66,7 @@ parse_version() {
} }
CURRENT_VERSION="${FROM_TAG#v}" CURRENT_VERSION="${FROM_TAG#v}"
read -r MAJOR MINOR PATCH PRERELEASE <<< "$(parse_version "$CURRENT_VERSION")" read -r MAJOR MINOR PATCH PRERELEASE <<<"$(parse_version "$CURRENT_VERSION")"
printf "Current released version: %bv%s.%s.%s%s%b\n" "$BOLD" "$MAJOR" "$MINOR" "$PATCH" "$PRERELEASE" "$NC" printf "Current released version: %bv%s.%s.%s%s%b\n" "$BOLD" "$MAJOR" "$MINOR" "$PATCH" "$PRERELEASE" "$NC"
if [[ $MANIFEST_VERSION != "$CURRENT_VERSION" ]]; then if [[ $MANIFEST_VERSION != "$CURRENT_VERSION" ]]; then

View file

@ -101,11 +101,11 @@ pre-commit install
log_header "Updating shell environment" log_header "Updating shell environment"
if ! grep -q "source $HOME/.venv/bin/activate" "$HOME/.bashrc" 2>/dev/null; then if ! grep -q "source $HOME/.venv/bin/activate" "$HOME/.bashrc" 2>/dev/null; then
echo "source $HOME/.venv/bin/activate" >> "$HOME/.bashrc" echo "source $HOME/.venv/bin/activate" >>"$HOME/.bashrc"
fi fi
if [[ -f $HOME/.zshrc ]]; then if [[ -f $HOME/.zshrc ]]; then
if ! grep -q "source $HOME/.venv/bin/activate" "$HOME/.zshrc"; then if ! grep -q "source $HOME/.venv/bin/activate" "$HOME/.zshrc"; then
echo "source $HOME/.venv/bin/activate" >> "$HOME/.zshrc" echo "source $HOME/.venv/bin/activate" >>"$HOME/.zshrc"
fi fi
fi fi

View file

@ -74,7 +74,7 @@ ensure_command_alias "rg" "ripgrep"
# Ensure user-local bin directory is available in interactive shells. # Ensure user-local bin directory is available in interactive shells.
if ! grep -q '\$HOME/.local/bin' "$HOME/.zshrc" 2>/dev/null; then if ! grep -q '\$HOME/.local/bin' "$HOME/.zshrc" 2>/dev/null; then
printf '\n# Added by scripts/setup/setup\nexport PATH="$HOME/.local/bin:$PATH"\n' >> "$HOME/.zshrc" printf '\n# Added by scripts/setup/setup\nexport PATH="$HOME/.local/bin:$PATH"\n' >>"$HOME/.zshrc"
fi fi
# Install HACS for testing with other custom components # Install HACS for testing with other custom components
@ -104,8 +104,8 @@ fi
# Download and extract HACS (stable release ZIP) # Download and extract HACS (stable release ZIP)
cd config/custom_components cd config/custom_components
log_step "Downloading HACS" log_step "Downloading HACS"
if wget -q https://github.com/hacs/integration/releases/latest/download/hacs.zip && \ if wget -q https://github.com/hacs/integration/releases/latest/download/hacs.zip &&
unzip -q hacs.zip -d hacs && \ unzip -q hacs.zip -d hacs &&
rm hacs.zip; then rm hacs.zip; then
cd ../.. cd ../..