mirror of
https://github.com/jpawlowski/hass.tibber_prices.git
synced 2026-07-27 17:26:48 +00:00
Add UV_PRERELEASE=allow to the format, lint-check, and lint-fix scripts to enable pre-release features in Ruff. Impact: Users can now utilize pre-release features during code formatting and linting processes.
34 lines
752 B
Bash
Executable file
34 lines
752 B
Bash
Executable file
#!/bin/bash
|
|
|
|
# script/format: Format code with Ruff formatter
|
|
#
|
|
# Runs Ruff format and applies formatting changes. Automatically cleans up any
|
|
# accidental package installations after running.
|
|
#
|
|
# Usage:
|
|
# ./scripts/format
|
|
#
|
|
# Examples:
|
|
# ./scripts/format
|
|
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
cd "$SCRIPT_DIR/.."
|
|
|
|
# shellcheck source=scripts/.lib/output.sh
|
|
source "$SCRIPT_DIR/.lib/output.sh"
|
|
|
|
if [[ -z ${VIRTUAL_ENV:-} ]]; then
|
|
# shellcheck source=/dev/null
|
|
source "$HOME/.venv/bin/activate"
|
|
fi
|
|
|
|
log_header "Running Ruff format"
|
|
export UV_PRERELEASE=allow
|
|
uv run --active ruff format .
|
|
|
|
# Clean up any accidental package installation from uv run
|
|
"$SCRIPT_DIR/clean" --minimal
|
|
|
|
log_success "Formatting completed"
|