diff --git a/custom_components/adaptive_lighting/docs_gen.py b/custom_components/adaptive_lighting/docs_gen.py index 7920bc7c..d48144fc 100644 --- a/custom_components/adaptive_lighting/docs_gen.py +++ b/custom_components/adaptive_lighting/docs_gen.py @@ -9,10 +9,6 @@ from __future__ import annotations import re from pathlib import Path -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - pass # Path to README relative to this module _MODULE_DIR = Path(__file__).parent @@ -36,6 +32,7 @@ def readme_section(section_name: str, *, strip_heading: bool = False) -> str: Raises: ValueError: If the section is not found in README.md + """ content = README_PATH.read_text() diff --git a/docs/run_markdown_code_runner.py b/docs/run_markdown_code_runner.py index d9b76338..b644533c 100644 --- a/docs/run_markdown_code_runner.py +++ b/docs/run_markdown_code_runner.py @@ -29,7 +29,9 @@ def find_markdown_files() -> list[Path]: def has_code_blocks(file_path: Path) -> bool: """Check if a Markdown file has CODE blocks.""" content = file_path.read_text() - return "" in content or "```python markdown-code-runner" in content + return ( + "" in content or "```python markdown-code-runner" in content + ) def run_markdown_code_runner(file_path: Path) -> bool: @@ -50,7 +52,9 @@ def run_markdown_code_runner(file_path: Path) -> bool: print(f" Error: {e.stderr}") return False except FileNotFoundError: - print(" Error: markdown-code-runner not found. Install with: pip install markdown-code-runner") + print( + " Error: markdown-code-runner not found. Install with: pip install markdown-code-runner" + ) return False @@ -75,10 +79,10 @@ def main() -> int: print(f"\nProcessing {relative_path}...") if run_markdown_code_runner(file_path): - print(f" ✓ Success") + print(" ✓ Success") success_count += 1 else: - print(f" ✗ Failed") + print(" ✗ Failed") failure_count += 1 print(f"\n{'='*50}")