hass.tibber_prices/scripts/lint-fix
Julian Pawlowski 330b167281
Some checks failed
Lint / Ruff (push) Has been cancelled
Validate / Hassfest validation (push) Has been cancelled
Validate / HACS validation (push) Has been cancelled
chore(scripts): set UV_PRERELEASE environment variable for formatting scripts
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.
2026-06-01 16:57:21 +00:00

34 lines
759 B
Bash
Executable file

#!/bin/bash
# script/lint-fix: Apply lint fixes with Ruff
#
# Runs Ruff check with auto-fix enabled. Automatically cleans up any accidental
# package installations after running.
#
# Usage:
# ./scripts/lint-fix
#
# Examples:
# ./scripts/lint-fix
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 check with auto-fix"
export UV_PRERELEASE=allow
uv run --active ruff check . --fix
# Clean up any accidental package installation from uv run
"$SCRIPT_DIR/clean" --minimal
log_success "Lint fixes applied"