Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions scripts/python-format.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh
# Format Python files in the given directory using black.
# Usage: python-format.sh <directory>

set -e

TARGET_DIR="${1:-.}"

# Install black if not available
if ! command -v black >/dev/null 2>&1; then
echo "black not found. Installing via pip3..." >&2
pip3 install black
fi

cd "$TARGET_DIR"
black ./

17 changes: 17 additions & 0 deletions scripts/xml-format.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh
# Format XML files in the given directory using xmllint.
# Usage: xml-format.sh <directory>

set -e

TARGET_DIR="${1:-.}"

# Install xmllint if not available
if ! command -v xmllint >/dev/null 2>&1; then
echo "xmllint not found. Installing libxml2-utils..." >&2
apt-get update && apt-get install -y libxml2-utils
fi

cd "$TARGET_DIR"
find . -type f -name "*.xml" -exec xmllint --format {} --output {} \;