Skip to content

Fix code quality: resolve all ruff and mypy errors#9

Merged
BeckettFrey merged 5 commits into
releasefrom
copilot/be-minimally-invasive
Dec 23, 2025
Merged

Fix code quality: resolve all ruff and mypy errors#9
BeckettFrey merged 5 commits into
releasefrom
copilot/be-minimally-invasive

Conversation

Copilot AI commented Dec 23, 2025

Copy link
Copy Markdown
Contributor

Addressed all code quality issues across the codebase by fixing linting errors and type checking violations.

Changes

Formatting and Linting

  • Auto-fixed 125 ruff errors (unused imports, line length, security issues)
  • Replaced subprocess.run() with shell=True to use list arguments
  • Added per-file ignores for legitimate subprocess and temp directory usage in build/service files

Type Checking

TypedDict syntax errors: Fixed invalid subscript syntax used for type hints

# Before
def _get_model_root(engine_id: str, model_id: ModelMetadata["id"]) -> Path | None:

# After  
def _get_model_root(engine_id: str, model_id: str) -> Path | None:

Literal types for discriminated unions:

# Before
def create_model(...) -> Tuple[True, ModelMetadata] | Tuple[False, str]:

# After
def create_model(...) -> tuple[Literal[True], ModelMetadata] | tuple[Literal[False], str]:

Path vs str mismatches: Changed TypedDict fields expecting Path objects to receive Path instead of str(path)

Missing type annotations: Added explicit type hints for class attributes and variables where mypy couldn't infer them

Function signature mismatches: Aligned overridden method signatures with base class definitions

Verification

  • ✅ ruff format --check (73 files)
  • ✅ ruff check (0 errors)
  • ✅ mypy (73 source files, 0 errors)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/BrainBehaviorAnalyticsLab/PyPLLRComputer/commits/HEAD
    • Triggering command: /home/REDACTED/.local/bin/uv uv sync (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Do what you do, be minimally invasive.

Custom agent used: code-quality-agent
Fixes linting, formatting, and type checking issues by running make commands until all checks pass


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits December 23, 2025 19:12
Co-authored-by: BeckettFrey <83560790+BeckettFrey@users.noreply.github.com>
Co-authored-by: BeckettFrey <83560790+BeckettFrey@users.noreply.github.com>
Co-authored-by: BeckettFrey <83560790+BeckettFrey@users.noreply.github.com>
Co-authored-by: BeckettFrey <83560790+BeckettFrey@users.noreply.github.com>
@BeckettFrey BeckettFrey marked this pull request as ready for review December 23, 2025 19:31
Copilot AI changed the title [WIP] Implement minimal invasive changes Fix code quality: resolve all ruff and mypy errors Dec 23, 2025
Copilot AI requested a review from BeckettFrey December 23, 2025 19:31
@BeckettFrey BeckettFrey merged commit 26f3450 into release Dec 23, 2025
@BeckettFrey BeckettFrey deleted the copilot/be-minimally-invasive branch January 6, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants