Skip to content

Mypy config changes & enable a few more checks - #133

Merged
jorio merged 6 commits into
jorio:masterfrom
CoolCat467:mypy
Aug 7, 2026
Merged

Mypy config changes & enable a few more checks#133
jorio merged 6 commits into
jorio:masterfrom
CoolCat467:mypy

Conversation

@CoolCat467

Copy link
Copy Markdown
Contributor

In this pull request, we tell mypy which paths to check so you can simply do mypy and check all relevant files instead of running into future cases where if things were to get more complicated, needing to change which files to check in multiple places.

Turned on warn_unreachable and dealt with new errors from this.

Turned on local_partial_types to match the results of the mypy daemon (might not be necessary, I think they said they wanted to make true the default eventually in a blog post a while ago exactly because of this)

We also show more diagnostic information for reported errors and show tracebacks in the event mypy crashes.

Also added a few missing annotations, mainly in mainwindow

Was trying out turning on warn_unused_ignores, but ran into issues with the multiple UI backend shenanigans stuff and decided not to deal with that right now, but left it as commented out because it was useful to make sure my changes weren't adding anything new.

Also show tracebacks if mypy crashes as well as error codes and column numbers for reported errors.
Comment thread gitfourchette/syntax/lexercache.py
Comment thread gitfourchette/prefsfile.py
Comment thread gitfourchette/gitdriver/gitdriver.py Outdated
Comment thread gitfourchette/mainwindow.py Outdated
CoolCat467 and others added 2 commits August 6, 2026 13:28
Co-authored-by: Iliyas Jorio <iliyas@jor.io>
(from GitHub PR suggestion)
@jorio
jorio merged commit d0c0e1d into jorio:master Aug 7, 2026
@jorio

jorio commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Thank you for your contribution!

If you want to keep warn_unused_ignores, I suggest either:

  • tell mypy to ignore gitfourchette/forms/ui_*.py (it's all auto-generated code)

  • or, you can strip the # type: ignore comments added by pyuic6, if it turns out that they're all useless. To do this, you can add r"\s*# type: ignore$" to nukePatterns in update_resources.py, then run it with --ui --force to recreate the UI files.

@CoolCat467
CoolCat467 deleted the mypy branch August 7, 2026 19:02
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