Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement flake8-type-checking #2300

Merged
merged 1 commit into from
Jul 17, 2022

Conversation

half-duplex
Copy link
Member

@half-duplex half-duplex commented Jun 8, 2022

Description

Tin. See #1765

Checklist

  • I have read CONTRIBUTING.md
  • I can and do license this contribution under the EFLv2
  • No issues are reported by make qa (runs make quality and make test)
  • I have tested the functionality of the things this change touches

@half-duplex half-duplex added the Housekeeping Code cleanup, removal of deprecated stuff, etc. label Jun 8, 2022
@half-duplex half-duplex force-pushed the type-checking-blocks branch from df414de to 9cc9c3e Compare June 8, 2022 23:24
@half-duplex
Copy link
Member Author

Had to restrict it to python 3.8+ since flake8-type-checking doesn't support 3.7...

@dgw
Copy link
Member

dgw commented Jun 9, 2022

Think I threw it on the todo pile in #1765 instead of just doing it immediately because there's no support for 3.7… But there's actually nothing that breaks if someone runs style checks on 3.7, only the potential for missing TC error codes that CI will flag. And probably no one should be running their main development on anything older than 3.8 or 3.9… so I declare my past self silly.

Can you exclude/ignore the TC200 error series? We want to use delayed evaluation (it's why our files use from __future__ import annotations), not forward references. Might also want type-checking-exempt-modules = typing, which would make the places where from typing appears both inside and outside the TYPE_CHECKING block unnecessary.

(My present self is also silly, just for different reasons.)

@dgw
Copy link
Member

dgw commented Jun 29, 2022

Cool. Time to ask for review from the one with actual experience using mypy.

@dgw dgw requested a review from Exirel June 29, 2022 19:14
@Exirel
Copy link
Contributor

Exirel commented Jun 30, 2022

That's interesting. Maybe it's also time to officially add mypy to the mix then?

@dgw
Copy link
Member

dgw commented Jul 3, 2022

Could be, if it doesn't generate any errors after merging with master. Whatcha think about this otherwise?

Copy link
Contributor

@Exirel Exirel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm OK with that as long as make mypy works.

setup.cfg Outdated Show resolved Hide resolved
@half-duplex half-duplex force-pushed the type-checking-blocks branch from 1731ae0 to df815a2 Compare July 14, 2022 18:33
@dgw dgw merged commit 55c78a4 into sopel-irc:master Jul 17, 2022
@half-duplex half-duplex deleted the type-checking-blocks branch July 20, 2022 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Housekeeping Code cleanup, removal of deprecated stuff, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants