mirror of
https://github.com/jpawlowski/hass.tibber_prices.git
synced 2026-05-28 18:43:40 +00:00
Add a dedicated type-check-tests helper, wire it into check-all behind --with-test-types, and align the affected tests with current typing and helper contracts. Impact: No direct user-facing change. User-Impact: none
34 lines
852 B
Bash
Executable file
34 lines
852 B
Bash
Executable file
#!/bin/bash
|
|
|
|
# script/type-check-tests: Run optional Pyright checks for test files
|
|
#
|
|
# Runs Pyright on tests without changing the main repository type-check scope.
|
|
# Defaults to the full tests/ tree, but accepts optional file or folder targets.
|
|
#
|
|
# Usage:
|
|
# ./scripts/type-check-tests
|
|
# ./scripts/type-check-tests tests/test_period_overlap.py tests/test_periods_hash.py
|
|
|
|
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
|
|
|
|
targets=("$@")
|
|
if [[ ${#targets[@]} -eq 0 ]]; then
|
|
targets=("tests")
|
|
fi
|
|
|
|
log_header "Running type checking tools for test files"
|
|
|
|
pyright "${targets[@]}"
|
|
|
|
log_success "Test type checking completed"
|