Skip to content

Fix lint: codespell regex fragment and mypy errors in the MySQL TLS connection - #1696

Merged
dimitri-yatsenko merged 1 commit into
masterfrom
fix/lint-codespell-mypy
Nov 20, 2026
Merged

dimitri-yatsenko merged 1 commit into
masterfrom
fix/lint-codespell-mypy

Conversation

@dimitri-yatsenko

Copy link
Copy Markdown
Member

The Lint job has failed on master since the recent merges. This PR fixes it, and also clears the mypy pre-commit hook. The Lint workflow runs only codespell, ruff and ruff-format, so the mypy part fixes local commit hooks rather than CI.

codespell: the pattern char(?:acter)? in src/datajoint/condition.py matches both char and character. codespell reads acter as a misspelling of "actor". This PR adds acter to ignore-words-list in [tool.codespell] with a comment like the existing entries. The regex is not changed.

mypy: the TLS connection subclass in src/datajoint/adapters/mysql.py uses server_capabilities and _request_authentication. Both are PyMySQL internals that types-PyMySQL does not declare. This PR adds targeted # type: ignore[attr-defined] / # type: ignore[misc] comments to those three lines, with a short note explaining why. There is no behavior change.

Verification:

  • pre-commit run --all-files: all hooks pass, including codespell, ruff and ruff-format (the ones the Lint workflow runs) and mypy
  • pytest tests/unit: 1068 passed

codespell flags "acter" in the char(?:acter)? pattern in condition.py; add
it to the ignore list. mypy reports server_capabilities and
_request_authentication on the TLS connection subclass, which are PyMySQL
internals that types-PyMySQL does not declare; mark those three lines with
targeted type-ignore codes. No behavior change.
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