diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a086a57..74401d4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,8 +34,7 @@ jobs: run: uv sync --locked --only-group lint - name: Run Ruff linter - # examples/ is excluded, matching the pre-commit ruff hook - run: uv run --no-sync ruff check src/ tests/ parity/ + run: uv run --no-sync ruff check src/ tests/ examples/ parity/ - name: Run Ruff formatter check run: uv run --no-sync ruff format --check src/ tests/ examples/ parity/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 350468e..4d5a019 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,6 @@ repos: name: ruff check entry: uv run ruff check --fix --force-exclude language: system - exclude: ^examples/ types: [python] require_serial: true - id: ruff-format diff --git a/examples/Async/calc_stats_local.py b/examples/Async/calc_stats_local.py index cf5a55d..b33c4e8 100644 --- a/examples/Async/calc_stats_local.py +++ b/examples/Async/calc_stats_local.py @@ -11,7 +11,7 @@ import asyncio -from swgoh_comlink import SwgohComlinkAsync, StatCalcAsync, GameDataBuilderAsync +from swgoh_comlink import StatCalcAsync async def main(): diff --git a/examples/Async/concurrent_requests.py b/examples/Async/concurrent_requests.py index 9c7a288..f12ed8d 100644 --- a/examples/Async/concurrent_requests.py +++ b/examples/Async/concurrent_requests.py @@ -9,7 +9,6 @@ from swgoh_comlink import SwgohComlinkAsync - # Example ally codes to fetch concurrently ALLY_CODES = [ 314927874, diff --git a/examples/Async/get_events.py b/examples/Async/get_events.py index 219bde2..079ef7f 100644 --- a/examples/Async/get_events.py +++ b/examples/Async/get_events.py @@ -5,7 +5,6 @@ import asyncio from datetime import datetime, timezone -from typing import Union from swgoh_comlink import SwgohComlinkAsync diff --git a/examples/Async/get_player_arena_profile.py b/examples/Async/get_player_arena_profile.py index 7c4184a..2fcec32 100644 --- a/examples/Async/get_player_arena_profile.py +++ b/examples/Async/get_player_arena_profile.py @@ -7,7 +7,6 @@ # Place module imports below this line from swgoh_comlink import SwgohComlinkAsync -from pprint import pprint as pp async def main(): diff --git a/examples/Async/streaming_guild_roster_advanced.py b/examples/Async/streaming_guild_roster_advanced.py index 34fb75b..21ae98f 100644 --- a/examples/Async/streaming_guild_roster_advanced.py +++ b/examples/Async/streaming_guild_roster_advanced.py @@ -28,7 +28,6 @@ import argparse import asyncio -import statistics import time from swgoh_comlink import SwgohComlinkAsync @@ -225,7 +224,6 @@ async def main(): print(f"Fetching {total} member profiles (max {args.retries} retries each)...\n") # Step 3: Fetch all members concurrently using TaskGroup - fetch_times: list[float] = [] results: list[dict | None] = [] overall_start = time.perf_counter() diff --git a/examples/Sync/calc_stats_local.py b/examples/Sync/calc_stats_local.py index 15c1d4d..beb336f 100644 --- a/examples/Sync/calc_stats_local.py +++ b/examples/Sync/calc_stats_local.py @@ -9,7 +9,7 @@ 4. GameDataBuilder — fetches data dynamically from a running Comlink service """ -from swgoh_comlink import SwgohComlink, StatCalc, GameDataBuilder +from swgoh_comlink import StatCalc # --- Example 1: Basic unit (no skills or mods) --- basic_unit = { diff --git a/examples/Sync/get_player_arena_profile.py b/examples/Sync/get_player_arena_profile.py index 5767beb..cf2f690 100644 --- a/examples/Sync/get_player_arena_profile.py +++ b/examples/Sync/get_player_arena_profile.py @@ -4,8 +4,8 @@ """ # Place module imports below this line + from swgoh_comlink import SwgohComlink -from pprint import pprint as pp # create an instance of a SwgohComlink object comlink = SwgohComlink() diff --git a/pyproject.toml b/pyproject.toml index 7063090..0297699 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -166,6 +166,8 @@ ignore = [ # Existing violations to address incrementally — do not add new suppressions "src/swgoh_comlink/__init__.py" = ["UP036"] # outdated version block (sys.exit check) "src/swgoh_comlink/helpers/*.py" = ["B007", "B904", "SIM102"] # existing patterns to clean up +# Examples assign results to named variables to show what each call returns +"examples/**" = ["F841"] [tool.ruff.lint.isort] known-first-party = ["swgoh_comlink"]